10 #ifndef RUBY_DEFINES_H 11 #define RUBY_DEFINES_H 1 13 #if defined(__cplusplus) 20 #include "ruby/config.h" 22 #include RUBY_EXTCONF_H 27 # define CONSTFUNC(x) x 30 # define PUREFUNC(x) x 32 #define NORETURN_STYLE_NEW 1 34 # define NORETURN(x) x 37 # define DEPRECATED(x) x 40 # define DEPRECATED_BY(n,x) DEPRECATED(x) 42 #ifndef DEPRECATED_TYPE 43 # define DEPRECATED_TYPE(mesg, decl) decl 46 # define NOINLINE(x) x 49 # define ALWAYS_INLINE(x) x 52 # define HAVE_ATTRIBUTE_ERRORFUNC 0 53 # define ERRORFUNC(mesg, x) x 55 # define HAVE_ATTRIBUTE_ERRORFUNC 1 58 # define HAVE_ATTRIBUTE_WARNINGFUNC 0 59 # define WARNINGFUNC(mesg, x) x 61 # define HAVE_ATTRIBUTE_WARNINGFUNC 1 64 #ifndef GCC_VERSION_SINCE 65 # if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) 66 # define GCC_VERSION_SINCE(major, minor, patchlevel) \ 67 ((__GNUC__ > (major)) || \ 68 ((__GNUC__ == (major) && \ 69 ((__GNUC_MINOR__ > (minor)) || \ 70 (__GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel)))))) 72 # define GCC_VERSION_SINCE(major, minor, patchlevel) 0 78 #define RB_LIKELY(x) (__builtin_expect(!!(x), 1)) 79 #define RB_UNLIKELY(x) (__builtin_expect(!!(x), 0)) 81 #define RB_LIKELY(x) (x) 82 #define RB_UNLIKELY(x) (x) 86 #define PRINTF_ARGS(decl, string_index, first_to_check) \ 87 decl __attribute__((format(printf, string_index, first_to_check))) 89 #define PRINTF_ARGS(decl, string_index, first_to_check) decl 93 #define RB_GNUC_EXTENSION __extension__ 94 #define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; }) 96 #define RB_GNUC_EXTENSION 97 #define RB_GNUC_EXTENSION_BLOCK(x) (x) 102 #ifdef HAVE_SYS_TYPES_H 103 # include <sys/types.h> 105 #ifdef HAVE_SYS_STAT_H 106 # include <sys/stat.h> 112 # ifdef HAVE_STDLIB_H 117 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H 122 #ifdef HAVE_STRINGS_H 123 # include <strings.h> 125 #ifdef HAVE_INTTYPES_H 126 # include <inttypes.h> 135 #ifdef HAVE_SYS_SELECT_H 136 # include <sys/select.h> 139 #ifdef RUBY_USE_SETJMPEX 140 #include <setjmpex.h> 148 # ifndef HAVE_PROTOTYPES 149 # define HAVE_PROTOTYPES 1 151 # ifndef HAVE_STDARG_PROTOTYPES 152 # define HAVE_STDARG_PROTOTYPES 1 157 #ifdef HAVE_PROTOTYPES 158 # define _(args) args 164 #ifdef HAVE_STDARG_PROTOTYPES 165 # define __(args) args 176 #ifndef RUBY_SYMBOL_EXPORT_BEGIN 177 # define RUBY_SYMBOL_EXPORT_BEGIN 178 # define RUBY_SYMBOL_EXPORT_END 183 #define xmalloc ruby_xmalloc 184 #define xmalloc2 ruby_xmalloc2 185 #define xcalloc ruby_xcalloc 186 #define xrealloc ruby_xrealloc 187 #define xrealloc2 ruby_xrealloc2 188 #define xfree ruby_xfree 190 #if GCC_VERSION_SINCE(4,3,0) 191 # define RUBY_ATTR_ALLOC_SIZE(params) __attribute__ ((alloc_size params)) 193 # define RUBY_ATTR_ALLOC_SIZE(params) 203 #define STRINGIZE(expr) STRINGIZE0(expr) 205 #define STRINGIZE0(expr) #expr 208 #ifdef HAVE_LONG_LONG 209 # define HAVE_TRUE_LONG_LONG 1 212 #if SIZEOF_LONG_LONG > 0 213 # define LONG_LONG long long 214 #elif SIZEOF___INT64 > 0 215 # define HAVE_LONG_LONG 1 216 # define LONG_LONG __int64 217 # undef SIZEOF_LONG_LONG 218 # define SIZEOF_LONG_LONG SIZEOF___INT64 232 # define DOSISH_DRIVE_LETTER 235 #ifdef AC_APPLE_UNIVERSAL_BUILD 236 #undef WORDS_BIGENDIAN 237 #ifdef __BIG_ENDIAN__ 238 #define WORDS_BIGENDIAN 252 # error FALSE must be false 257 # error TRUE must be true 262 #ifndef RUBY_FUNC_EXPORTED 263 #define RUBY_FUNC_EXPORTED 267 #define RUBY_EXTERN extern 271 #define EXTERN RUBY_EXTERN 274 #ifndef RUBY_MBCHAR_MAXSIZE 275 #define RUBY_MBCHAR_MAXSIZE INT_MAX 281 # define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows() 282 #elif defined(__ia64) 283 void *rb_ia64_bsp(
void);
284 void rb_ia64_flushrs(
void);
285 # define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs() 287 # define FLUSH_REGISTER_WINDOWS ((void)0) 295 #define PATH_SEP_CHAR PATH_SEP[0] 297 #define PATH_ENV "PATH" 300 #define ENV_IGNORECASE 303 #ifndef CASEFOLD_FILESYSTEM 305 # define CASEFOLD_FILESYSTEM 1 307 # define CASEFOLD_FILESYSTEM 0 312 #define DLEXT_MAXLEN 4 315 #ifndef RUBY_PLATFORM 316 #define RUBY_PLATFORM "unknown-unknown" 319 #ifndef FUNC_MINIMIZED 320 #define FUNC_MINIMIZED(x) x 322 #ifndef FUNC_UNOPTIMIZED 323 #define FUNC_UNOPTIMIZED(x) x 325 #ifndef RUBY_ALIAS_FUNCTION_TYPE 326 #define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \ 327 FUNC_MINIMIZED(type prot) {return (type)name args;} 329 #ifndef RUBY_ALIAS_FUNCTION_VOID 330 #define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \ 331 FUNC_MINIMIZED(void prot) {name args;} 333 #ifndef RUBY_ALIAS_FUNCTION 334 #define RUBY_ALIAS_FUNCTION(prot, name, args) \ 335 RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args) 338 #ifndef UNALIGNED_WORD_ACCESS 339 # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ 340 defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \ 341 defined(__powerpc64__) || \ 343 # define UNALIGNED_WORD_ACCESS 1 345 # define UNALIGNED_WORD_ACCESS 0 348 #ifndef PACKED_STRUCT 349 # define PACKED_STRUCT(x) x 351 #ifndef PACKED_STRUCT_UNALIGNED 352 # if UNALIGNED_WORD_ACCESS 353 # define PACKED_STRUCT_UNALIGNED(x) PACKED_STRUCT(x) 355 # define PACKED_STRUCT_UNALIGNED(x) x 361 #if defined(__cplusplus)
#define RUBY_ATTR_ALLOC_SIZE(params)
#define RUBY_SYMBOL_EXPORT_END
#define RUBY_SYMBOL_EXPORT_BEGIN
void rb_sparc_flush_register_windows(void)