1
/************************************************
6
$Date: 2007-08-29 11:15:03 +0900 (水, 29 8月 2007) $
7
created at: Wed May 18 00:21:44 JST 1994
9
************************************************/
11
#ifndef RUBY_DEFINES_H
12
#define RUBY_DEFINES_H 1
14
#if defined(__cplusplus)
17
} /* satisfy cc-mode */
25
# ifndef HAVE_PROTOTYPES
26
# define HAVE_PROTOTYPES 1
28
# ifndef HAVE_STDARG_PROTOTYPES
29
# define HAVE_STDARG_PROTOTYPES 1
34
#ifdef HAVE_PROTOTYPES
41
#ifdef HAVE_STDARG_PROTOTYPES
42
# define __(args) args
53
#define xmalloc ruby_xmalloc
54
#define xmalloc2 ruby_xmalloc2
55
#define xcalloc ruby_xcalloc
56
#define xrealloc ruby_xrealloc
57
#define xrealloc2 ruby_xrealloc2
58
#define xfree ruby_xfree
60
void *xmalloc(size_t);
61
void *xmalloc2(size_t,size_t);
62
void *xcalloc(size_t,size_t);
63
void *xrealloc(void*,size_t);
64
void *xrealloc2(void*,size_t,size_t);
67
#if SIZEOF_LONG_LONG > 0
68
# define LONG_LONG long long
69
#elif SIZEOF___INT64 > 0
70
# define HAVE_LONG_LONG 1
71
# define LONG_LONG __int64
72
# undef SIZEOF_LONG_LONG
73
# define SIZEOF_LONG_LONG SIZEOF___INT64
76
#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
77
# define BDIGIT unsigned int
78
# define SIZEOF_BDIGITS SIZEOF_INT
79
# define BDIGIT_DBL unsigned LONG_LONG
80
# define BDIGIT_DBL_SIGNED LONG_LONG
81
#elif SIZEOF_INT*2 <= SIZEOF_LONG
82
# define BDIGIT unsigned int
83
# define SIZEOF_BDIGITS SIZEOF_INT
84
# define BDIGIT_DBL unsigned long
85
# define BDIGIT_DBL_SIGNED long
86
#elif SIZEOF_SHORT*2 <= SIZEOF_LONG
87
# define BDIGIT unsigned short
88
# define SIZEOF_BDIGITS SIZEOF_SHORT
89
# define BDIGIT_DBL unsigned long
90
# define BDIGIT_DBL_SIGNED long
92
# define BDIGIT unsigned short
93
# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
94
# define BDIGIT_DBL unsigned long
95
# define BDIGIT_DBL_SIGNED long
102
#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__)
105
# define DOSISH_DRIVE_LETTER
109
/* define RUBY_USE_EUC/SJIS for default kanji-code */
110
#ifndef DEFAULT_KCODE
111
#if defined(DOSISH) || defined(__CYGWIN__) || defined(__MACOS__) || defined(OS2)
112
#define DEFAULT_KCODE KCODE_SJIS
114
#define DEFAULT_KCODE KCODE_EUC
119
/* NextStep, OpenStep, Rhapsody */
121
#define S_IRUSR 0000400 /* read permission, owner */
124
#define S_IRGRP 0000040 /* read permission, group */
127
#define S_IROTH 0000004 /* read permission, other */
130
#define S_IWUSR 0000200 /* write permission, owner */
133
#define S_IWGRP 0000020 /* write permission, group */
136
#define S_IWOTH 0000002 /* write permission, other */
139
#define S_IXUSR 0000100 /* execute/search permission, owner */
142
#define S_IXGRP 0000010 /* execute/search permission, group */
145
#define S_IXOTH 0000001 /* execute/search permission, other */
148
#define S_IRWXU 0000700 /* read, write, execute permissions, owner */
151
#define S_IRWXG 0000070 /* read, write, execute permissions, group */
154
#define S_IRWXO 0000007 /* read, write, execute permissions, other */
157
#define S_ISBLK(mode) (((mode) & (0170000)) == (0060000))
160
#define S_ISCHR(mode) (((mode) & (0170000)) == (0020000))
163
#define S_ISDIR(mode) (((mode) & (0170000)) == (0040000))
166
#define S_ISFIFO(mode) (((mode) & (0170000)) == (0010000))
169
#define S_ISREG(mode) (((mode) & (0170000)) == (0100000))
171
/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
172
result in a different endian. Instead trust __BIG_ENDIAN__ and
173
__LITTLE_ENDIAN__ which are set correctly by -arch. */
174
#undef WORDS_BIGENDIAN
175
#ifdef __BIG_ENDIAN__
176
#define WORDS_BIGENDIAN
179
/* NextStep, OpenStep (but not Rhapsody) */
181
#define GETPGRP_VOID 1
192
#endif /* __APPLE__ */
196
#include "ruby/win32.h"
203
#if defined(__BEOS__)
204
#include <net/socket.h> /* intern.h needs fd_set definition */
212
#define RUBY_EXTERN extern
216
#define EXTERN RUBY_EXTERN /* deprecated */
219
#ifndef RUBY_MBCHAR_MAXSIZE
220
#define RUBY_MBCHAR_MAXSIZE INT_MAX
221
/* MB_CUR_MAX will not work well in C locale */
224
#if defined(sparc) || defined(__sparc__)
226
flush_register_windows(void)
232
# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
236
# endif /* trap always to flush register windows if we are on a Sparc system */
239
# define FLUSH_REGISTER_WINDOWS flush_register_windows()
240
#elif defined(__ia64)
241
void *rb_ia64_bsp(void);
242
void rb_ia64_flushrs(void);
243
# define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
245
# define FLUSH_REGISTER_WINDOWS ((void)0)
250
#elif defined(riscos)
255
#define PATH_SEP_CHAR PATH_SEP[0]
257
#if defined(__human68k__)
258
#define PATH_ENV "path"
260
#define PATH_ENV "PATH"
263
#if defined(DOSISH) && !defined(__human68k__) && !defined(__EMX__)
264
#define ENV_IGNORECASE
268
#define DLEXT_MAXLEN 4
271
#ifndef RUBY_PLATFORM
272
#define RUBY_PLATFORM "unknown-unknown"
275
#if defined(__cplusplus)
277
{ /* satisfy cc-mode */
282
#endif /* RUBY_DEFINES_H */