/* Shared library support */
#ifndef UL_EXPORT
  #if defined(_WIN32)&&defined(_MSC_VER)
    #define UL_IMPORT __declspec(dllimport)
    #define UL_EXPORT __declspec(dllexport)
    #define UL_DLLLOCAL
    #define UL_DLLPUBLIC
  #else
    #define UL_IMPORT
    #ifdef GCC_HASCLASSVISIBILITY
      #define UL_EXPORT __attribute__ ((visibility("default")))
      #define UL_DLLLOCAL __attribute__ ((visibility("hidden")))
      #define UL_DLLPUBLIC __attribute__ ((visibility("default")))
    #else
      #define UL_EXPORT
      #define UL_DLLLOCAL
      #define UL_DLLPUBLIC
    #endif
  #endif
#endif /* UL_EXPORT */

/* Define UL_UTAPI for DLL builds */
#ifdef UL_UTDLL
  #ifdef UL_UTDLL_EXPORTS
    #define UL_UTAPI UL_EXPORT
  #else
    #define UL_UTAPI  UL_IMPORT
  #endif /* UL_UTDLL_EXPORTS */
#else
  #define UL_API
#endif /* UL_UTDLL */

/* Throwable classes must always be visible on GCC in all binaries */
#if defined(_WIN32)&&defined(_MSC_VER)
  #define UL_EXCEPTIONAPI(api) api
#elif defined(GCC_HASCLASSVISIBILITY)
  #define UL_EXCEPTIONAPI(api) UL_EXPORT
#else
  #define UL_EXCEPTIONAPI(api)
#endif

/* Other possible solution is to use pragmas */
/*
 * #pragma GCC visibility push(hidden)
 * extern void someprivatefunct(int);
 * #pragma GCC visibility pop
 */

/* GCC switches to handle visibility */
/*
 * -fvisibilty=hidden
 * -fvisibility-inlines-hidden
 */