Ring Daemon 16.0.0
Loading...
Searching...
No Matches
def.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19// Generic helper definitions for shared library support
20#if defined _WIN32 || defined __CYGWIN__
21#define LIBJAMI_IMPORT __declspec(dllimport)
22#define LIBJAMI_EXPORT __declspec(dllexport)
23#define LIBJAMI_HIDDEN
24#else
25#define LIBJAMI_IMPORT __attribute__((visibility("default")))
26#define LIBJAMI_EXPORT __attribute__((visibility("default")))
27#define LIBJAMI_HIDDEN __attribute__((visibility("hidden")))
28#endif
29
30// Now we use the generic helper definitions above to define LIBJAMI_PUBLIC and LIBJAMI_LOCAL.
31// LIBJAMI_PUBLIC is used for the public API symbols. It is either DLL imports or DLL exports (or does
32// nothing for static build) LIBJAMI_LOCAL is used for non-api symbols.
33
34#ifdef jami_EXPORTS // defined if Jami is compiled as a shared library
35#ifdef LIBJAMI_BUILD // defined if we are building the Jami shared library (instead of using it)
36#define LIBJAMI_PUBLIC LIBJAMI_EXPORT
37#else
38#define LIBJAMI_PUBLIC LIBJAMI_IMPORT
39#endif // LIBJAMI_BUILD
40#define LIBJAMI_LOCAL LIBJAMI_HIDDEN
41#else // jami_EXPORTS is not defined: this means Jami is a static lib.
42#define LIBJAMI_PUBLIC
43#define LIBJAMI_LOCAL
44#endif // jami_EXPORTS
45
46#ifdef LIBJAMI_TEST
47#define LIBJAMI_TEST_EXPORT LIBJAMI_EXPORT
48#else
49#define LIBJAMI_TEST_EXPORT
50#endif