2012-03-28 14:26:38 -07:00
|
|
|
#ifndef RUST_GLOBALS_H
|
|
|
|
#define RUST_GLOBALS_H
|
2010-07-19 14:05:18 -07:00
|
|
|
|
2012-03-28 14:26:38 -07:00
|
|
|
#ifndef __STDC_LIMIT_MACROS
|
2010-07-19 14:05:18 -07:00
|
|
|
#define __STDC_LIMIT_MACROS 1
|
2012-03-28 14:26:38 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __STDC_CONSTANT_MACROS
|
2010-07-19 14:05:18 -07:00
|
|
|
#define __STDC_CONSTANT_MACROS 1
|
2012-03-28 14:26:38 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __STDC_FORMAT_MACROS
|
2010-07-19 14:05:18 -07:00
|
|
|
#define __STDC_FORMAT_MACROS 1
|
2011-05-31 17:44:54 -07:00
|
|
|
#endif
|
2010-07-19 14:05:18 -07:00
|
|
|
|
2012-03-28 14:26:38 -07:00
|
|
|
#define ERROR 0
|
|
|
|
|
2010-07-19 14:05:18 -07:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <inttypes.h>
|
2012-03-28 14:26:38 -07:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
2010-07-19 14:05:18 -07:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2012-03-28 14:26:38 -07:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include "rust.h"
|
|
|
|
#include "rand.h"
|
|
|
|
#include "uthash.h"
|
|
|
|
#include "rust_env.h"
|
2010-07-19 14:05:18 -07:00
|
|
|
|
|
|
|
#if defined(__WIN32__)
|
|
|
|
extern "C" {
|
|
|
|
#include <windows.h>
|
|
|
|
#include <tchar.h>
|
|
|
|
#include <wincrypt.h>
|
|
|
|
}
|
|
|
|
#elif defined(__GNUC__)
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <dlfcn.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <errno.h>
|
2012-03-28 14:26:38 -07:00
|
|
|
#include <dirent.h>
|
|
|
|
|
|
|
|
#define GCC_VERSION (__GNUC__ * 10000 \
|
|
|
|
+ __GNUC_MINOR__ * 100 \
|
|
|
|
+ __GNUC_PATCHLEVEL__)
|
|
|
|
|
2010-07-19 14:05:18 -07:00
|
|
|
#else
|
|
|
|
#error "Platform not supported."
|
|
|
|
#endif
|
|
|
|
|
2011-05-31 17:44:54 -07:00
|
|
|
#define CHECKED(call) \
|
|
|
|
{ \
|
|
|
|
int res = (call); \
|
|
|
|
if(0 != res) { \
|
|
|
|
fprintf(stderr, \
|
|
|
|
#call " failed in %s at line %d, result = %d " \
|
|
|
|
"(%s) \n", \
|
|
|
|
__FILE__, __LINE__, res, strerror(res)); \
|
|
|
|
abort(); \
|
|
|
|
} \
|
2011-07-13 15:44:09 -07:00
|
|
|
}
|
2011-05-31 17:44:54 -07:00
|
|
|
|
2012-03-28 14:26:38 -07:00
|
|
|
#endif /* RUST_GLOBALS_H */
|