File: foundation_system.h

package info (click to toggle)
haskell-basement 0.0.16-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,048 kB
  • sloc: haskell: 11,336; ansic: 63; makefile: 5
file content (60 lines) | stat: -rw-r--r-- 1,667 bytes parent folder | download | duplicates (8)
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
52
53
54
55
56
57
58
59
60
#ifndef FOUNDATION_SYSTEM_H
# define FOUNDATION_SYSTEM_H

#ifdef _WIN32
   #define FOUNDATION_SYSTEM_WINDOWS
   #define FOUNDATION_SYSTEM_API_NO_CLOCK

   //define something for Windows (32-bit and 64-bit, this part is common)
   #ifdef _WIN64
      #define FOUNDATION_SYSTEM_WINDOWS_64
      //define something for Windows (64-bit only)
   #else
      #define FOUNDATION_SYSTEM_WINDOWS_32
      //define something for Windows (32-bit only)
   #endif
#elif __APPLE__
    #include "TargetConditionals.h"
    #include "Availability.h"

    #if TARGET_OS_MAC
      #define FOUNDATION_SYSTEM_UNIX
      #define FOUNDATION_SYSTEM_MACOS

      #if !defined(__MAC_10_12) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_12
      #define FOUNDATION_SYSTEM_API_NO_CLOCK
      #endif
      // Other kinds of Mac OS
    #else
    #   error "foundation: system: Unknown Apple platform"
    #endif
#elif __linux__
    #define FOUNDATION_SYSTEM_UNIX
    #define FOUNDATION_SYSTEM_LINUX
    // linux
#elif defined(__FreeBSD__)
    #define FOUNDATION_SYSTEM_UNIX
    #define FOUNDATION_SYSTEM_BSD
    #define FOUNDATION_SYSTEM_FREEBSD
    // freeBSD
#elif defined(__NetBSD__)
    #define FOUNDATION_SYSTEM_UNIX
    #define FOUNDATION_SYSTEM_BSD
    #define FOUNDATION_SYSTEM_NETBSD
    // NetBSD
#elif defined(__OpenBSD__)
    #define FOUNDATION_SYSTEM_UNIX
    #define FOUNDATION_SYSTEM_BSD
    #define FOUNDATION_SYSTEM_OPENBSD
    // OpenBSD
#elif __unix__ // all unices not caught above
    #define FOUNDATION_SYSTEM_UNIX
    // Unix
#elif defined(_POSIX_VERSION)
    #define FOUNDATION_SYSTEM_UNIX
    // POSIX
#else
#   error "foundation: system: Unknown compiler"
#endif

#endif