File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6287,11 +6287,7 @@ fn (mut g Gen) write_init_function() {
62876287 // provide a constructor/destructor pair, ensuring that all constants
62886288 // are initialized just once, and that they will be freed too.
62896289 // Note: os.args in this case will be [].
6290- if g.pref.os == .windows {
6291- g.writeln ('// workaround for windows, export _vinit_caller, let dl.open() call it' )
6292- g.writeln ('// NOTE: This is hardcoded in vlib/dl/dl_windows.c.v!' )
6293- g.writeln ('VV_EXPORTED_SYMBOL void _vinit_caller();' )
6294- } else {
6290+ if g.pref.os != .windows {
62956291 g.writeln ('__attribute__ ((constructor))' )
62966292 }
62976293 g.writeln ('void _vinit_caller() {' )
@@ -6302,11 +6298,7 @@ fn (mut g Gen) write_init_function() {
63026298 g.writeln ('\t _vinit(0,0);' )
63036299 g.writeln ('}' )
63046300
6305- if g.pref.os == .windows {
6306- g.writeln ('// workaround for windows, export _vcleanup_caller, let dl.close() call it' )
6307- g.writeln ('// NOTE: This is hardcoded in vlib/dl/dl_windows.c.v!' )
6308- g.writeln ('VV_EXPORTED_SYMBOL void _vcleanup_caller();' )
6309- } else {
6301+ if g.pref.os != .windows {
63106302 g.writeln ('__attribute__ ((destructor))' )
63116303 }
63126304 g.writeln ('void _vcleanup_caller() {' )
Original file line number Diff line number Diff line change @@ -536,6 +536,12 @@ typedef int (*qsort_callback_func)(const void*, const void*);
536536int load_so(byteptr);
537537void _vinit(int ___argc, voidptr ___argv);
538538void _vcleanup(void);
539+ #ifdef _WIN32
540+ // workaround for windows, export _vinit_caller/_vcleanup_caller, let dl.open()/dl.close() call it
541+ // NOTE: This is hardcoded in vlib/dl/dl_windows.c.v!
542+ VV_EXPORTED_SYMBOL void _vinit_caller();
543+ VV_EXPORTED_SYMBOL void _vcleanup_caller();
544+ #endif
539545#define sigaction_size sizeof(sigaction);
540546#define _ARR_LEN(a) ( (sizeof(a)) / (sizeof(a[0])) )
541547
You can’t perform that action at this time.
0 commit comments