You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

windowsIncludes.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef LEPTON_WINDOW_INCLUDE_H_
  2. #define LEPTON_WINDOW_INCLUDE_H_
  3. /*
  4. * Shared libraries are messy in Visual Studio. We have to distinguish three
  5. * cases:
  6. * (1) this header is being used to build the Lepton shared library
  7. * (dllexport)
  8. * (2) this header is being used by a *client* of the Lepton shared
  9. * library (dllimport)
  10. * (3) we are building the Lepton static library, or the client is
  11. * being compiled with the expectation of linking with the
  12. * Lepton static library (nothing special needed)
  13. * In the CMake script for building this library, we define one of the symbols
  14. * Lepton_BUILDING_{SHARED|STATIC}_LIBRARY
  15. * Client code normally has no special symbol defined, in which case we'll
  16. * assume it wants to use the shared library. However, if the client defines
  17. * the symbol LEPTON_USE_STATIC_LIBRARIES we'll suppress the dllimport so
  18. * that the client code can be linked with static libraries. Note that
  19. * the client symbol is not library dependent, while the library symbols
  20. * affect only the Lepton library, meaning that other libraries can
  21. * be clients of this one. However, we are assuming all-static or all-shared.
  22. */
  23. #ifdef _MSC_VER
  24. // We don't want to hear about how sprintf is "unsafe".
  25. #pragma warning(disable:4996)
  26. #if defined(LEPTON_BUILDING_SHARED_LIBRARY)
  27. #define LEPTON_EXPORT __declspec(dllexport)
  28. // Keep MS VC++ quiet about lack of dll export of private members.
  29. #pragma warning(disable:4251)
  30. #elif defined(LEPTON_BUILDING_STATIC_LIBRARY) || defined(LEPTON_USE_STATIC_LIBRARIES)
  31. #define LEPTON_EXPORT __declspec(dllimport) // i.e., a client of a shared library
  32. #else
  33. #define LEPTON_EXPORT
  34. #endif
  35. #else
  36. #define LEPTON_EXPORT // Linux, Mac
  37. #endif
  38. #endif // LEPTON_WINDOW_INCLUDE_H_