LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_EXEEXTENSION ".exe"
33 #define SAL_PATHSEPARATOR ';'
34 #define SAL_PATHDELIMITER '\\'
35 #define SAL_NEWLINE_STRING "\r\n"
36 #define SAL_CONFIGFILE( name ) name ".ini"
37 
38 #ifdef _MSC_VER
39 
40 #ifndef _USE_MATH_DEFINES
41 #define _USE_MATH_DEFINES // needed by Visual C++ for math constants
42 #endif
43 
44 #endif /* defined _MSC_VER */
45 
46 /* Provide ISO C99 compatible versions of snprint and vsnprintf */
47 #ifdef __MINGW32__
48 #define LO_SNPRINTF_DLLIMPORT
49 #endif
50 #ifndef _SNPRINTF_H
51 #include <systools/win32/snprintf.h>
52 #endif
53 
54 #endif /* defined WIN32 */
55 
56 #if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || \
57  defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) || defined(ANDROID)
58 #define SAL_UNX
59 #define SAL_DLLEXTENSION ".so"
60 #define SAL_EXEEXTENSION ""
61 #define SAL_DLLPREFIX "lib"
62 #define SAL_PATHSEPARATOR ':'
63 #define SAL_PATHDELIMITER '/'
64 #define SAL_NEWLINE_STRING "\n"
65 #define SAL_CONFIGFILE( name ) name "rc"
66 #endif
67 
68 #ifdef EMSCRIPTEN
69 #define SAL_UNX
70 #define SAL_DLLEXTENSION ".bc"
71 #define SAL_EXEEXTENSION ""
72 #define SAL_DLLPREFIX "lib"
73 #define SAL_PATHSEPARATOR ':'
74 #define SAL_PATHDELIMITER '/'
75 #define SAL_NEWLINE_STRING "\n"
76 #define SAL_CONFIGFILE( name ) name "rc"
77 #endif
78 
79 #ifdef MACOSX
80 #define SAL_UNX
81 #define SAL_DLLEXTENSION ".dylib"
82 #define SAL_EXEEXTENSION ""
83 #define SAL_DLLPREFIX "lib"
84 #define SAL_PATHSEPARATOR ':'
85 #define SAL_PATHDELIMITER '/'
86 #define SAL_NEWLINE_STRING "\n"
87 #define SAL_CONFIGFILE( name ) name "rc"
88 #endif
89 
90 #ifdef IOS
91 #define SAL_UNX
92 /* SAL_DLLEXTENSION should not really be used on iOS, as iOS apps are
93  * not allowed to load own dynamic libraries.
94  */
95 #define SAL_DLLEXTENSION ".dylib"
96 #define SAL_DLLPREFIX "lib"
97 #define SAL_PATHSEPARATOR ':'
98 #define SAL_PATHDELIMITER '/'
99 #define SAL_NEWLINE_STRING "\n"
100 #define SAL_CONFIGFILE( name ) name "rc"
101 #endif
102 
103 /* The following spell is for Solaris and its descendants.
104  * See the "Solaris" section of
105  * <http://sourceforge.net/p/predef/wiki/OperatingSystems/>, and
106  * <http://stackoverflow.com/questions/16618604/solaris-and-preprocessor-macros>.
107  */
108 #ifdef sun
109 #undef sun
110 #define sun sun
111 #endif
112 
113 #if defined __clang__
114 #if __has_warning("-Wpotentially-evaluated-expression")
115 #pragma GCC diagnostic ignored "-Wpotentially-evaluated-expression"
116 #endif
117 #endif
118 
119 #endif // INCLUDED_SAL_CONFIG_H
120 
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */