LibreOffice: sal/config.h Source File

LibreOffice LibreOffice 25.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
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/*
21 * This file is part of LibreOffice published API.
22 */
23
24#ifndef INCLUDED_SAL_CONFIG_H
25#define INCLUDED_SAL_CONFIG_H
26
27#if defined LIBO_INTERNAL_ONLY && defined ANDROID && defined __cplusplus
28#include <android/compatibility.hxx>
29#endif
30
31#ifdef _WIN32
32#define SAL_W32
33#define SAL_DLLEXTENSION ".dll"
34#define SAL_EXEEXTENSION ".exe"
35#define SAL_PATHSEPARATOR ';'
36#define SAL_PATHDELIMITER '\\'
37#define SAL_NEWLINE_STRING "\r\n"
38#define SAL_CONFIGFILE(name) name ".ini"
39
40#ifdef _MSC_VER
41
42#ifndef _USE_MATH_DEFINES
43#define _USE_MATH_DEFINES // needed by Visual C++ for math constants
44#endif
45
46#endif /* defined _MSC_VER */
47
48#endif /* defined _WIN32 */
49
50#if defined(__sun) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) \
51 || defined(DRAGONFLY) || defined(ANDROID) || defined(HAIKU)
52#define SAL_UNX
53#define SAL_DLLEXTENSION ".so"
54#define SAL_EXEEXTENSION ""
55#define SAL_DLLPREFIX "lib"
56#define SAL_PATHSEPARATOR ':'
57#define SAL_PATHDELIMITER '/'
58#define SAL_NEWLINE_STRING "\n"
59#define SAL_CONFIGFILE(name) name "rc"
60#endif
61
62#ifdef MACOSX
63#define SAL_UNX
64#define SAL_DLLEXTENSION ".dylib"
65#define SAL_EXEEXTENSION ""
66#define SAL_DLLPREFIX "lib"
67#define SAL_PATHSEPARATOR ':'
68#define SAL_PATHDELIMITER '/'
69#define SAL_NEWLINE_STRING "\n"
70#define SAL_CONFIGFILE(name) name "rc"
71#endif
72
73#ifdef IOS
74#define SAL_UNX
75/* SAL_DLLEXTENSION should not really be used on iOS, as iOS apps are
76 * not allowed to load own dynamic libraries.
77 */
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 EMSCRIPTEN
87#define SAL_UNX
88#define SAL_DLLEXTENSION ".bc"
89#define SAL_EXEEXTENSION ""
90#define SAL_DLLPREFIX "lib"
91#define SAL_PATHSEPARATOR ':'
92#define SAL_PATHDELIMITER '/'
93#define SAL_NEWLINE_STRING "\n"
94#define SAL_CONFIGFILE(name) name "rc"
95#endif
96
97/* The following spell is for Solaris and its descendants.
98 * See the "Solaris" section of
99 * <http://sourceforge.net/p/predef/wiki/OperatingSystems/>, and
100 * <http://stackoverflow.com/questions/16618604/solaris-and-preprocessor-macros>.
101 */
102#ifdef sun
103#undef sun
104#define sun sun
105#endif
106
107#if defined __clang__
108#if __has_warning("-Wpotentially-evaluated-expression")
109#pragma GCC diagnostic ignored "-Wpotentially-evaluated-expression"
110#endif
111// Before fixing occurrences of this warning, let's see whether C++20 will still change to obsolete
112// the warning (see
113// <https://github.com/llvm/llvm-project/commit/974c8b7e2fde550fd87850d50695341101c38c2d> "[c++20]
114// Add rewriting from comparison operators to <=> / =="):
115#if __has_warning("-Wambiguous-reversed-operator")
116#pragma GCC diagnostic ignored "-Wambiguous-reversed-operator"
117#endif
118#endif
119
120#endif // INCLUDED_SAL_CONFIG_H
121
122/* vim:set shiftwidth=4 softtabstop=4 expandtab: */