Skip to content

Commit

Permalink
Merge pull request #3915 from randombit/jack/no-build-h-for-ffi-h
Browse files Browse the repository at this point in the history
Avoid including build.h into ffi.h
  • Loading branch information
randombit committed Mar 26, 2024
2 parents 85dbf6e + 25692f3 commit f95d888
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/lib/ffi/ffi.h
Expand Up @@ -56,14 +56,28 @@ API follows a few simple rules:
- TLS
*/

#include <botan/build.h>
#include <stddef.h>
#include <stdint.h>

/**
* Notes the version that this FFI function was first added
* BOTAN_FFI_EXPORT indicates public FFI functions.
*
* The arguments to the macro are to indicate the version that
* that particular FFI function was first available
*/
#define BOTAN_FFI_EXPORT(maj, min) BOTAN_DLL
#if defined(BOTAN_DLL)
#define BOTAN_FFI_EXPORT(maj, min) BOTAN_DLL
#else
#if defined(__has_attribute)
#if __has_attribute(visibility)
#define BOTAN_FFI_EXPORT(maj, min) __attribute__((visibility("default")))
#endif
#elif defined(_MSC_VER) && !defined(BOTAN_IS_BEING_BUILT)
#define BOTAN_FFI_EXPORT(maj, min) __declspec(dllimport)
#else
#define BOTAN_FFI_EXPORT(maj, min)
#endif
#endif

#if !defined(BOTAN_NO_DEPRECATED_WARNINGS)
#if defined(__has_attribute)
Expand Down

0 comments on commit f95d888

Please sign in to comment.