Skip to content

Commit 3d5db5e

Browse files
singaraionaclaude
andcommitted
fix(raykx): use __declspec(dllexport) instead of .def file on Windows
MinGW lld doesn't understand MSVC-style /DEF: options. Use standard dllexport attribute which works with all Windows toolchains. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent afb9714 commit 3d5db5e

2 files changed

Lines changed: 11 additions & 12 deletions

File tree

ext/raykx/Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CFLAGS = -Wall -Wextra -std=c17 -fsigned-char -m64 -I. -I../../core
1212

1313
ifneq (,$(IS_WINDOWS))
1414
TARGET = raykx.dll
15-
# On Windows, link against rayforce.lib import library
15+
# On Windows, exports via __declspec(dllexport) in raykx.h
1616
TEMP ?= /tmp
1717
export TEMP
1818
LDFLAGS = -shared -fuse-ld=lld
@@ -36,18 +36,10 @@ endif
3636
default: debug
3737

3838
debug:
39-
ifneq (,$(IS_WINDOWS))
40-
$(CC) -include ../../core/def.h $(DEBUG_CFLAGS) $(LDFLAGS) -Wl,/DEF:$(shell cygpath -w raykx.def) -o $(TARGET) $(SRCS) $(LIBS)
41-
else
4239
$(CC) -include ../../core/def.h $(DEBUG_CFLAGS) $(LDFLAGS) -o $(TARGET) $(SRCS) $(LIBS)
43-
endif
4440

4541
release:
46-
ifneq (,$(IS_WINDOWS))
47-
$(CC) -include ../../core/def.h $(RELEASE_CFLAGS) $(LDFLAGS) -Wl,/DEF:$(shell cygpath -w raykx.def) -o $(TARGET) $(SRCS) $(LIBS)
48-
else
4942
$(CC) -include ../../core/def.h $(RELEASE_CFLAGS) $(LDFLAGS) -o $(TARGET) $(SRCS) $(LIBS)
50-
endif
5143

5244
clean:
5345
rm -f $(TARGET) libraykx.so libraykx.dylib raykx.dll

ext/raykx/raykx.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626

2727
#include "../../core/rayforce.h"
2828

29+
#ifdef _WIN32
30+
#define RAYKX_EXPORT __declspec(dllexport)
31+
#else
32+
#define RAYKX_EXPORT
33+
#endif
34+
2935
// KDB+ IPC Protocol Constants
3036
#define KDB_MSG_ASYN 0
3137
#define KDB_MSG_SYNC 1
@@ -48,8 +54,9 @@ typedef struct raykx_header_t {
4854
u32_t size;
4955
} *raykx_header_p;
5056

51-
obj_p raykx_hopen(obj_p addr);
52-
obj_p raykx_hclose(obj_p fd);
53-
obj_p raykx_send(obj_p fd, obj_p msg);
57+
RAYKX_EXPORT obj_p raykx_listen(obj_p x);
58+
RAYKX_EXPORT obj_p raykx_hopen(obj_p addr);
59+
RAYKX_EXPORT obj_p raykx_hclose(obj_p fd);
60+
RAYKX_EXPORT obj_p raykx_send(obj_p fd, obj_p msg);
5461

5562
#endif // RAYKX_H

0 commit comments

Comments
 (0)