Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
6aaf3b92caa813da0bc77b3166e270b4cb715caf
[simgrid.git] / src / win32 / platform / select_platform_features.h
1 #ifndef __XBT_SELECT_PLATFORM_FEATURES_H__
2 #define __XBT_SELECT_PLATFORM_FEATURES_H__
3
4
5 /* select_platform_features.h - platform features selection    */
6
7 /* Copyright (c) 2006, 2010. The SimGrid Team.
8  * All rights reserved.                                                     */
9
10 /* This program is free software; you can redistribute it and/or modify it
11  * under the terms of the license (GNU LGPL) which comes with this package. */
12
13 /* Windows platforms. */
14
15
16 /* 
17  * win32 or win64 (__XBT_WIN32 is defined for win32 and win64 applications, __TOS_WIN__ is defined by xlC).
18 */
19
20 /* If the platform is not resolved _XBT_PLATFORM_ID is set to zero. */
21 #define _XBT_PLATFORM_ID     0
22
23
24 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
25 #undef _XBT_PLATFORM_ID
26 #define _XBT_WIN32_PLATFORM  1
27 #define _XBT_PLATFORM_ID   _XBT_WIN32_PLATFORM
28 #define _XBT_PLATFORM_NAME  "Windows 32 bits platform"
29 /* 
30  * win64.
31  */
32 #elif defined(_WIN64)
33 #undef _XBT_PLATFORM_ID
34 #ifdef _XBT_WIN32_PLATFORM
35 #undef _XBT_WIN32_PLATFORM
36 #endif
37
38 #define _XBT_PLATFORM_NAME  "Windows 64 bits platform"
39 #define _XBT_WIN64_PLATFORM   2
40 #define _XBT_PLATFORM_ID   _XBT_WIN64_PLATFORM
41 /* 
42  * win16.
43  */
44 #elif defined(_WIN16)
45 #undef _XBT_PLATFORM_ID
46 #define _XBT_WIN16_PLATFORM   3
47 #define _XBT_PLATFORM_NAME  "Windows 16 bits platform"
48 #define _XBT_PLATFORM_ID   _XBT_WIN16_PLATFORM
49 /*
50  * wince.
51  */
52 #elif defined(UNDER_CE)
53 #undef _XBT_PLATFORM_ID
54 #define __XBT_WINCE_PLATFORM   4
55 #define _XBT_PLATFORM_ID   _XBT_WINCE_PLATFORM
56 #define _XBT_PLATFORM_NAME  "Windows CE bits platform"
57
58 #elif defined(linux) || defined(__linux) || defined(__linux__)
59 /* linux. */
60 #undef _XBT_PLATFORM_ID
61 #define __XBT_LINUX_PLATFORM   5
62 #define _XBT_PLATFORM_ID   _XBT_LINUX_PLATFORM
63 #define _XBT_PLATFORM_NAME  "Linux platform"
64
65 #elif defined (_XBT_ASSERT_CONFIG)
66         // This must come last - generate an error if we don't
67         // resolve the platform:
68 #error "Unknown platform - please configure (simgrid.gforge.inria.fr/xbt/libs/config/config.htm#configuring) and report the results to the main simgrid mailing list (simgrid.gforge.inra.fr/more/mailing_lists.htm#main)"
69 #endif
70
71 #if defined(_XBT_WIN32_PLATFORM) || defined(_XBT_WIN64_PLATFORM) || defined(_XBT_WIN16_PLATFORM) || defined(_XBT_WINCE_PLATFORM)
72 #ifndef _XBT_WIN32
73 #define _XBT_WIN32
74 #endif
75 #endif
76
77
78 /* Returns true if the platform is resolved, false in the other case. */
79 #define _xbt_is_platform_resolved()  (_XBT_PLATFORM_ID != 0)
80
81 /* Returns the platform name. */
82 #define _xbt_get_platform_name()  _XBT_PLATFORM_NAME
83
84 /* Returns the platform id. */
85 #define _xbt_get_platform_id()    _XBT_PLATFORM_ID
86
87 /* Returns true if the platform is Windows 32 bits. */
88 #define _xbt_is_win32()      (_XBT_PLATFORM_ID == 1)
89
90 /* Returns true if the platform is Windows 64 bits. */
91 #define _xbt_is_win64()      (_XBT_PLATFORM_ID == 2)
92
93 /* Returns true if the platform is Windows 16 bits. */
94 #define _xbt_is_win16()      (_XBT_PLATFORM_ID == 3)
95
96 /* Returns true if the platform is Windows CE. */
97 #define _xbt_is_wince()      (_XBT_PLATFORM_ID == 4)
98
99 /* Returns true if the platform is linux. */
100 #define _xbt_is_linux()      (_XBT_PLATFORM_ID == 5)
101
102
103
104
105 #endif                          /* #define __XBT_SELECT_PLATFORM_FEATURES_H__ */