Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ if(SEAL_BUILD_SEAL_C)
seal_set_version(sealc)
if(SEAL_BUILD_STATIC_SEAL_C)
seal_set_version_filename(sealc)
add_compile_definitions(SEAL_BUILD_STATIC_SEAL_C)
else()
seal_set_soversion(sealc)
endif()
Expand Down
11 changes: 9 additions & 2 deletions native/src/seal/c/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ static_assert(sizeof(std::size_t) == 8, "Require sizeof(std::size_t) == 8");
static_assert(false, "Require architecture == x64");
#endif

#ifdef SEAL_BUILD_STATIC_SEAL_C
#define SEAL_C_DECOR extern "C"
#else // SEAL_BUILD_STATIC_SEAL_C
#if defined(SEAL_C_EXPORTS) || defined(seal_c_EXPORTS) || defined(sealc_EXPORTS)
#define SEAL_C_DECOR extern "C" __declspec(dllexport)
#else
#define SEAL_C_DECOR extern "C" __declspec(dllimport)
#endif
#endif // SEAL_BUILD_STATIC_SEAL_C

#define SEAL_C_CALL __cdecl

Expand All @@ -40,8 +44,6 @@ static_assert(false, "Require architecture == x64");
#define E_INVALIDARG _HRESULT_TYPEDEF_(0x80070057L)
#define E_OUTOFMEMORY _HRESULT_TYPEDEF_(0x8007000EL)
#define E_UNEXPECTED _HRESULT_TYPEDEF_(0x8000FFFFL)
#define COR_E_IO _HRESULT_TYPEDEF_(0x80131620L)
#define COR_E_INVALIDOPERATION _HRESULT_TYPEDEF_(0x80131509L)

#define S_OK _HRESULT_TYPEDEF_(0L)
#define S_FALSE _HRESULT_TYPEDEF_(1L)
Expand All @@ -59,4 +61,9 @@ static_assert(false, "Require architecture == x64");

#endif // _MSC_VER

// On Windows, these would be defined in <corerror.h>, but we don't
// want .NET as a dependency just to build C bindings.
#define COR_E_IO _HRESULT_TYPEDEF_(0x80131620L)
#define COR_E_INVALIDOPERATION _HRESULT_TYPEDEF_(0x80131509L)

#define SEAL_C_FUNC SEAL_C_DECOR HRESULT SEAL_C_CALL
1 change: 0 additions & 1 deletion native/src/seal/c/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <CorError.h>
#include <Windows.h>
#endif // _MSC_VER

Expand Down