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
32 # ifndef HAVE_PROTOTYPES
33 # define HAVE_PROTOTYPES 1
35 # ifndef HAVE_STDARG_PROTOTYPES
36 # define HAVE_STDARG_PROTOTYPES 1
41 #ifdef HAVE_PROTOTYPES
48 #ifdef HAVE_STDARG_PROTOTYPES
49 # define __(args) args
60 #if defined __GNUC__ && __GNUC__ >= 4
61 #pragma GCC visibility push(default)
64 #define xmalloc ruby_xmalloc
65 #define xmalloc2 ruby_xmalloc2
66 #define xcalloc ruby_xcalloc
67 #define xrealloc ruby_xrealloc
68 #define xrealloc2 ruby_xrealloc2
69 #define xfree ruby_xfree
78 #define STRINGIZE(expr) STRINGIZE0(expr)
80 #define STRINGIZE0(expr) #expr
83 #if SIZEOF_LONG_LONG > 0
84 # define LONG_LONG long long
85 #elif SIZEOF___INT64 > 0
86 # define HAVE_LONG_LONG 1
87 # define LONG_LONG __int64
88 # undef SIZEOF_LONG_LONG
89 # define SIZEOF_LONG_LONG SIZEOF___INT64
92 #if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
93 # define BDIGIT unsigned int
94 # define SIZEOF_BDIGITS SIZEOF_INT
95 # define BDIGIT_DBL unsigned LONG_LONG
96 # define BDIGIT_DBL_SIGNED LONG_LONG
97 # define PRI_BDIGIT_PREFIX ""
98 # define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
99 #elif SIZEOF_INT*2 <= SIZEOF_LONG
100 # define BDIGIT unsigned int
101 # define SIZEOF_BDIGITS SIZEOF_INT
102 # define BDIGIT_DBL unsigned long
103 # define BDIGIT_DBL_SIGNED long
104 # define PRI_BDIGIT_PREFIX ""
105 # define PRI_BDIGIT_DBL_PREFIX "l"
106 #elif SIZEOF_SHORT*2 <= SIZEOF_LONG
107 # define BDIGIT unsigned short
108 # define SIZEOF_BDIGITS SIZEOF_SHORT
109 # define BDIGIT_DBL unsigned long
110 # define BDIGIT_DBL_SIGNED long
111 # define PRI_BDIGIT_PREFIX "h"
112 # define PRI_BDIGIT_DBL_PREFIX "l"
114 # define BDIGIT unsigned short
115 # define SIZEOF_BDIGITS (SIZEOF_LONG/2)
116 # define BDIGIT_DBL unsigned long
117 # define BDIGIT_DBL_SIGNED long
118 # define PRI_BDIGIT_PREFIX "h"
119 # define PRI_BDIGIT_DBL_PREFIX "l"
122 #define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
123 #define PRIiBDIGIT PRI_BDIGIT_PREFIX"i"
124 #define PRIoBDIGIT PRI_BDIGIT_PREFIX"o"
125 #define PRIuBDIGIT PRI_BDIGIT_PREFIX"u"
126 #define PRIxBDIGIT PRI_BDIGIT_PREFIX"x"
127 #define PRIXBDIGIT PRI_BDIGIT_PREFIX"X"
129 #define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d"
130 #define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i"
131 #define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o"
132 #define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u"
133 #define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x"
134 #define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
140 #if defined(_WIN32) || defined(__EMX__)
142 # define DOSISH_DRIVE_LETTER
145 #ifdef AC_APPLE_UNIVERSAL_BUILD
146 #undef WORDS_BIGENDIAN
147 #ifdef __BIG_ENDIAN__
148 #define WORDS_BIGENDIAN
156 #if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
157 #include <net/socket.h>
158 #elif defined (__SYMBIAN32__) && defined (HAVE_SYS_SELECT_H)
159 # include <sys/select.h>
173 # error FALSE must be false
178 # error TRUE must be true
183 #ifndef RUBY_FUNC_EXPORTED
184 #define RUBY_FUNC_EXPORTED
188 #define RUBY_EXTERN extern
192 #define EXTERN RUBY_EXTERN
195 #ifndef RUBY_MBCHAR_MAXSIZE
196 #define RUBY_MBCHAR_MAXSIZE INT_MAX
202 # define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
203 #elif defined(__ia64)
204 void *rb_ia64_bsp(
void);
205 void rb_ia64_flushrs(
void);
206 # define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
208 # define FLUSH_REGISTER_WINDOWS ((void)0)
216 #define PATH_SEP_CHAR PATH_SEP[0]
218 #define PATH_ENV "PATH"
220 #if defined(DOSISH) && !defined(__EMX__)
221 #define ENV_IGNORECASE
224 #ifndef CASEFOLD_FILESYSTEM
226 # define CASEFOLD_FILESYSTEM 1
228 # define CASEFOLD_FILESYSTEM 0
233 #define DLEXT_MAXLEN 4
236 #ifndef RUBY_PLATFORM
237 #define RUBY_PLATFORM "unknown-unknown"
240 #ifndef RUBY_ALIAS_FUNCTION_TYPE
241 #define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
242 type prot {return name args;}
244 #ifndef RUBY_ALIAS_FUNCTION_VOID
245 #define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
246 void prot {name args;}
248 #ifndef RUBY_ALIAS_FUNCTION
249 #define RUBY_ALIAS_FUNCTION(prot, name, args) \
250 RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
253 #if defined __GNUC__ && __GNUC__ >= 4
254 #pragma GCC visibility pop
257 #if defined(__cplusplus)
void rb_sparc_flush_register_windows(void)