-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcore.h
43 lines (38 loc) · 1.02 KB
/
core.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
// Define PIXIE_NORMALISE_MAIN (either here or in your compiler command-line
// arguments) to allow Pixie to normalise the program entry point regardless
// of platform and console/GUI subsystem to:
//
// int main(int argc, char** argv)
//
//#define PIXIE_NORMALISE_MAIN
#ifdef _WIN32
#define PIXIE_PLATFORM_WIN 1
#elif __APPLE__
#define PIXIE_PLATFORM_OSX 1
#else
#error "Unsupported platform"
#endif
#if PIXIE_PLATFORM_OSX
#define strcat_s(dst, size, src) strlcat(dst, src, size)
#define sprintf_s(dst, size, fmt, ...) snprintf(dst, size, fmt, __VA_ARGS__)
#define strcpy_s(dst, size, src) snprintf(dst, size, "%s", src)
#endif
#define MAKE_RGB(r, g, b) ((b)|((g)<<8)|((r)<<16))
#if PIXIE_PLATFORM_WIN
#if !defined(__MINGW32__)
#define NOMINMAX
#endif
#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN
#include <Windows.h>
#else
#if defined(_UNICODE) || defined(UNICODE)
#define TEXT(x) L"\"" #x "\""
typedef wchar_t TCHAR;
#else
#define TEXT(x) #x
typedef char TCHAR;
#endif
#endif