1 /****************************************************************************** 2 Copyright (c) 2007-2011, Intel Corp. 3 All rights reserved. 4 5 Redistribution and use in source and binary forms, with or without 6 modification, are permitted provided that the following conditions are met: 7 8 * Redistributions of source code must retain the above copyright notice, 9 this list of conditions and the following disclaimer. 10 * Redistributions in binary form must reproduce the above copyright 11 notice, this list of conditions and the following disclaimer in the 12 documentation and/or other materials provided with the distribution. 13 * Neither the name of Intel Corporation nor the names of its contributors 14 may be used to endorse or promote products derived from this software 15 without specific prior written permission. 16 17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 THE POSSIBILITY OF SUCH DAMAGE. 28 ******************************************************************************/ 29 30 #ifndef OP_SYSTEM_H 31 #define OP_SYSTEM_H 32 33 34 #if (defined(dos) || defined(DOS)) 35 36 # undef dos 37 # undef vms 38 # undef wnt 39 # undef osf 40 # undef hp_ux 41 # undef linux 42 # undef unicos 43 # undef ultrix 44 # undef win64 45 # undef darwin 46 # undef interix 47 48 # define dos 1 49 # define OP_SYSTEM dos 50 51 52 #elif (defined(vms) || defined(VMS)) 53 54 # undef dos 55 # undef vms 56 # undef wnt 57 # undef osf 58 # undef hp_ux 59 # undef linux 60 # undef unicos 61 # undef ultrix 62 # undef win64 63 # undef darwin 64 # undef interix 65 66 # define vms 2 67 # define OP_SYSTEM vms 68 69 70 #elif ( defined(wnt) || defined(WNT) || defined(winnt)) 71 72 # undef dos 73 # undef vms 74 # undef wnt 75 # undef osf 76 # undef hp_ux 77 # undef linux 78 # undef unicos 79 # undef ultrix 80 # undef win64 81 # undef darwin 82 # undef interix 83 84 # define wnt 3 85 # define OP_SYSTEM wnt 86 87 88 #elif (defined(linux) || defined(LINUX) || defined(__linux)) 89 90 # undef dos 91 # undef vms 92 # undef wnt 93 # undef osf 94 # undef hp_ux 95 # undef linux 96 # undef unicos 97 # undef ultrix 98 # undef win64 99 # undef darwin 100 # undef interix 101 102 # define linux 8 103 # define OP_SYSTEM linux 104 105 106 #elif (defined(osf) || defined(OSF) || defined(__osf__)) 107 108 109 # undef dos 110 # undef vms 111 # undef wnt 112 # undef osf 113 # undef hp_ux 114 # undef linux 115 # undef unicos 116 # undef ultrix 117 # undef win64 118 # undef darwin 119 # undef interix 120 121 # define osf 4 122 # define OP_SYSTEM osf 123 124 125 #elif (defined(hp_ux) || defined(HP_UX) || defined(__hpux) || defined(__HPUX)) 126 127 # undef dos 128 # undef vms 129 # undef wnt 130 # undef osf 131 # undef hp_ux 132 # undef linux 133 # undef unicos 134 # undef ultrix 135 # undef win64 136 # undef darwin 137 # undef interix 138 139 # define hp_ux 5 140 # define OP_SYSTEM hp_ux 141 142 143 #elif (defined(unicos) || defined(UNICOS)) 144 145 # undef dos 146 # undef vms 147 # undef wnt 148 # undef osf 149 # undef hp_ux 150 # undef linux 151 # undef unicos 152 # undef ultrix 153 # undef win64 154 # undef darwin 155 # undef interix 156 157 # define unicos 6 158 # define OP_SYSTEM unicos 159 160 161 #elif (defined(ultrix) || defined(ULTRIX)) 162 163 # undef dos 164 # undef vms 165 # undef wnt 166 # undef osf 167 # undef hp_ux 168 # undef linux 169 # undef unicos 170 # undef ultrix 171 # undef win64 172 # undef darwin 173 # undef interix 174 175 # define ultrix 7 176 # define OP_SYSTEM ultrix 177 178 179 #elif (defined(win64) || defined(WIN64)) 180 # undef dos 181 # undef vms 182 # undef wnt 183 # undef osf 184 # undef hp_ux 185 # undef linux 186 # undef unicos 187 # undef ultrix 188 # undef win64 189 # undef darwin 190 # undef interix 191 192 # define win64 9 193 # define OP_SYSTEM win64 194 195 196 #elif defined(__APPLE__) || defined(darwin) 197 # undef dos 198 # undef vms 199 # undef wnt 200 # undef osf 201 # undef hp_ux 202 # undef linux 203 # undef unicos 204 # undef ultrix 205 # undef win64 206 # undef darwin 207 # undef interix 208 209 # define darwin 10 210 # define OP_SYSTEM darwin 211 212 #elif defined(interix) 213 # undef dos 214 # undef vms 215 # undef wnt 216 # undef osf 217 # undef hp_ux 218 # undef linux 219 # undef unicos 220 # undef ultrix 221 # undef win64 222 # undef darwin 223 # undef interix 224 225 # define interix 11 226 # define OP_SYSTEM interix 227 #else 228 229 # error Operating system must be specified. 230 231 #endif 232 233 #define IS_UNIX ( \ 234 OP_SYSTEM == hp_ux || \ 235 OP_SYSTEM == linux || \ 236 OP_SYSTEM == osf || \ 237 OP_SYSTEM == ultrix || \ 238 OP_SYSTEM == unicos \ 239 ) 240 241 #endif /* OP_SYSTEM_H */ 242 243