1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/ext/v8/uint32.h
Georgy Angelov d1e9088cf0 Port a ton of the original ext classes
You can now create a JS object from Ruby-land without segfaulting
2015-03-20 20:47:57 +00:00

18 lines
287 B
C++

#ifndef RR_UINT32
#define RR_UINT32
namespace rr {
class UInt32 : public Equiv {
public:
UInt32(VALUE val) : Equiv(val) {}
UInt32(uint32_t ui) : Equiv(UINT2NUM(ui)) {}
inline operator uint32_t() {
return RTEST(value) ? NUM2UINT(value) : 0;
}
};
}
#endif