-
Notifications
You must be signed in to change notification settings - Fork 0
/
shiori_define.h
49 lines (48 loc) · 1.29 KB
/
shiori_define.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
44
45
46
47
48
49
#ifndef SHIORI_DEFINE_H__
#define SHIORI_DEFINE_H__
//-------------------------------------------------------------------------
#if defined(WIN32)||defined(_WIN32)||defined(_Windows)||defined(__CYGWIN__)
// Win32
# include <windows.h>
# if defined(__BORLANDC__)||defined(__clang__)
// Borland C++ / clang
# ifdef __cplusplus
# define SHIORI_EXPORT extern "C"
# else
# define SHIORI_EXPORT extern
# endif
# else
// Visual C++ / Cygwin32 / Mingw32
# ifdef __cplusplus
# define SHIORI_EXPORT extern "C" __declspec(dllexport)
# else
# define SHIORI_EXPORT extern __declspec(dllexport)
# endif
# endif
# define SHIORI_CALL __cdecl
# define MEMORY_HANDLE HGLOBAL
# ifdef __cplusplus
# define SHIORI_MALLOC(len) ::GlobalAlloc(GMEM_FIXED, len)
# define SHIORI_FREE(ptr) ::GlobalFree((HGLOBAL)ptr)
# else
# define SHIORI_MALLOC(len) GlobalAlloc(GMEM_FIXED, len)
# define SHIORI_FREE(ptr) GlobalFree((HGLOBAL)ptr)
# endif
#else
// Other Platform
# ifdef __cplusplus
# define SHIORI_EXPORT extern "C"
# else
# define SHIORI_EXPORT extern
# endif
# define SHIORI_CALL
# define MEMORY_HANDLE char *
# define SHIORI_MALLOC(len) malloc(len)
# define SHIORI_FREE(ptr) free((void *)ptr)
#endif
#ifndef BOOL
# define BOOL int
# define TRUE 1
# define FALSE 0
#endif
#endif // SHIORI_DEFINE_H__