Ruby 1.9.3p327(2012-11-10revision37606)
include/ruby/missing.h
Go to the documentation of this file.
00001 /************************************************
00002 
00003   missing.h - prototype for *.c in ./missing, and
00004               for missing timeval struct
00005 
00006   $Author: naruse $
00007   created at: Sat May 11 23:46:03 JST 2002
00008 
00009 ************************************************/
00010 
00011 #ifndef RUBY_MISSING_H
00012 #define RUBY_MISSING_H 1
00013 
00014 #if defined(__cplusplus)
00015 extern "C" {
00016 #if 0
00017 } /* satisfy cc-mode */
00018 #endif
00019 #endif
00020 
00021 #include "ruby/config.h"
00022 #include <stddef.h>
00023 #ifdef RUBY_EXTCONF_H
00024 #include RUBY_EXTCONF_H
00025 #endif
00026 
00027 #if defined(HAVE_SYS_TIME_H)
00028 #  include <sys/time.h>
00029 #elif !defined(_WIN32)
00030 #  define time_t long
00031 struct timeval {
00032     time_t tv_sec;      /* seconds */
00033     long tv_usec;       /* microseconds */
00034 };
00035 #endif
00036 #if defined(HAVE_SYS_TYPES_H)
00037 #  include <sys/types.h>
00038 #endif
00039 
00040 #if !defined(HAVE_STRUCT_TIMESPEC)
00041 struct timespec {
00042     time_t tv_sec;      /* seconds */
00043     long tv_nsec;       /* nanoseconds */
00044 };
00045 #endif
00046 
00047 #if !defined(HAVE_STRUCT_TIMEZONE)
00048 struct timezone {
00049     int tz_minuteswest;
00050     int tz_dsttime;
00051 };
00052 #endif
00053 
00054 #if defined(HAVE___SYSCALL) && defined(__APPLE__)
00055 /* Mac OS X has __syscall but doen't defined in headers */
00056 off_t __syscall(quad_t number, ...);
00057 #endif
00058 
00059 #ifdef RUBY_EXPORT
00060 #undef RUBY_EXTERN
00061 #endif
00062 #ifndef RUBY_EXTERN
00063 #define RUBY_EXTERN extern
00064 #endif
00065 
00066 #if defined __GNUC__ && __GNUC__ >= 4
00067 #pragma GCC visibility push(default)
00068 #endif
00069 
00070 #ifndef HAVE_ACOSH
00071 RUBY_EXTERN double acosh(double);
00072 RUBY_EXTERN double asinh(double);
00073 RUBY_EXTERN double atanh(double);
00074 #endif
00075 
00076 #ifndef HAVE_CRYPT
00077 RUBY_EXTERN char *crypt(const char *, const char *);
00078 #endif
00079 
00080 #ifndef HAVE_DUP2
00081 RUBY_EXTERN int dup2(int, int);
00082 #endif
00083 
00084 #ifndef HAVE_EACCESS
00085 RUBY_EXTERN int eaccess(const char*, int);
00086 #endif
00087 
00088 #ifndef HAVE_ROUND
00089 RUBY_EXTERN double round(double);       /* numeric.c */
00090 #endif
00091 
00092 #ifndef HAVE_FINITE
00093 RUBY_EXTERN int finite(double);
00094 #endif
00095 
00096 #ifndef HAVE_FLOCK
00097 RUBY_EXTERN int flock(int, int);
00098 #endif
00099 
00100 /*
00101 #ifndef HAVE_FREXP
00102 RUBY_EXTERN double frexp(double, int *);
00103 #endif
00104 */
00105 
00106 #ifndef HAVE_HYPOT
00107 RUBY_EXTERN double hypot(double, double);
00108 #endif
00109 
00110 #ifndef HAVE_ERF
00111 RUBY_EXTERN double erf(double);
00112 RUBY_EXTERN double erfc(double);
00113 #endif
00114 
00115 #ifndef HAVE_TGAMMA
00116 RUBY_EXTERN double tgamma(double);
00117 #endif
00118 
00119 #ifndef HAVE_LGAMMA_R
00120 RUBY_EXTERN double lgamma_r(double, int *);
00121 #endif
00122 
00123 #ifndef HAVE_CBRT
00124 RUBY_EXTERN double cbrt(double);
00125 #endif
00126 
00127 #ifdef INFINITY
00128 # define HAVE_INFINITY
00129 #else
00130 
00131 RUBY_EXTERN const unsigned char rb_infinity[];
00132 # define INFINITY (*(float *)rb_infinity)
00133 #endif
00134 
00135 #ifdef NAN
00136 # define HAVE_NAN
00137 #else
00138 
00139 RUBY_EXTERN const unsigned char rb_nan[];
00140 # define NAN (*(float *)rb_nan)
00141 #endif
00142 
00143 #ifndef isinf
00144 # ifndef HAVE_ISINF
00145 #  if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
00146 #    ifdef HAVE_IEEEFP_H
00147 #    include <ieeefp.h>
00148 #    endif
00149 #  define isinf(x) (!finite(x) && !isnan(x))
00150 #  else
00151 RUBY_EXTERN int isinf(double);
00152 #  endif
00153 # endif
00154 #endif
00155 
00156 #ifndef isnan
00157 # ifndef HAVE_ISNAN
00158 RUBY_EXTERN int isnan(double);
00159 # endif
00160 #endif
00161 
00162 /*
00163 #ifndef HAVE_MEMCMP
00164 RUBY_EXTERN int memcmp(const void *, const void *, size_t);
00165 #endif
00166 */
00167 
00168 #ifndef HAVE_MEMMOVE
00169 RUBY_EXTERN void *memmove(void *, const void *, size_t);
00170 #endif
00171 
00172 /*
00173 #ifndef HAVE_MODF
00174 RUBY_EXTERN double modf(double, double *);
00175 #endif
00176 */
00177 
00178 #ifndef HAVE_STRCHR
00179 RUBY_EXTERN char *strchr(const char *, int);
00180 RUBY_EXTERN char *strrchr(const char *, int);
00181 #endif
00182 
00183 #ifndef HAVE_STRERROR
00184 RUBY_EXTERN char *strerror(int);
00185 #endif
00186 
00187 #ifndef HAVE_STRSTR
00188 RUBY_EXTERN char *strstr(const char *, const char *);
00189 #endif
00190 
00191 /*
00192 #ifndef HAVE_STRTOL
00193 RUBY_EXTERN long strtol(const char *, char **, int);
00194 #endif
00195 */
00196 
00197 #ifndef HAVE_STRLCPY
00198 RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
00199 #endif
00200 
00201 #ifndef HAVE_STRLCAT
00202 RUBY_EXTERN size_t strlcat(char *, const char*, size_t);
00203 #endif
00204 
00205 #ifndef HAVE_SIGNBIT
00206 RUBY_EXTERN int signbit(double x);
00207 #endif
00208 
00209 #ifndef HAVE_FFS
00210 RUBY_EXTERN int ffs(int);
00211 #endif
00212 
00213 #ifdef BROKEN_CLOSE
00214 #include <sys/types.h>
00215 #include <sys/socket.h>
00216 RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *);
00217 RUBY_EXTERN int ruby_getsockname(int, struct sockaddr *, socklen_t *);
00218 RUBY_EXTERN int ruby_shutdown(int, int);
00219 RUBY_EXTERN int ruby_close(int);
00220 #endif
00221 
00222 #ifndef HAVE_SETPROCTITLE
00223 RUBY_EXTERN void setproctitle(const char *fmt, ...);
00224 #endif
00225 
00226 #if defined __GNUC__ && __GNUC__ >= 4
00227 #pragma GCC visibility pop
00228 #endif
00229 
00230 #if defined(__cplusplus)
00231 #if 0
00232 { /* satisfy cc-mode */
00233 #endif
00234 }  /* extern "C" { */
00235 #endif
00236 
00237 #endif /* RUBY_MISSING_H */
00238