Skip to content

Commit

Permalink
pdext: Fixed setup function not being visible in Windows dll (#119)
Browse files Browse the repository at this point in the history
* pdext: Fixed setup function not being visible in dll

* Don't define extern on macOS and Linux, use less common name
  • Loading branch information
timothyschoen authored Sep 3, 2023
1 parent 3f79f06 commit 656ed7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hvcc/generators/c2pdext/templates/pd_external.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

#if _MSC_VER || _WIN32 || _WIN64
#include <malloc.h>
#define DLL_EXPORT __declspec(dllexport) extern
#else
#include <alloca.h>
#define DLL_EXPORT
#endif

#include <string.h>
Expand Down Expand Up @@ -145,7 +147,7 @@ static void {{struct_name}}_onMessage(t_{{struct_name}} *x, t_symbol *s0, int ar
hv_sendMessageToReceiver(x->hv, hv_stringToHash(s0->s_name), 0.0, msg);
}

void {{struct_name}}_setup() {
DLL_EXPORT void {{struct_name}}_setup() {
{{struct_name}}_class = class_new(gensym("{{display_name}}"),
(t_newmethod) {{struct_name}}_new,
(t_method) {{struct_name}}_free,
Expand Down

0 comments on commit 656ed7f

Please sign in to comment.