coan  6.0.1
A C/C++ Configuration Analyzer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
platform.h
Go to the documentation of this file.
1 #ifndef PLATFORM_H
2 #define PLATFORM_H
3 #pragma once
4 /***************************************************************************
5  * Copyright (C) 2007-2013 Mike Kinghan, imk@burroingroingjoing.com *
6  * All rights reserved. *
7  * *
8  * Contributed originally by Mike Kinghan, imk@burroingroingjoing.com *
9  * *
10  * Redistribution and use in source and binary forms, with or without *
11  * modification, are permitted provided that the following conditions *
12  * are met: *
13  * *
14  * Redistributions of source code must retain the above copyright *
15  * notice, this list of conditions and the following disclaimer. *
16  * *
17  * Redistributions in binary form must reproduce the above copyright *
18  * notice, this list of conditions and the following disclaimer in the *
19  * documentation and/or other materials provided with the distribution. *
20  * *
21  * Neither the name of Mike Kinghan nor the names of its contributors *
22  * may be used to endorse or promote products derived from this software *
23  * without specific prior written permission. *
24  * *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
28  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
29  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
30  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
31  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
32  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED *
33  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,*
34  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF *
35  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
36  * DAMAGE. *
37  * *
38  **************************************************************************/
39 
40 #include "configure.h"
41 
46 #if defined(_WIN32) || defined(_WIN64)
47  #define PATH_DELIM '\\'
49  #define FS_ROOT_PREFIX ""
51 
52  #ifdef _WIN64
53  #define OS_TYPE "64 bit Windows"
55  #else
56  #define OS_TYPE "32 bit Windows"
58  #endif
59 
61  #define WINDOWS
62 
63  #include <stdlib.h>
64 
65  #ifndef PATH_MAX
66  #define PATH_MAX _MAX_PATH
68  #endif
69 
70  #ifdef __GNUC__
71  #define GNUWIN
73  #endif
74 
75 #else
76 
77  // Character that delimits elements of a filesystem path for Unix/Linux.
78  #define PATH_DELIM '/'
79  #define FS_ROOT_PREFIX "/"
81 
82  #ifdef __LP64__
83  #define OS_TYPE "64 bit Unix/Linux"
85  #else
86  #define OS_TYPE "32 bit Unix/Linux"
88  #endif
89 
91  #define NIX
92 
93 #endif /* ! _WIN32 || _WIN64*/
94 
95 #ifdef _MSC_VER
96  #if _MSC_VER < 1600
97  #error Sorry, you need MS C++ >= 1600 (i.e. Visual C++ 2010) \
98  or later to build coan
99  #else
100  // Disable VC++ warning for ignored exception specifications
101  #pragma warning(disable : 4290)
102  // Disable VC++ warning for converting BOOL to bool
103  #pragma warning(disable : 4800)
104  // Disable VC++ warning unary minus applied to unsigned type.
105  #pragma warning(disable : 4146)
106  #endif
107 #endif
108 
109 #ifdef __clang__
110  #if (__clang_major__ < 3) || (__clang_major__ == 3 && \
111  __clang_minor__ < 1)
112  #error Sorry, you need clang 3.1 or later to build coan
113  #endif
114 #endif
115 
116 #if defined(__GNUC__) && !defined(__clang__)
117  #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
118  #error Sorry, you need GCC 4.3 or later to build coan
119  #endif // (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
120 #endif // __GNUC__ && !__clang__
121 
122 #endif // EOF