LibreOffice
LibreOffice 5.1 SDK C/C++ API Reference
config.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_SAL_CONFIG_H
21 #define INCLUDED_SAL_CONFIG_H
22 
23 #if defined LIBO_INTERNAL_ONLY
24 #include "config_global.h"
25 #endif
26 
27 #include <stdlib.h>
28 
29 #ifdef WIN32
30 #define SAL_W32
31 #define SAL_DLLEXTENSION ".dll"
32 #define SAL_PATHSEPARATOR ';'
33 #define SAL_PATHDELIMITER '\\'
34 #define SAL_NEWLINE_STRING "\r\n"
35 #define SAL_CONFIGFILE( name ) name ".ini"
36 
37 #ifdef _MSC_VER
38 
39 #ifndef _USE_MATH_DEFINES
40 #define _USE_MATH_DEFINES // needed by Visual C++ for math constants
41 #endif
42 
43 #endif /* defined _MSC_VER */
44 
45 /* Provide ISO C99 compatible versions of snprint and vsnprintf */
46 #ifdef __MINGW32__
47 #define _SNPRINTF_DLLIMPORT
48 #endif
49 #ifndef _SNPRINTF_H
50 #include <systools/win32/snprintf.h>
51 #endif
52 
53 #endif /* defined WIN32 */
54 
55 #if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || \
56  defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) || defined(ANDROID)
57 #define SAL_UNX
58 #define SAL_DLLEXTENSION ".so"
59 #define SAL_DLLPREFIX "lib"
60 #define SAL_PATHSEPARATOR ':'
61 #define SAL_PATHDELIMITER '/'
62 #define SAL_NEWLINE_STRING "\n"
63 #define SAL_CONFIGFILE( name ) name "rc"
64 #endif
65 
66 #ifdef EMSCRIPTEN
67 #define SAL_UNX
68 #define SAL_DLLEXTENSION ".bc"
69 #define SAL_DLLPREFIX "lib"
70 #define SAL_PATHSEPARATOR ':'
71 #define SAL_PATHDELIMITER '/'
72 #define SAL_NEWLINE_STRING "\n"
73 #define SAL_CONFIGFILE( name ) name "rc"
74 #endif
75 
76 #ifdef MACOSX
77 #define SAL_UNX
78 #define SAL_DLLEXTENSION ".dylib"
79 #define SAL_DLLPREFIX "lib"
80 #define SAL_PATHSEPARATOR ':'
81 #define SAL_PATHDELIMITER '/'
82 #define SAL_NEWLINE_STRING "\n"
83 #define SAL_CONFIGFILE( name ) name "rc"
84 #endif
85 
86 #ifdef IOS
87 #define SAL_UNX
88 /* SAL_DLLEXTENSION should not really be used on iOS, as iOS apps are
89  * not allowed to load own dynamic libraries.
90  */
91 #define SAL_DLLEXTENSION ".dylib"
92 #define SAL_DLLPREFIX "lib"
93 #define SAL_PATHSEPARATOR ':'
94 #define SAL_PATHDELIMITER '/'
95 #define SAL_NEWLINE_STRING "\n"
96 #define SAL_CONFIGFILE( name ) name "rc"
97 #endif
98 
99 /* The following spell is for Solaris and its descendants.
100  * See the "Solaris" section of
101  * <http://sourceforge.net/p/predef/wiki/OperatingSystems/>, and
102  * <http://stackoverflow.com/questions/16618604/solaris-and-preprocessor-macros>.
103  */
104 #ifdef sun
105 #undef sun
106 #define sun sun
107 #endif
108 
109 #if defined __clang__
110 #if __has_warning("-Wpotentially-evaluated-expression")
111 #pragma GCC diagnostic ignored "-Wpotentially-evaluated-expression"
112 #endif
113 #endif
114 
115 #endif // INCLUDED_SAL_CONFIG_H
116 
117 
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */