defines.h


DEFINITIONS

This source file includes following functions.
  1. _
  2. _
  3. __
  4. __


   1  /************************************************
   2  
   3    defines.h -
   4  
   5    $Author: matz $
   6    $Date: 2002/04/10 08:45:22 $
   7    created at: Wed May 18 00:21:44 JST 1994
   8  
   9  ************************************************/
  10  #ifndef DEFINES_H
  11  #define DEFINES_H
  12  
  13  #define RUBY
  14  
  15  #if !defined(__STDC__) && !defined(_MSC_VER)
  16  # define volatile
  17  #endif
  18  
  19  #ifdef __cplusplus
  20  # ifndef  HAVE_PROTOTYPES
  21  #  define HAVE_PROTOTYPES 1
  22  # endif
  23  # ifndef  HAVE_STDARG_PROTOTYPES
  24  #  define HAVE_STDARG_PROTOTYPES 1
  25  # endif
  26  #endif
  27  
  28  #undef _
  29  #ifdef HAVE_PROTOTYPES
  30  # define _(args) args
  31  #else
  32  # define _(args) ()
  33  #endif
  34  
  35  #undef __
  36  #ifdef HAVE_STDARG_PROTOTYPES
  37  # define __(args) args
  38  #else
  39  # define __(args) ()
  40  #endif
  41  
  42  #ifdef __cplusplus
  43  #define ANYARGS ...
  44  #else
  45  #define ANYARGS
  46  #endif
  47  
  48  #define xmalloc ruby_xmalloc
  49  #define xcalloc ruby_xcalloc
  50  #define xrealloc ruby_xrealloc
  51  #define xfree ruby_xfree
  52  
  53  void *xmalloc _((long));
  54  void *xcalloc _((long,long));
  55  void *xrealloc _((void*,long));
  56  void xfree _((void*));
  57  
  58  #if SIZEOF_LONG_LONG > 0
  59  # define LONG_LONG long long
  60  #elif SIZEOF___INT64 > 0
  61  # define HAVE_LONG_LONG 1
  62  # define LONG_LONG __int64
  63  # undef SIZEOF_LONG_LONG
  64  # define SIZEOF_LONG_LONG SIZEOF___INT64
  65  #endif
  66  
  67  #if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
  68  # define BDIGIT unsigned int
  69  # define SIZEOF_BDIGITS SIZEOF_INT
  70  # define BDIGIT_DBL unsigned LONG_LONG
  71  # define BDIGIT_DBL_SIGNED LONG_LONG
  72  #elif SIZEOF_INT*2 <= SIZEOF_LONG
  73  # define BDIGIT unsigned int
  74  # define SIZEOF_BDIGITS SIZEOF_INT
  75  # define BDIGIT_DBL unsigned long
  76  # define BDIGIT_DBL_SIGNED long
  77  #else
  78  # define BDIGIT unsigned short
  79  # define SIZEOF_BDIGITS SIZEOF_SHORT
  80  # define BDIGIT_DBL unsigned long
  81  # define BDIGIT_DBL_SIGNED long
  82  #endif
  83  
  84  /* define RUBY_USE_EUC/SJIS for default kanji-code */
  85  #ifndef DEFAULT_KCODE
  86  #if defined(MSDOS) || defined(__CYGWIN__) || defined(__human68k__) || defined(__MACOS__) || defined(__EMX__) || defined(OS2) || defined(NT)
  87  #define DEFAULT_KCODE KCODE_SJIS
  88  #else
  89  #define DEFAULT_KCODE KCODE_EUC
  90  #endif
  91  #endif
  92  
  93  #ifdef NeXT
  94  #define DYNAMIC_ENDIAN          /* determine endian at runtime */
  95  #ifndef __APPLE__
  96  #define S_IXUSR _S_IXUSR        /* execute/search permission, owner */
  97  #endif
  98  #define S_IXGRP 0000010         /* execute/search permission, group */
  99  #define S_IXOTH 0000001         /* execute/search permission, other */
 100  
 101  #define HAVE_SYS_WAIT_H         /* configure fails to find this */
 102  #endif /* NeXT */
 103  
 104  #ifdef NT
 105  #include "win32/win32.h"
 106  #endif
 107  
 108  #if defined(__VMS)
 109  #include "vms/vms.h"
 110  #endif
 111  
 112  #if defined __CYGWIN__
 113  # undef EXTERN
 114  # if defined USEIMPORTLIB
 115  #  define EXTERN extern __declspec(dllimport)
 116  # else
 117  #  define EXTERN extern __declspec(dllexport)
 118  # endif
 119  #endif
 120  
 121  #ifndef EXTERN
 122  #define EXTERN extern
 123  #endif
 124  
 125  #if defined(sparc) || defined(__sparc__)
 126  # if defined(linux) || defined(__linux__)
 127  #define FLUSH_REGISTER_WINDOWS  asm("ta  0x83")
 128  # else /* Solaris, not sparc linux */
 129  #define FLUSH_REGISTER_WINDOWS  asm("ta  0x03")
 130  # endif /* trap always to flush register windows if we are on a Sparc system */
 131  #else /* Not a sparc, so */
 132  #define FLUSH_REGISTER_WINDOWS  /* empty -- nothing to do here */
 133  #endif 
 134  
 135  #if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__)
 136  #define DOSISH 1
 137  #endif
 138  
 139  #if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(OS2)
 140  #define PATH_SEP ";"
 141  #elif defined(riscos)
 142  #define PATH_SEP ","
 143  #else
 144  #define PATH_SEP ":"
 145  #endif
 146  #define PATH_SEP_CHAR PATH_SEP[0]
 147  
 148  #if defined(__human68k__)
 149  #undef HAVE_RANDOM
 150  #undef HAVE_SETITIMER
 151  #endif
 152  
 153  #if defined(DJGPP) || defined(__BOW__)
 154  #undef HAVE_SETITIMER
 155  #endif
 156  
 157  #ifndef RUBY_PLATFORM
 158  #define RUBY_PLATFORM "unknown-unknown"
 159  #endif
 160  
 161  #endif