49 lines
1.6 KiB
C++
49 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include "compiler.hpp"
|
|
#include "operatingSystem.hpp"
|
|
|
|
#ifdef DIAGRAM_DESIGNER_PLATFORM_WINDOWS
|
|
#define DIAGRAM_DESIGNER_EXPORT __declspec(dllexport)
|
|
#define DIAGRAM_DESIGNER_IMPORT __declspec(dllimport)
|
|
#define DIAGRAM_DESIGNER_LOCAL
|
|
#elif DIAGRAM_DESIGNER_COMPILER_GNU_VERSION_MAJOR >= 4 || defined(DIAGRAM_DESIGNER_COMPILER_CLANG)
|
|
#define DIAGRAM_DESIGNER_EXPORT __attribute__((visibility("default")))
|
|
#define DIAGRAM_DESIGNER_IMPORT __attribute__((visibility("default")))
|
|
#define DIAGRAM_DESIGNER_LOCAL __attribute__((visibility("hidden")))
|
|
#else
|
|
#define DIAGRAM_DESIGNER_EXPORT
|
|
#define DIAGRAM_DESIGNER_IMPORT
|
|
#define DIAGRAM_DESIGNER_LOCAL
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
#define DIAGRAM_DESIGNER_DEMANGLED extern "C"
|
|
#else
|
|
#define DIAGRAM_DESIGNER_DEMANGLED
|
|
#endif
|
|
|
|
#if defined(DIAGRAM_DESIGNER_SHARED) && !defined(DIAGRAM_DESIGNER_STATIC)
|
|
#ifdef DIAGRAM_DESIGNER_EXPORTS
|
|
#define DIAGRAM_DESIGNER_PUBLIC DIAGRAM_DESIGNER_EXPORT
|
|
#else
|
|
#define DIAGRAM_DESIGNER_PUBLIC DIAGRAM_DESIGNER_IMPORT
|
|
#endif
|
|
#define DIAGRAM_DESIGNER_PRIVATE DIAGRAM_DESIGNER_LOCAL
|
|
#elif !defined(DIAGRAM_DESIGNER_SHARED) && defined(DIAGRAM_DESIGNER_STATIC)
|
|
#define DIAGRAM_DESIGNER_PUBLIC
|
|
#define DIAGRAM_DESIGNER_PRIVATE
|
|
#elif defined(DIAGRAM_DESIGNER_SHARED) && defined(DIAGRAM_DESIGNER_STATIC)
|
|
#ifdef DIAGRAM_DESIGNER_EXPORTS
|
|
#error "Cannot build as shared and static simultaneously."
|
|
#else
|
|
#error "Cannot link against shared and static simultaneously."
|
|
#endif
|
|
#else
|
|
#ifdef DIAGRAM_DESIGNER_EXPORTS
|
|
#error "Choose whether to build as shared or static."
|
|
#else
|
|
#error "Choose whether to link against shared or static."
|
|
#endif
|
|
#endif
|