mirror of
https://frontier.innolan.net/github/amigaos-cross-toolchain6.git
synced 2024-10-19 10:29:55 +00:00
Global C++ constructors and destructors work again. Fixes #42.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __A
|
||||
struct A {
|
||||
int i;
|
||||
A(int _i) { i = _i; puts("ctor A"); }
|
||||
~A() { puts("dtor A"); }
|
||||
};
|
||||
|
||||
A a(10);
|
||||
#endif
|
||||
|
||||
#ifdef __B
|
||||
struct B {
|
||||
int i;
|
||||
B(int _i) { i = _i; puts("ctor B"); }
|
||||
~B() { puts("dtor B"); }
|
||||
};
|
||||
|
||||
B b(20);
|
||||
#endif
|
||||
|
||||
#if !defined(__A) && !defined(__B)
|
||||
int main()
|
||||
{
|
||||
puts("hello world!");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user