source: pacpusframework/trunk/include/Pacpus/predef/os.h@ 354

Last change on this file since 354 was 298, checked in by Marek Kurdej, 11 years ago

Added: operating system and compiler identification macros.

File size: 2.5 KB
Line 
1// %pacpus:license{
2// This file is part of the PACPUS framework distributed under the
3// CECILL-C License, Version 1.0.
4// %pacpus:license}
5/// @file
6/// @author Marek Kurdej <firstname.surname@utc.fr>
7/// @date 2014-04-07 10:36:35
8/// @version $Id$
9/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
10/// @brief Brief description.
11///
12/// Detailed description.
13
14#ifndef PACPUS_PREDEF_OS_H
15#define PACPUS_PREDEF_OS_H
16
17#include <Pacpus/predef/version_number.h>
18
19////////////////////////////////////////////////////////////////////////////////
20
21#define PACPUS_OS_WINDOWS PACPUS_VERSION_NUMBER_NOT_AVAILABLE
22
23#if defined(_WIN32) || defined(_WIN64) || \
24 defined(__WIN32__) || defined(__TOS_WIN__) || \
25 defined(__WINDOWS__)
26# undef PACPUS_OS_WINDOWS
27# define PACPUS_OS_WINDOWS PACPUS_VERSION_NUMBER_AVAILABLE
28#endif
29
30#if PACPUS_OS_WINDOWS
31# define PACPUS_OS_WINDOWS_AVAILABLE
32#endif
33
34#define PACPUS_OS_WINDOWS_NAME "Microsoft Windows"
35
36////////////////////////////////////////////////////////////////////////////////
37
38#define PACPUS_OS_UNIX PACPUS_VERSION_NUMBER_NOT_AVAILABLE
39
40#if defined(unix) || defined(__unix) || \
41 defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
42# undef PACPUS_OS_UNIX
43# define PACPUS_OS_UNIX PACPUS_VERSION_NUMBER_AVAILABLE
44#endif
45
46#if PACPUS_OS_UNIX
47# define PACPUS_OS_UNIX_AVAILABLE
48#endif
49
50#define PACPUS_OS_UNIX_NAME "Unix Environment"
51
52////////////////////////////////////////////////////////////////////////////////
53
54#define PACPUS_OS_LINUX PACPUS_VERSION_NUMBER_NOT_AVAILABLE
55
56#if defined(linux) || defined(__linux)
57# undef PACPUS_OS_LINUX
58# define PACPUS_OS_LINUX PACPUS_VERSION_NUMBER_AVAILABLE
59#endif
60
61#if PACPUS_OS_LINUX
62# define PACPUS_OS_LINUX_AVAILABLE
63#endif
64
65#define PACPUS_OS_LINUX_NAME "Linux"
66
67////////////////////////////////////////////////////////////////////////////////
68
69#define PACPUS_OS_MACOS PACPUS_VERSION_NUMBER_NOT_AVAILABLE
70
71#if defined(macintosh) || defined(Macintosh) || \
72 (defined(__APPLE__) && defined(__MACH__))
73# undef PACPUS_OS_MACOS
74# if !defined(PACPUS_OS_MACOS) && defined(__APPLE__) && defined(__MACH__)
75# define PACPUS_OS_MACOS PACPUS_VERSION_NUMBER(10,0,0)
76# endif
77# if !defined(PACPUS_OS_MACOS)
78# define PACPUS_OS_MACOS PACPUS_VERSION_NUMBER(9,0,0)
79# endif
80#endif
81
82#if PACPUS_OS_MACOS
83# define PACPUS_OS_MACOS_AVAILABLE
84#endif
85
86#define PACPUS_OS_MACOS_NAME "Mac OS"
87
88////////////////////////////////////////////////////////////////////////////////
89
90#endif // PACPUS_PREDEF_OS_H
Note: See TracBrowser for help on using the repository browser.