0001-fix-dll-export.patch 865 B

1234567891011121314151617181920212223242526
  1. diff --git a/src/webp/types.h b/src/webp/types.h
  2. index 0ce2622..69f7e89 100644
  3. --- a/src/webp/types.h
  4. +++ b/src/webp/types.h
  5. @@ -39,7 +39,9 @@ typedef long long int int64_t;
  6. #ifndef WEBP_EXTERN
  7. // This explicitly marks library functions and allows for changing the
  8. // signature for e.g., Windows DLL builds.
  9. -# if defined(__GNUC__) && __GNUC__ >= 4
  10. +# if defined(_MSC_VER) && defined(WEBP_DLL)
  11. +# define WEBP_EXTERN __declspec(dllexport)
  12. +# elif defined(__GNUC__) && __GNUC__ >= 4
  13. # define WEBP_EXTERN extern __attribute__ ((visibility ("default")))
  14. # else
  15. # define WEBP_EXTERN extern
  16. diff --git a/CMakeLists.txt b/CMakeLists.txt
  17. index 2501012..2e090e6 100644
  18. --- a/CMakeLists.txt
  19. +++ b/CMakeLists.txt
  20. @@ -16,2 +16,6 @@ project(WebP C)
  21. +if(MSVC AND BUILD_SHARED_LIBS)
  22. + add_definitions(-DWEBP_DLL)
  23. +endif()
  24. +
  25. # Options for coder / decoder executables.