extern C for windows too

This commit is contained in:
julian
2024-01-02 15:52:11 -06:00
parent 9dced833c0
commit fb169cccad
2 changed files with 21 additions and 8 deletions

View File

@@ -12,6 +12,10 @@
using namespace spark;
#ifdef __cplusplus
extern "C" {
#endif
/*
* FFI-friendly wrapper for spark::getAddress.
*
@@ -422,4 +426,8 @@ SparkFeeResult* estimateSparkFee(
return result;
}
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -4,15 +4,16 @@
#include <stdint.h>
#include "structs.h"
#ifndef FFI_PLUGIN_EXPORT
#ifdef __cplusplus
#define FFI_PLUGIN_EXPORT extern "C" __attribute__((visibility("default"))) __attribute__((used))
#else
#define FFI_PLUGIN_EXPORT __attribute__((visibility("default"))) __attribute__((used))
#endif
#ifdef _WIN32
#define FFI_PLUGIN_EXPORT __declspec(dllexport)
extern "C" {
#endif
#ifndef FFI_PLUGIN_EXPORT
#ifdef _WIN32
#define FFI_PLUGIN_EXPORT __declspec(dllexport)
#else
#define FFI_PLUGIN_EXPORT __attribute__((visibility("default"))) __attribute__((used))
#endif
#endif
FFI_PLUGIN_EXPORT
@@ -101,4 +102,8 @@ struct SparkFeeResult* estimateSparkFee(
int privateRecipientsLength
);
#ifdef __cplusplus
}
#endif
#endif //ORG_FIRO_SPARK_DART_INTERFACE_H