mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-01-02 06:03:06 +00:00
fix: status-go compatibility issues (#9)
This commit is contained in:
parent
074eafe895
commit
61f7b6b8d5
13
Makefile
13
Makefile
@ -1,6 +1,8 @@
|
||||
.PHONY: libsds
|
||||
|
||||
export BUILD_SYSTEM_DIR := vendor/nimbus-build-system
|
||||
LINK_PCRE := 0
|
||||
|
||||
# we don't want an error here, so we can handle things later, in the ".DEFAULT" target
|
||||
-include $(BUILD_SYSTEM_DIR)/makefiles/variables.mk
|
||||
|
||||
@ -37,6 +39,17 @@ deps: | sds.nims
|
||||
# must be included after the default target
|
||||
-include $(BUILD_SYSTEM_DIR)/makefiles/targets.mk
|
||||
|
||||
## Git version
|
||||
GIT_VERSION ?= $(shell git describe --abbrev=6 --always --tags)
|
||||
## Compilation parameters. If defined in the CLI the assignments won't be executed
|
||||
NIM_PARAMS := $(NIM_PARAMS) -d:git_version=\"$(GIT_VERSION)\"
|
||||
|
||||
ifeq ($(DEBUG), 0)
|
||||
NIM_PARAMS := $(NIM_PARAMS) -d:release
|
||||
else
|
||||
NIM_PARAMS := $(NIM_PARAMS) -d:debug
|
||||
endif
|
||||
|
||||
STATIC ?= 0
|
||||
|
||||
libsds: deps
|
||||
|
||||
@ -24,34 +24,34 @@ typedef void (*SdsCallBack) (int callerRet, const char* msg, size_t len, void* u
|
||||
// --- Core API Functions ---
|
||||
|
||||
|
||||
void* NewReliabilityManager(const char* channelId, SdsCallBack callback, void* userData);
|
||||
void* SdsNewReliabilityManager(const char* channelId, SdsCallBack callback, void* userData);
|
||||
|
||||
void SetEventCallback(void* ctx, SdsCallBack callback, void* userData);
|
||||
void SdsSetEventCallback(void* ctx, SdsCallBack callback, void* userData);
|
||||
|
||||
int CleanupReliabilityManager(void* ctx, SdsCallBack callback, void* userData);
|
||||
int SdsCleanupReliabilityManager(void* ctx, SdsCallBack callback, void* userData);
|
||||
|
||||
int ResetReliabilityManager(void* ctx, SdsCallBack callback, void* userData);
|
||||
int SdsResetReliabilityManager(void* ctx, SdsCallBack callback, void* userData);
|
||||
|
||||
int WrapOutgoingMessage(void* ctx,
|
||||
int SdsWrapOutgoingMessage(void* ctx,
|
||||
void* message,
|
||||
size_t messageLen,
|
||||
const char* messageId,
|
||||
SdsCallBack callback,
|
||||
void* userData);
|
||||
|
||||
int UnwrapReceivedMessage(void* ctx,
|
||||
int SdsUnwrapReceivedMessage(void* ctx,
|
||||
void* message,
|
||||
size_t messageLen,
|
||||
SdsCallBack callback,
|
||||
void* userData);
|
||||
|
||||
int MarkDependenciesMet(void* ctx,
|
||||
int SdsMarkDependenciesMet(void* ctx,
|
||||
char** messageIDs,
|
||||
size_t count,
|
||||
SdsCallBack callback,
|
||||
void* userData);
|
||||
|
||||
int StartPeriodicTasks(void* ctx, SdsCallBack callback, void* userData);
|
||||
int SdsStartPeriodicTasks(void* ctx, SdsCallBack callback, void* userData);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ proc initializeLibrary() {.exported.} =
|
||||
################################################################################
|
||||
### Exported procs
|
||||
|
||||
proc NewReliabilityManager(
|
||||
proc SdsNewReliabilityManager(
|
||||
channelId: cstring, callback: SdsCallBack, userData: pointer
|
||||
): pointer {.dynlib, exportc, cdecl.} =
|
||||
initializeLibrary()
|
||||
@ -170,14 +170,14 @@ proc NewReliabilityManager(
|
||||
|
||||
return ctx
|
||||
|
||||
proc SetEventCallback(
|
||||
proc SdsSetEventCallback(
|
||||
ctx: ptr SdsContext, callback: SdsCallBack, userData: pointer
|
||||
) {.dynlib, exportc.} =
|
||||
initializeLibrary()
|
||||
ctx[].eventCallback = cast[pointer](callback)
|
||||
ctx[].eventUserData = userData
|
||||
|
||||
proc CleanupReliabilityManager(
|
||||
proc SdsCleanupReliabilityManager(
|
||||
ctx: ptr SdsContext, callback: SdsCallBack, userData: pointer
|
||||
): cint {.dynlib, exportc.} =
|
||||
initializeLibrary()
|
||||
@ -193,7 +193,7 @@ proc CleanupReliabilityManager(
|
||||
|
||||
return RET_OK
|
||||
|
||||
proc ResetReliabilityManager(
|
||||
proc SdsResetReliabilityManager(
|
||||
ctx: ptr SdsContext, callback: SdsCallBack, userData: pointer
|
||||
): cint {.dynlib, exportc.} =
|
||||
initializeLibrary()
|
||||
@ -206,7 +206,7 @@ proc ResetReliabilityManager(
|
||||
userData,
|
||||
)
|
||||
|
||||
proc WrapOutgoingMessage(
|
||||
proc SdsWrapOutgoingMessage(
|
||||
ctx: ptr SdsContext,
|
||||
message: pointer,
|
||||
messageLen: csize_t,
|
||||
@ -237,7 +237,7 @@ proc WrapOutgoingMessage(
|
||||
userData,
|
||||
)
|
||||
|
||||
proc UnwrapReceivedMessage(
|
||||
proc SdsUnwrapReceivedMessage(
|
||||
ctx: ptr SdsContext,
|
||||
message: pointer,
|
||||
messageLen: csize_t,
|
||||
@ -262,7 +262,7 @@ proc UnwrapReceivedMessage(
|
||||
userData,
|
||||
)
|
||||
|
||||
proc MarkDependenciesMet(
|
||||
proc SdsMarkDependenciesMet(
|
||||
ctx: ptr SdsContext,
|
||||
messageIds: pointer,
|
||||
count: csize_t,
|
||||
@ -287,7 +287,7 @@ proc MarkDependenciesMet(
|
||||
userData,
|
||||
)
|
||||
|
||||
proc StartPeriodicTasks(
|
||||
proc SdsStartPeriodicTasks(
|
||||
ctx: ptr SdsContext, callback: SdsCallBack, userData: pointer
|
||||
): cint {.dynlib, exportc.} =
|
||||
initializeLibrary()
|
||||
|
||||
21
sds.nimble
21
sds.nimble
@ -1,3 +1,5 @@
|
||||
mode = ScriptMode.Verbose
|
||||
|
||||
# Package
|
||||
version = "0.1.0"
|
||||
author = "Waku Team"
|
||||
@ -6,9 +8,14 @@ license = "MIT"
|
||||
srcDir = "src"
|
||||
|
||||
# Dependencies
|
||||
requires "nim >= 2.0.8"
|
||||
requires "chronicles"
|
||||
requires "libp2p"
|
||||
requires "nim >= 2.2.4",
|
||||
"chronicles",
|
||||
"chronos",
|
||||
"stew",
|
||||
"stint",
|
||||
"metrics",
|
||||
"libp2p",
|
||||
"results"
|
||||
|
||||
proc buildLibrary(name: string, srcDir = "./", params = "", `type` = "static") =
|
||||
if not dirExists "build":
|
||||
@ -35,5 +42,11 @@ task libsdsDynamic, "Generate bindings":
|
||||
let name = "libsds"
|
||||
buildLibrary name,
|
||||
"library/",
|
||||
"",
|
||||
"""-d:chronicles_line_numbers \
|
||||
-d:chronicles_runtime_filtering=on \
|
||||
-d:chronicles_sinks="textlines,json" \
|
||||
-d:chronicles_default_output_device=Dynamic \
|
||||
--warning:Deprecated:off \
|
||||
--warning:UnusedImport:on \
|
||||
-d:chronicles_log_level=TRACE """,
|
||||
"dynamic"
|
||||
2
vendor/nimbus-build-system
vendored
2
vendor/nimbus-build-system
vendored
@ -1 +1 @@
|
||||
Subproject commit 5f10509cf880dc035e517ca7bac3163cd5206ba8
|
||||
Subproject commit 0be0663e1af76e869837226a4ef3e586fcc737d3
|
||||
Loading…
x
Reference in New Issue
Block a user