-
Notifications
You must be signed in to change notification settings - Fork 0
/
platform.h
51 lines (47 loc) · 1.34 KB
/
platform.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
50
51
/** @file platform.h
* @brief Platform-specific data
* @author ByteBard
* @copyright MIT
*
* The macro definitions seen in this document represent the platform data of Unix.
*/
#ifndef CLIBS_PLATFORM_H
#define CLIBS_PLATFORM_H
/** @def END_OF_LINE
* @brief End of line of specific host.
*
* C will handle platform-specific end of line automatically. Hence, we always set
* END_OF_LINE the same value.
*/
#ifndef END_OF_LINE
#define END_OF_LINE "\n"
#endif /* END_OF_LINE */
/** @def DIRECTORY_SEPARATOR
* @brief Directory separator of specific host.
*
* Currently, DIRECTORY_SEPARATOR works on Windows and Unix.
*/
#ifndef DIRECTORY_SEPARATOR
#ifdef _WIN32
#define DIRECTORY_SEPARATOR "\\"
#elif __unix__ || __unix || unix || __APPLE__
#define DIRECTORY_SEPARATOR "/"
#else
#error "Unsupported platform"
#endif
#endif /* DIRECTORY_SEPARATOR */
/** @def SEARCH_PATH_SEPARATOR
* @brief Search path separator of specific host.
*
* Currently, SEARCH_PATH_SEPARATOR works on Windows and Unix.
*/
#ifndef SEARCH_PATH_SEPARATOR
#ifdef _WIN32
#define SEARCH_PATH_SEPARATOR ";"
#elif __unix__ || __unix || unix || __APPLE__
#define SEARCH_PATH_SEPARATOR ":"
#else
#error "Unsupported platform"
#endif
#endif
#endif /* CLIBS_PLATFORM_H */