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