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