2015-06-19 23:12:43 +03:00
|
|
|
#include "hello.h"
|
2016-04-29 17:53:13 +03:00
|
|
|
#include <stdio.h>
|
2015-06-19 23:12:43 +03:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#include "windows.h"
|
|
|
|
#else
|
|
|
|
#define WINAPI
|
|
|
|
#endif
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
extern "C" {
|
2015-06-19 23:12:43 +03:00
|
|
|
// test __cdecl stuff
|
2016-05-16 17:34:04 +03:00
|
|
|
int WINAPI foo();
|
2015-06-19 23:12:43 +03:00
|
|
|
// test regular C
|
2016-05-16 17:34:04 +03:00
|
|
|
int bar();
|
2015-06-19 23:12:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// test c++ functions
|
|
|
|
// forward declare hello and world
|
|
|
|
void hello();
|
|
|
|
void world();
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
// test static data (needs declspec to work)
|
|
|
|
Hello::Data = 120;
|
|
|
|
Hello h;
|
|
|
|
h.real();
|
|
|
|
hello();
|
|
|
|
printf(" ");
|
|
|
|
world();
|
|
|
|
printf("\n");
|
|
|
|
foo();
|
|
|
|
printf("\n");
|
|
|
|
bar();
|
|
|
|
printf("\n");
|
|
|
|
return 0;
|
|
|
|
}
|