Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
406fcf3946cd842e79979b1344f782888269905f
[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) 2003, 2004 Cherier Malek. All rights reserved.            */
8
9 /* This program is free software; you can redistribute it and/or modify it
10  * under the terms of the license (GNU LGPL) which comes with this package. */
11
12 /* Windows platforms. */
13
14
15 /* 
16  * win32 or win64 (__WIN32 is defined for win32 and win64 applications, __TOS_WIN__ is defined by xlC). 
17 */ 
18
19 /* If the platform is not resolved _XBT_PLATFORM_ID is set to zero. */
20 #define _XBT_PLATFORM_ID                0
21
22
23 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
24         #undef _XBT_PLATFORM_ID
25         #define _XBT_WIN32_PLATFORM     1
26         #define _XBT_PLATFORM_ID        _XBT_WIN32_PLATFORM
27         #define _XBT_PLATFORM_NAME      "Windows 32 bits platform"
28 /* 
29  * win64.
30  */
31 #elif defined(_WIN64)
32         #undef _XBT_PLATFORM_ID
33         #ifdef _XBT_WIN32_PLATFORM 
34                 #undef _XBT_WIN32_PLATFORM 
35         #endif
36         
37         #define _XBT_PLATFORM_NAME      "Windows 64 bits platform"
38         #define _XBT_WIN64_PLATFORM     2
39         #define _XBT_PLATFORM_ID        _XBT_WIN64_PLATFORM
40 /* 
41  * win16.
42  */
43 #elif defined(_WIN16)
44         #undef _XBT_PLATFORM_ID
45         #define _XBT_WIN16_PLATFORM     3
46         #define _XBT_PLATFORM_NAME      "Windows 16 bits platform"
47         #define _XBT_PLATFORM_ID        _XBT_WIN16_PLATFORM
48 /*
49  * wince.
50  */
51 #elif defined(UNDER_CE)
52         #undef _XBT_PLATFORM_ID
53         #define __XBT_WINCE_PLATFORM    4
54         #define _XBT_PLATFORM_ID        _XBT_WINCE_PLATFORM
55         #define _XBT_PLATFORM_NAME      "Windows CE bits platform"
56
57 #elif defined(linux) || defined(__linux) || defined(__linux__)
58 /* linux. */
59         #undef _XBT_PLATFORM_ID
60         #define __XBT_LINUX_PLATFORM    5
61         #define _XBT_PLATFORM_ID        _XBT_LINUX_PLATFORM
62         #define _XBT_PLATFORM_NAME      "Linux platform"
63          
64 #elif defined (_XBT_ASSERT_CONFIG)
65         // This must come last - generate an error if we don't
66         // resolve the platform:
67         #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)"
68 #endif
69
70
71 /* Returns true if the platform is resolved, false in the other case. */
72 #define _xbt_is_platform_resolved()     (_XBT_PLATFORM_ID != 0)
73
74 /* Returns the platform name. */
75 #define _xbt_get_platform_name()        _XBT_PLATFORM_NAME
76
77 /* Returns the platform id. */
78 #define _xbt_get_platform_id()          _XBT_PLATFORM_ID        
79
80 /* Returns true if the platform is Windows 32 bits. */
81 #define _xbt_is_win32()                 (_XBT_PLATFORM_ID == 1)
82
83 /* Returns true if the platform is Windows 64 bits. */
84 #define _xbt_is_win64()                 (_XBT_PLATFORM_ID == 2)
85
86 /* Returns true if the platform is Windows 16 bits. */
87 #define _xbt_is_win16()                 (_XBT_PLATFORM_ID == 3)
88
89 /* Returns true if the platform is Windows CE. */
90 #define _xbt_is_wince()                 (_XBT_PLATFORM_ID == 4)
91
92 /* Returns true if the platform is linux. */
93 #define _xbt_is_linux()                 (_XBT_PLATFORM_ID == 5)
94
95
96
97
98 #endif /* #define __XBT_SELECT_PLATFORM_FEATURES_H__ */