xref: /aoo42x/main/sal/rtl/source/macro.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _RTL_MACRO_HXX
29 #define _RTL_MACRO_HXX
30 
31 #include <rtl/bootstrap.h>
32 #include <rtl/ustring.hxx>
33 #include <osl/endian.h>
34 
35 #if defined WIN32
36 #define THIS_OS "Windows"
37 #elif defined OS2
38 #define THIS_OS "OS2"
39 #elif defined SOLARIS
40 #define THIS_OS "Solaris"
41 #elif defined LINUX
42 #ifdef __FreeBSD_kernel__
43 #define THIS_OS "kFreeBSD"
44 #else
45 #define THIS_OS "Linux"
46 #endif
47 #elif defined MACOSX
48 #define THIS_OS "MacOSX"
49 #elif defined NETBSD
50 #define THIS_OS "NetBSD"
51 #elif defined FREEBSD
52 #define THIS_OS "FreeBSD"
53 #endif
54 
55 #if ! defined THIS_OS
56 #error "unknown OS -- insert your OS identifier above"
57 this is inserted for the case that the preprocessor ignores error
58 #endif
59 
60 #if defined X86_64
61 #    define THIS_ARCH "X86_64"
62 #elif defined INTEL
63 #    define THIS_ARCH "x86"
64 #elif defined POWERPC64
65 #    define THIS_ARCH "PowerPC_64"
66 #elif defined POWERPC
67 #    define THIS_ARCH "PowerPC"
68 #elif defined S390X
69 #    define THIS_ARCH "S390x"
70 #elif defined S390
71 #    define THIS_ARCH "S390"
72 #elif defined SPARC
73 #if defined IS_LP64
74 #    define THIS_ARCH "SPARC64"
75 #else
76 #    define THIS_ARCH "SPARC"
77 #endif
78 #elif defined MIPS
79 #    ifdef OSL_BIGENDIAN
80 #        define THIS_ARCH "MIPS_EB"
81 #    else
82 #        define THIS_ARCH "MIPS_EL"
83 #    endif
84 #elif defined ARM
85 #    ifdef __ARM_EABI__
86 #        define THIS_ARCH "ARM_EABI"
87 #    else
88 #        define THIS_ARCH "ARM_OABI"
89 #    endif
90 #elif defined IA64
91 #    define THIS_ARCH "IA64"
92 #elif defined M68K
93 #    define THIS_ARCH "M68K"
94 #elif defined HPPA
95 #    define THIS_ARCH "HPPA"
96 #elif defined AXP
97 #    define THIS_ARCH "ALPHA"
98 #endif
99 
100 #if ! defined THIS_ARCH
101 #error "unknown ARCH -- insert your ARCH identifier above"
102 this is inserted for the case that the preprocessor ignores error
103 #endif
104 
105 #endif
106 
107 
108 
109 
110 
111