clapper: Properly export external API symbols

This commit is contained in:
Rafał Dzięgiel
2024-06-14 23:23:15 +02:00
parent df371c698a
commit 50d4fbe43b
18 changed files with 241 additions and 2 deletions

View File

@@ -0,0 +1,45 @@
/* Clapper API Visibility
* Copyright (C) 2024 Rafał Dzięgiel <rafostar.github@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#pragma once
#if !defined(__@CLAPPER_API@_INSIDE__) && !defined(@CLAPPER_API@_COMPILATION)
#error "This header file can not be included directly."
#endif
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(@CLAPPER_API@_STATIC_COMPILATION)
#define _@CLAPPER_API@_EXPORT __declspec(dllexport) extern
#define _@CLAPPER_API@_IMPORT __declspec(dllimport) extern
#elif __GNUC__ >= 4
#define _@CLAPPER_API@_EXPORT __attribute__((visibility("default"))) extern
#define _@CLAPPER_API@_IMPORT extern
#else
#define _@CLAPPER_API@_EXPORT extern
#define _@CLAPPER_API@_IMPORT extern
#endif
#if defined(@CLAPPER_API@_COMPILATION)
#define _@CLAPPER_API@_VISIBILITY _@CLAPPER_API@_EXPORT
#else
#define _@CLAPPER_API@_VISIBILITY _@CLAPPER_API@_IMPORT
#endif
#define @CLAPPER_API@_API _@CLAPPER_API@_VISIBILITY
#define @CLAPPER_API@_DEPRECATED G_DEPRECATED _@CLAPPER_API@_VISIBILITY
#define @CLAPPER_API@_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _@CLAPPER_API@_VISIBILITY