Flowdock
method

convertible_int

Importance_2
v1_9_3_392 - Show latest stable - 0 notes - Class: Object
convertible_int(type, headers = nil, opts = nil, &b) public

Returns the convertible integer type of the given type. You may optionally specify additional headers to search in for the type. Convertible means actually same type, or typedefed from same type.

If the type is a integer type and convertible type is found, following macros are passed as preprocessor constants to the compiler using the type name, in uppercase.

  • ‘TYPEOF_’, followed by the type name, followed by ‘=X’ where ‘X’ is the found convertible type name. * ‘TYP2NUM’ and ‘NUM2TYP, where ’TYP’ is the type name in uppercase with replacing ‘_t’ suffix with ‘T’, followed by ‘=X’ where ‘X’ is the macro name to convert type to Integer object, and vice versa.

For example, if foobar_t is defined as unsigned long, then convertible_int(“foobar_t”) would return “unsigned long”, and define macros:

#define TYPEOF_FOOBAR_T unsigned long
#define FOOBART2NUM ULONG2NUM
#define NUM2FOOBART NUM2ULONG
Show source
Register or log in to add new notes.