• 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(__APPLE__)
26 #define AMBER_PLATFORM_APPLE 1
27 #define AMBER_PLATFORM_POSIX 1
28 #else
29 #error "Unknown platform."
30 #endif
31 
32 #if !defined(AMBER_PLATFORM_WINDOWS)
33 #define AMBER_PLATFORM_WINDOWS 0
34 #endif
35 
36 #if !defined(AMBER_PLATFORM_LINUX)
37 #define AMBER_PLATFORM_LINUX 0
38 #endif
39 
40 #if !defined(AMBER_PLATFORM_APPLE)
41 #define AMBER_PLATFORM_APPLE 0
42 #endif
43 
44 #if !defined(AMBER_PLATFORM_POSIX)
45 #define AMBER_PLATFORM_POSIX 0
46 #endif
47 
48 }  // namespace amber
49 
50 #endif  // SRC_PLATFORM_H_
51