source: git/src/whichos.h @ 559cd60

RELEASE/1.2debug-cidebug-ci-sanitiserswalls-data
Last change on this file since 559cd60 was 559cd60, checked in by Olly Betts <olly@…>, 5 years ago

Consistently refer to macOS not OS X, etc

Apple renamed it yet again.

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[affaeee]1/* whichos.h  Detect which OS we're compiling for.
2 * Copyright (C) 2005 Olly Betts
[846746e]3 *
[89231c4]4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
[846746e]8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
[89231c4]11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
[846746e]13 *
[89231c4]14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
[affaeee]16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
[d1b1380]17 */
18
[affaeee]19#ifndef SURVEX_WHICHOS_H
20#define SURVEX_WHICHOS_H
[d1b1380]21
[affaeee]22/* Attempt to auto-detect OS. */
23#if (defined(unix) || defined(UNIX))
24# define OS_UNIX 1
25#elif defined(__GNUC__) && defined(__APPLE_CC__)
[559cd60]26/* macOS is Unix for most purposes. */
[affaeee]27# define OS_UNIX 1
[559cd60]28# define OS_UNIX_MACOS 1
[affaeee]29#endif
[d1b1380]30
[affaeee]31#if !OS_UNIX
32# if defined WIN32 || defined _WIN32 || defined __WIN32 || defined __WIN32__
33#  define OS_WIN32 1
34# endif
35#endif
[d1b1380]36
[affaeee]37#ifndef OS_UNIX
38# define OS_UNIX 0
39#endif
40
[559cd60]41#ifndef OS_UNIX_MACOS
42# define OS_UNIX_MACOS 0
[affaeee]43#endif
[d1b1380]44
[affaeee]45#ifndef OS_WIN32
46# define OS_WIN32 0
47#endif
48
49/* Check that we detected an OS! */
50# if !(OS_UNIX+OS_WIN32)
51#  error Failed to detect which os to compile for
[d1b1380]52# endif
[affaeee]53
[d1b1380]54#endif
Note: See TracBrowser for help on using the repository browser.