diff options
author | Olivia Mackintosh <livvy@base.nu> | 2020-04-21 18:33:32 +0100 |
---|---|---|
committer | Olivia Mackintosh <livvy@base.nu> | 2020-04-21 18:33:32 +0100 |
commit | ddd234ea1ff2924e587372aa12c4d5cda99a0ce0 (patch) | |
tree | f5c6f28a18b726d04fcbb351341df4fb05714385 /src/base.h | |
download | tiny-ddd234ea1ff2924e587372aa12c4d5cda99a0ce0.tar.gz |
Initial commit
Diffstat (limited to 'src/base.h')
-rw-r--r-- | src/base.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/base.h b/src/base.h new file mode 100644 index 0000000..44683c9 --- /dev/null +++ b/src/base.h @@ -0,0 +1,35 @@ +#ifndef SYNC_BASE_H +#define SYNC_BASE_H + +#ifdef _MSC_VER + #define _CRT_SECURE_NO_WARNINGS 1 + #define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif + +#include <stddef.h> + +/* configure inline keyword */ +#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)) && !defined(__cplusplus) + #if defined(_MSC_VER) || defined(__GNUC__) || defined(__SASC) + #define inline __inline + #else + /* compiler does not support inline */ + #define inline + #endif +#endif + +/* configure lacking CRT features */ +#ifdef _MSC_VER + #if _MSC_VER < 1900 + #define snprintf _snprintf + #endif + /* int is 32-bit for both x86 and x64 */ + typedef unsigned int uint32_t; + #define UINT32_MAX UINT_MAX +#elif defined(__GNUC__) + #include <stdint.h> +#elif defined(M68000) + typedef unsigned int uint32_t; +#endif + +#endif /* SYNC_BASE_H */ |