xref: /aoo4110/main/sal/rtl/source/macro.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _RTL_MACRO_HXX
25 #define _RTL_MACRO_HXX
26 
27 #include <rtl/bootstrap.h>
28 #include <rtl/ustring.hxx>
29 #include <osl/endian.h>
30 
31 #if defined WIN32
32 #define THIS_OS "Windows"
33 #elif defined OS2
34 #define THIS_OS "OS2"
35 #elif defined SOLARIS
36 #define THIS_OS "Solaris"
37 #elif defined LINUX
38 #ifdef __FreeBSD_kernel__
39 #define THIS_OS "kFreeBSD"
40 #else
41 #define THIS_OS "Linux"
42 #endif
43 #elif defined MACOSX
44 #define THIS_OS "MacOSX"
45 #elif defined NETBSD
46 #define THIS_OS "NetBSD"
47 #elif defined FREEBSD
48 #define THIS_OS "FreeBSD"
49 #endif
50 
51 #if ! defined THIS_OS
52 #error "unknown OS -- insert your OS identifier above"
53 this is inserted for the case that the preprocessor ignores error
54 #endif
55 
56 #if defined X86_64
57 #    define THIS_ARCH "X86_64"
58 #elif defined INTEL
59 #    define THIS_ARCH "x86"
60 #elif defined POWERPC64
61 #    define THIS_ARCH "PowerPC_64"
62 #elif defined POWERPC
63 #    define THIS_ARCH "PowerPC"
64 #elif defined S390X
65 #    define THIS_ARCH "S390x"
66 #elif defined S390
67 #    define THIS_ARCH "S390"
68 #elif defined SPARC
69 #if defined IS_LP64
70 #    define THIS_ARCH "SPARC64"
71 #else
72 #    define THIS_ARCH "SPARC"
73 #endif
74 #elif defined MIPS
75 #    ifdef OSL_BIGENDIAN
76 #        define THIS_ARCH "MIPS_EB"
77 #    else
78 #        define THIS_ARCH "MIPS_EL"
79 #    endif
80 #elif defined ARM
81 #    ifdef __ARM_EABI__
82 #        define THIS_ARCH "ARM_EABI"
83 #    else
84 #        define THIS_ARCH "ARM_OABI"
85 #    endif
86 #elif defined IA64
87 #    define THIS_ARCH "IA64"
88 #elif defined M68K
89 #    define THIS_ARCH "M68K"
90 #elif defined HPPA
91 #    define THIS_ARCH "HPPA"
92 #elif defined AXP
93 #    define THIS_ARCH "ALPHA"
94 #endif
95 
96 #if ! defined THIS_ARCH
97 #error "unknown ARCH -- insert your ARCH identifier above"
98 this is inserted for the case that the preprocessor ignores error
99 #endif
100 
101 #endif
102 
103 
104 
105 
106 
107