diff options
Diffstat (limited to 'ext/fiddle/fiddle.c')
-rw-r--r-- | ext/fiddle/fiddle.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/ext/fiddle/fiddle.c b/ext/fiddle/fiddle.c index 546b1dc451..dd819a298c 100644 --- a/ext/fiddle/fiddle.c +++ b/ext/fiddle/fiddle.c @@ -7,6 +7,10 @@ VALUE rb_eFiddleError; void Init_fiddle_pointer(void); void Init_fiddle_pinned(void); +#ifdef FIDDLE_MEMORY_VIEW +void Init_fiddle_memory_view(void); +#endif + /* * call-seq: Fiddle.malloc(size) * @@ -204,6 +208,38 @@ Init_fiddle(void) rb_define_const(mFiddle, "TYPE_LONG_LONG", INT2NUM(TYPE_LONG_LONG)); #endif +#ifdef TYPE_INT8_T + /* Document-const: TYPE_INT8_T + * + * C type - int8_t + */ + rb_define_const(mFiddle, "TYPE_INT8_T", INT2NUM(TYPE_INT8_T)); +#endif + +#ifdef TYPE_INT16_T + /* Document-const: TYPE_INT16_T + * + * C type - int16_t + */ + rb_define_const(mFiddle, "TYPE_INT16_T", INT2NUM(TYPE_INT16_T)); +#endif + +#ifdef TYPE_INT32_T + /* Document-const: TYPE_INT32_T + * + * C type - int32_t + */ + rb_define_const(mFiddle, "TYPE_INT32_T", INT2NUM(TYPE_INT32_T)); +#endif + +#ifdef TYPE_INT64_T + /* Document-const: TYPE_INT64_T + * + * C type - int64_t + */ + rb_define_const(mFiddle, "TYPE_INT64_T", INT2NUM(TYPE_INT64_T)); +#endif + /* Document-const: TYPE_FLOAT * * C type - float @@ -298,6 +334,30 @@ Init_fiddle(void) rb_define_const(mFiddle, "ALIGN_LONG_LONG", INT2NUM(ALIGN_LONG_LONG)); #endif + /* Document-const: ALIGN_INT8_T + * + * The alignment size of a int8_t + */ + rb_define_const(mFiddle, "ALIGN_INT8_T", INT2NUM(ALIGN_INT8_T)); + + /* Document-const: ALIGN_INT16_T + * + * The alignment size of a int16_t + */ + rb_define_const(mFiddle, "ALIGN_INT16_T", INT2NUM(ALIGN_INT16_T)); + + /* Document-const: ALIGN_INT32_T + * + * The alignment size of a int32_t + */ + rb_define_const(mFiddle, "ALIGN_INT32_T", INT2NUM(ALIGN_INT32_T)); + + /* Document-const: ALIGN_INT64_T + * + * The alignment size of a int64_t + */ + rb_define_const(mFiddle, "ALIGN_INT64_T", INT2NUM(ALIGN_INT64_T)); + /* Document-const: ALIGN_FLOAT * * The alignment size of a float @@ -388,6 +448,30 @@ Init_fiddle(void) rb_define_const(mFiddle, "SIZEOF_LONG_LONG", INT2NUM(sizeof(LONG_LONG))); #endif + /* Document-const: SIZEOF_INT8_T + * + * size of a int8_t + */ + rb_define_const(mFiddle, "SIZEOF_INT8_T", INT2NUM(sizeof(int8_t))); + + /* Document-const: SIZEOF_INT16_T + * + * size of a int16_t + */ + rb_define_const(mFiddle, "SIZEOF_INT16_T", INT2NUM(sizeof(int16_t))); + + /* Document-const: SIZEOF_INT32_T + * + * size of a int32_t + */ + rb_define_const(mFiddle, "SIZEOF_INT32_T", INT2NUM(sizeof(int32_t))); + + /* Document-const: SIZEOF_INT64_T + * + * size of a int64_t + */ + rb_define_const(mFiddle, "SIZEOF_INT64_T", INT2NUM(sizeof(int64_t))); + /* Document-const: SIZEOF_FLOAT * * size of a float @@ -461,5 +545,9 @@ Init_fiddle(void) Init_fiddle_handle(); Init_fiddle_pointer(); Init_fiddle_pinned(); + +#ifdef FIDDLE_MEMORY_VIEW + Init_fiddle_memory_view(); +#endif } /* vim: set noet sws=4 sw=4: */ |