|
1 | 1 | #ifndef DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 |
2 | 2 | #define DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 |
3 | 3 |
|
4 | | -#if defined(_MSC_VER) || \ |
5 | | - (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ |
6 | | - (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 |
7 | | -#pragma once |
| 4 | +// Definition YAML_CPP_STATIC_DEFINE using to building YAML-CPP as static |
| 5 | +// library (definition created by CMake or defined manually) |
| 6 | + |
| 7 | +// Definition yaml_cpp_EXPORTS using to building YAML-CPP as dll/so library |
| 8 | +// (definition created by CMake or defined manually) |
| 9 | + |
| 10 | +#ifdef YAML_CPP_STATIC_DEFINE |
| 11 | +# define YAML_CPP_API |
| 12 | +# define YAML_CPP_NO_EXPORT |
| 13 | +#else |
| 14 | +# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) |
| 15 | +# ifndef YAML_CPP_API |
| 16 | +# ifdef yaml_cpp_EXPORTS |
| 17 | + /* We are building this library */ |
| 18 | +# pragma message( "Defining YAML_CPP_API for DLL export" ) |
| 19 | +# define YAML_CPP_API __declspec(dllexport) |
| 20 | +# else |
| 21 | + /* We are using this library */ |
| 22 | +# pragma message( "Defining YAML_CPP_API for DLL import" ) |
| 23 | +# define YAML_CPP_API __declspec(dllimport) |
| 24 | +# endif |
| 25 | +# endif |
| 26 | +# ifndef YAML_CPP_NO_EXPORT |
| 27 | +# define YAML_CPP_NO_EXPORT |
| 28 | +# endif |
| 29 | +# else /* No _MSC_VER */ |
| 30 | +# ifndef YAML_CPP_API |
| 31 | +# ifdef yaml_cpp_EXPORTS |
| 32 | + /* We are building this library */ |
| 33 | +# define YAML_CPP_API __attribute__((visibility("default"))) |
| 34 | +# else |
| 35 | + /* We are using this library */ |
| 36 | +# define YAML_CPP_API __attribute__((visibility("default"))) |
| 37 | +# endif |
| 38 | +# endif |
| 39 | +# ifndef YAML_CPP_NO_EXPORT |
| 40 | +# define YAML_CPP_NO_EXPORT __attribute__((visibility("hidden"))) |
| 41 | +# endif |
| 42 | +# endif /* _MSC_VER */ |
| 43 | +#endif /* YAML_CPP_STATIC_DEFINE */ |
| 44 | + |
| 45 | +#ifndef YAML_CPP_DEPRECATED |
| 46 | +# ifdef _MSC_VER |
| 47 | +# define YAML_CPP_DEPRECATED __declspec(deprecated) |
| 48 | +# else |
| 49 | +# define YAML_CPP_DEPRECATED __attribute__ ((__deprecated__)) |
| 50 | +# endif |
8 | 51 | #endif |
9 | 52 |
|
10 | | -// The following ifdef block is the standard way of creating macros which make |
11 | | -// exporting from a DLL simpler. All files within this DLL are compiled with the |
12 | | -// yaml_cpp_EXPORTS symbol defined on the command line. This symbol should not |
13 | | -// be defined on any project that uses this DLL. This way any other project |
14 | | -// whose source files include this file see YAML_CPP_API functions as being |
15 | | -// imported from a DLL, whereas this DLL sees symbols defined with this macro as |
16 | | -// being exported. |
17 | | -#undef YAML_CPP_API |
| 53 | +#ifndef YAML_CPP_DEPRECATED_EXPORT |
| 54 | +# define YAML_CPP_DEPRECATED_EXPORT YAML_CPP_API YAML_CPP_DEPRECATED |
| 55 | +#endif |
18 | 56 |
|
19 | | -#ifdef YAML_CPP_DLL // Using or Building YAML-CPP DLL (definition defined |
20 | | - // manually) |
21 | | -#ifdef yaml_cpp_EXPORTS // Building YAML-CPP DLL (definition created by CMake |
22 | | - // or defined manually) |
23 | | -// #pragma message( "Defining YAML_CPP_API for DLL export" ) |
24 | | -#define YAML_CPP_API __declspec(dllexport) |
25 | | -#else // yaml_cpp_EXPORTS |
26 | | -// #pragma message( "Defining YAML_CPP_API for DLL import" ) |
27 | | -#define YAML_CPP_API __declspec(dllimport) |
28 | | -#endif // yaml_cpp_EXPORTS |
29 | | -#else // YAML_CPP_DLL |
30 | | -#define YAML_CPP_API |
31 | | -#endif // YAML_CPP_DLL |
| 57 | +#ifndef YAML_CPP_DEPRECATED_NO_EXPORT |
| 58 | +# define YAML_CPP_DEPRECATED_NO_EXPORT YAML_CPP_NO_EXPORT YAML_CPP_DEPRECATED |
| 59 | +#endif |
32 | 60 |
|
33 | | -#endif // DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 |
| 61 | +#endif /* DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 */ |
0 commit comments