Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libxxdk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
libxxdk
Commits
9cc1a9a6
Commit
9cc1a9a6
authored
2 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Plain Diff
Merge branch 'hotfix/declspec' into 'main'
Fix Windows DLL See merge request
!3
parents
d337c72c
f1ee3721
No related branches found
No related tags found
1 merge request
!3
Fix Windows DLL
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
README.md
+20
-1
20 additions, 1 deletion
README.md
sharedcgo/callbacks.go
+8
-8
8 additions, 8 deletions
sharedcgo/callbacks.go
sharedcgo/callbacks.h
+5
-0
5 additions, 0 deletions
sharedcgo/callbacks.h
with
34 additions
and
10 deletions
Makefile
+
1
−
1
View file @
9cc1a9a6
DOTNET
=
xxdk.NET
DOTNET
=
xxdk.NET
.PHONY
:
all windows-x64 windows-arm64 linux-
arm
64 linux-arm64 darwin-x64 darwin-arm64 dotnet
.PHONY
:
all windows-x64 windows-arm64 linux-
x
64 linux-arm64 darwin-x64 darwin-arm64 dotnet
libxxdk-win-x64.dll
:
libxxdk-win-x64.dll
:
CGO_ENABLED
=
1
GOOS
=
windows
GOARCH
=
amd64 go build
-buildmode
=
c-shared
-o
$@
./sharedcgo
CGO_ENABLED
=
1
GOOS
=
windows
GOARCH
=
amd64 go build
-buildmode
=
c-shared
-o
$@
./sharedcgo
...
...
This diff is collapsed.
Click to expand it.
README.md
+
20
−
1
View file @
9cc1a9a6
...
@@ -9,11 +9,30 @@ x86_64). It should run on Windows but may need the library name
...
@@ -9,11 +9,30 @@ x86_64). It should run on Windows but may need the library name
changed.
changed.
```
```
make
-k
make
linux-x64
cd xxdk.NET
cd xxdk.NET
dotnet run --ndf mainnet-ndf.json --state-dir world --wait 20 | grep ^DM
dotnet run --ndf mainnet-ndf.json --state-dir world --wait 20 | grep ^DM
```
```
Usually, you will want to make the library only for your
architecture. The options are:
*
windows-x64
*
windows-arm64
*
linux-x64
*
linux-arm64
*
darwin-x64
*
darwin-arm64
NOTE: you may need to specify a compiler to the make command, especially
when cross compiling. Example for compiling to windows:
```
CC=x86_64-w64-mingw32-gcc make windows-x64
cd xxdk.NET
dotnet run --ndf mainnet-ndf.json --state-dir world --wait 20 | grep ^DM
```
It's highly recommended to run with grep on the output. Especially on
It's highly recommended to run with grep on the output. Especially on
mainnet, logs can be noisy with failure to connect errors as it accesses
mainnet, logs can be noisy with failure to connect errors as it accesses
the network.
the network.
...
...
This diff is collapsed.
Click to expand it.
sharedcgo/callbacks.go
+
8
−
8
View file @
9cc1a9a6
...
@@ -21,7 +21,7 @@ package main
...
@@ -21,7 +21,7 @@ package main
// // here because of cgo rules. //
// // here because of cgo rules. //
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
//
//
// long cmix_dm_receive(int dm_instance_id,
//
DLL_EXPORT
long cmix_dm_receive(int dm_instance_id,
// void* message_id, int message_id_len,
// void* message_id, int message_id_len,
// char* nickname, int nickname_len,
// char* nickname, int nickname_len,
// void* text, int text_len,
// void* text, int text_len,
...
@@ -34,7 +34,7 @@ package main
...
@@ -34,7 +34,7 @@ package main
// text, text_len, partnerkey, partnerkey_len, senderkey, senderkey_len,
// text, text_len, partnerkey, partnerkey_len, senderkey, senderkey_len,
// dmToken, codeset, timestamp, round_id, msg_type, status);
// dmToken, codeset, timestamp, round_id, msg_type, status);
// }
// }
// long cmix_dm_receive_text(int dm_instance_id,
//
DLL_EXPORT
long cmix_dm_receive_text(int dm_instance_id,
// void* message_id, int message_id_len,
// void* message_id, int message_id_len,
// char* nickname, int nickname_len,
// char* nickname, int nickname_len,
// char* text, int text_len,
// char* text, int text_len,
...
@@ -47,7 +47,7 @@ package main
...
@@ -47,7 +47,7 @@ package main
// text, text_len, partnerkey, partnerkey_len, senderkey, senderkey_len,
// text, text_len, partnerkey, partnerkey_len, senderkey, senderkey_len,
// dmToken, codeset, timestamp, round_id, status);
// dmToken, codeset, timestamp, round_id, status);
// }
// }
// long cmix_dm_receive_reply(int dm_instance_id,
//
DLL_EXPORT
long cmix_dm_receive_reply(int dm_instance_id,
// void* message_id, int message_id_len,
// void* message_id, int message_id_len,
// void* reply_to, int reply_to_len,
// void* reply_to, int reply_to_len,
// char* nickname, int nickname_len,
// char* nickname, int nickname_len,
...
@@ -62,7 +62,7 @@ package main
...
@@ -62,7 +62,7 @@ package main
// text, text_len, partnerkey, partnerkey_len, senderkey, senderkey_len,
// text, text_len, partnerkey, partnerkey_len, senderkey, senderkey_len,
// dmToken, codeset, timestamp, round_id, status);
// dmToken, codeset, timestamp, round_id, status);
// }
// }
// long cmix_dm_receive_reaction(int dm_instance_id,
//
DLL_EXPORT
long cmix_dm_receive_reaction(int dm_instance_id,
// void* message_id, int message_id_len,
// void* message_id, int message_id_len,
// void* reaction_to, int reaction_to_len,
// void* reaction_to, int reaction_to_len,
// char* nickname, int nickname_len,
// char* nickname, int nickname_len,
...
@@ -77,17 +77,17 @@ package main
...
@@ -77,17 +77,17 @@ package main
// text, text_len, partnerkey, partnerkey_len, senderkey, senderkey_len,
// text, text_len, partnerkey, partnerkey_len, senderkey, senderkey_len,
// dmToken, codeset, timestamp, round_id, status);
// dmToken, codeset, timestamp, round_id, status);
// }
// }
// void cmix_dm_update_sent_status(int dm_instance_id,
//
DLL_EXPORT
void cmix_dm_update_sent_status(int dm_instance_id,
// long uuid,
// long uuid,
// void* message_id, int message_id_len, long timestamp,
// void* message_id, int message_id_len, long timestamp,
// long round_id, long status) {
// long round_id, long status) {
// DMReceiverRouter.updateSentStatusFn(dm_instance_id, uuid,
// DMReceiverRouter.updateSentStatusFn(dm_instance_id, uuid,
// message_id, message_id_len, timestamp, round_id, status);
// message_id, message_id_len, timestamp, round_id, status);
// }
// }
// void cmix_dm_block_sender(int dm_instance_id, void* pubkey, int pubkey_len) {
//
DLL_EXPORT
void cmix_dm_block_sender(int dm_instance_id, void* pubkey, int pubkey_len) {
// DMReceiverRouter.blockSenderFn(dm_instance_id, pubkey, pubkey_len);
// DMReceiverRouter.blockSenderFn(dm_instance_id, pubkey, pubkey_len);
// }
// }
// void cmix_dm_unblock_sender(int dm_instance_id, void* pubkey,
//
DLL_EXPORT
void cmix_dm_unblock_sender(int dm_instance_id, void* pubkey,
// int pubkey_len) {
// int pubkey_len) {
// DMReceiverRouter.unblockSenderFn(dm_instance_id, pubkey, pubkey_len);
// DMReceiverRouter.unblockSenderFn(dm_instance_id, pubkey, pubkey_len);
// }
// }
...
@@ -99,7 +99,7 @@ package main
...
@@ -99,7 +99,7 @@ package main
// GoByteSlice cmix_dm_get_conversations(int dm_instance_id) {
// GoByteSlice cmix_dm_get_conversations(int dm_instance_id) {
// return DMReceiverRouter.getConversationsFn(dm_instance_id);
// return DMReceiverRouter.getConversationsFn(dm_instance_id);
// }
// }
//
extern
void cmix_dm_set_router(DMReceiverRouterFunctions cbs) {
//
DLL_EXPORT
void cmix_dm_set_router(DMReceiverRouterFunctions cbs) {
// DMReceiverRouter.receiveFn = cbs.receiveFn;
// DMReceiverRouter.receiveFn = cbs.receiveFn;
// DMReceiverRouter.receiveTextFn = cbs.receiveTextFn;
// DMReceiverRouter.receiveTextFn = cbs.receiveTextFn;
// DMReceiverRouter.receiveReplyFn = cbs.receiveReplyFn;
// DMReceiverRouter.receiveReplyFn = cbs.receiveReplyFn;
...
...
This diff is collapsed.
Click to expand it.
sharedcgo/callbacks.h
+
5
−
0
View file @
9cc1a9a6
...
@@ -72,5 +72,10 @@ typedef struct {
...
@@ -72,5 +72,10 @@ typedef struct {
cmix_dm_get_conversations_fn
getConversationsFn
;
cmix_dm_get_conversations_fn
getConversationsFn
;
}
DMReceiverRouterFunctions
;
}
DMReceiverRouterFunctions
;
#ifdef _WIN32
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT
#endif
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment