diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/sproto/add-symbol-exports.patch | |
Diffstat (limited to 'vcpkg/ports/sproto/add-symbol-exports.patch')
| -rw-r--r-- | vcpkg/ports/sproto/add-symbol-exports.patch | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/vcpkg/ports/sproto/add-symbol-exports.patch b/vcpkg/ports/sproto/add-symbol-exports.patch new file mode 100644 index 0000000..06f0e93 --- /dev/null +++ b/vcpkg/ports/sproto/add-symbol-exports.patch @@ -0,0 +1,74 @@ +diff --git a/sproto.h b/sproto.h +index 1234567..8901234 100644 +--- a/sproto.h ++++ b/sproto.h +@@ -6,6 +6,24 @@ + struct sproto; + struct sproto_type; + ++#if defined(_WIN32) ++ #if defined(SPROTO_BUILD_DLL) ++ #define SPROTO_API __declspec(dllexport) ++ #elif defined(SPROTO_STATIC) ++ #define SPROTO_API ++ #else ++ #define SPROTO_API __declspec(dllimport) ++ #endif ++#elif defined(__GNUC__) || defined(__clang__) ++ #if defined(SPROTO_BUILD_DLL) ++ #define SPROTO_API __attribute__((visibility("default"))) ++ #else ++ #define SPROTO_API ++ #endif ++#else ++ #define SPROTO_API ++#endif ++ + #define SPROTO_REQUEST 0 + #define SPROTO_RESPONSE 1 + +@@ -25,19 +43,19 @@ + #define SPROTO_CB_NIL -2 + #define SPROTO_CB_NOARRAY -3 + +-struct sproto * sproto_create(const void * proto, size_t sz); +-void sproto_release(struct sproto *); ++SPROTO_API struct sproto * sproto_create(const void * proto, size_t sz); ++SPROTO_API void sproto_release(struct sproto *); + +-int sproto_prototag(const struct sproto *, const char * name); +-const char * sproto_protoname(const struct sproto *, int proto); ++SPROTO_API int sproto_prototag(const struct sproto *, const char * name); ++SPROTO_API const char * sproto_protoname(const struct sproto *, int proto); + // SPROTO_REQUEST(0) : request, SPROTO_RESPONSE(1): response +-struct sproto_type * sproto_protoquery(const struct sproto *, int proto, int what); +-int sproto_protoresponse(const struct sproto *, int proto); ++SPROTO_API struct sproto_type * sproto_protoquery(const struct sproto *, int proto, int what); ++SPROTO_API int sproto_protoresponse(const struct sproto *, int proto); + +-struct sproto_type * sproto_type(const struct sproto *, const char * type_name); ++SPROTO_API struct sproto_type * sproto_type(const struct sproto *, const char * type_name); + +-int sproto_pack(const void * src, int srcsz, void * buffer, int bufsz); +-int sproto_unpack(const void * src, int srcsz, void * buffer, int bufsz); ++SPROTO_API int sproto_pack(const void * src, int srcsz, void * buffer, int bufsz); ++SPROTO_API int sproto_unpack(const void * src, int srcsz, void * buffer, int bufsz); + + struct sproto_arg { + void *ud; +@@ -58,11 +76,11 @@ struct sproto_arg { + + typedef int (*sproto_callback)(const struct sproto_arg *args); + +-int sproto_decode(const struct sproto_type *, const void * data, int size, sproto_callback cb, void *ud); +-int sproto_encode(const struct sproto_type *, void * buffer, int size, sproto_callback cb, void *ud); ++SPROTO_API int sproto_decode(const struct sproto_type *, const void * data, int size, sproto_callback cb, void *ud); ++SPROTO_API int sproto_encode(const struct sproto_type *, void * buffer, int size, sproto_callback cb, void *ud); + + // for debug use +-void sproto_dump(struct sproto *); +-const char * sproto_name(struct sproto_type *); ++SPROTO_API void sproto_dump(struct sproto *); ++SPROTO_API const char * sproto_name(struct sproto_type *); + + #endif |