29 #ifndef __LIBFREEWRL_SYSTEM_H__
30 #define __LIBFREEWRL_SYSTEM_H__
50 #if defined(_ANDROID) || defined(NO_JAVASCRIPT)
58 #define JAVASCRIPT_STUB 1
81 # define strrchr rindex
83 char *strchr (), *strrchr ();
85 # define memcpy(d, s, n) bcopy ((s), (d), (n))
86 # define memmove(d, s, n) bcopy ((s), (d), (n))
90 #if defined(_ANDROID) || defined(ANDROIDNDK)
95 # define __bool_true_false_are_defined 1
104 typedef unsigned char _Bool;
110 # define __bool_true_false_are_defined 1
114 #if defined(_ANDROID) || defined(ANDROIDNDK)
116 #define JS_FALSE false
128 # if HAVE_SYS_TYPES_H
129 # include <sys/types.h>
134 #if defined(HAVE_LIMITS_H)
138 #if defined(HAVE_STRING_H)
142 #if !defined(HAVE_STRNLEN)
143 #define strnlen __fw_strnlen
144 size_t __fw_strnlen(
const char *s,
size_t maxlen);
147 #if !defined(HAVE_STRNDUP)
148 # define strndup __fw_strndup
149 char *__fw_strndup(
const char *s,
size_t n);
153 #if defined(HAVE_SYS_WAIT_H)
154 # include <sys/wait.h>
157 # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
160 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
170 #define min(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __a : __b; })
174 #define max(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
179 #include <sys/stat.h>
183 # include <sys/time.h>
201 #if defined(_MSC_VER)
207 #define bzero(b,len) (memset((b), '\0', (len)), (void) 0)
208 #define bcopy(b1,b2,len) (memmove((b2), (b1), (len)), (void) 0)
211 #define PATH_MAX _MAX_PATH
220 # define strdup _strdup
225 # define unlink _unlink
230 # define access _access
233 # include <process.h>
234 # define getpid _getpid
238 # define tempnam _tempnam
241 # include <sys/types.h>
242 # include <sys/stat.h>
252 #define snprintf _snprintf
259 double Time1970sec(
void);