• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 The Amber Authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SRC_PLATFORM_H_
16 #define SRC_PLATFORM_H_
17 
18 namespace amber {
19 
20 #if defined(_WIN32) || defined(_WIN64)
21 #define AMBER_PLATFORM_WINDOWS 1
22 #elif defined(__linux__)
23 #define AMBER_PLATFORM_LINUX 1
24 #define AMBER_PLATFORM_POSIX 1
25 #elif defined(__FreeBSD__)
26 #define AMBER_PLATFORM_FREEBSD 1
27 #define AMBER_PLATFORM_POSIX 1
28 #elif defined(__APPLE__)
29 #define AMBER_PLATFORM_APPLE 1
30 #define AMBER_PLATFORM_POSIX 1
31 #elif defined(__Fuchsia__)
32 #define AMBER_PLATFORM_POSIX 1
33 #else
34 #error "Unknown platform."
35 #endif
36 
37 #if !defined(AMBER_PLATFORM_WINDOWS)
38 #define AMBER_PLATFORM_WINDOWS 0
39 #endif
40 
41 #if !defined(AMBER_PLATFORM_LINUX)
42 #define AMBER_PLATFORM_LINUX 0
43 #endif
44 
45 #if !defined(AMBER_PLATFORM_FREEBSD)
46 #define AMBER_PLATFORM_FREEBSD 0
47 #endif
48 
49 #if !defined(AMBER_PLATFORM_APPLE)
50 #define AMBER_PLATFORM_APPLE 0
51 #endif
52 
53 #if !defined(AMBER_PLATFORM_POSIX)
54 #define AMBER_PLATFORM_POSIX 0
55 #endif
56 
57 }  // namespace amber
58 
59 #endif  // SRC_PLATFORM_H_
60