1// 2// Copyright (C) 2007 Stefan Seefeld 3// All rights reserved. 4// Licensed to the public under the terms of the GNU LGPL (>= 2), 5// see the file COPYING for details. 6// 7 8#ifndef Synopsis_config_hh_ 9#define Synopsis_config_hh_ 10 11// The following code is an adaptation from suggestions made 12// at http://gcc.gnu.org/wiki/Visibility 13 14// Shared library support 15#ifdef WIN32 16 #define SYN_IMPORT __declspec(dllimport) 17 #define SYN_EXPORT __declspec(dllexport) 18 #define SYN_DSO_LOCAL 19 #define SYN_DSO_PUBLIC 20#else 21 #define SYN_IMPORT 22 #ifdef GCC_HASCLASSVISIBILITY 23 #define SYN_IMPORT __attribute__ ((visibility("default"))) 24 #define SYN_EXPORT __attribute__ ((visibility("default"))) 25 #define SYN_DSO_LOCAL __attribute__ ((visibility("hidden"))) 26 #define SYN_DSO_PUBLIC __attribute__ ((visibility("default"))) 27 #else 28 #define SYN_IMPORT 29 #define SYN_EXPORT 30 #define SYN_DSO_LOCAL 31 #define SYN_DSO_PUBLIC 32 #endif 33#endif 34 35// Define SYNOPSIS_API for DSO builds 36#ifdef SYNOPSIS_DSO 37 #ifdef SYNOPSIS_DSO_EXPORTS 38 #define SYNOPSIS_API SYN_EXPORT 39 #else 40 #define SYNOPSIS_API SYN_IMPORT 41 #endif // SYNOPSIS_DSO_EXPORTS 42#else 43 #define SYNOPSIS_API 44#endif // SYNOPSIS_DSO 45 46#endif