-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broken support for constructors and destructors (#190)
- Loading branch information
Showing
3 changed files
with
37 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef _MSC_VER | ||
int global_var = 0; | ||
|
||
__attribute__((constructor)) static void update_global_var_in_constructor() { | ||
global_var = 6; | ||
} | ||
|
||
int main() { return global_var; } | ||
#else | ||
int main() { | ||
return 25; /* constructor/destructor attributes not supported on MSVC */ | ||
} | ||
#endif |