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();
|
2016-07-20 18:26:55 +03:00
|
|
|
int objlib();
|
2015-06-19 23:12:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// test c++ functions
|
|
|
|
// forward declare hello and world
|
|
|
|
void hello();
|
|
|
|
void world();
|
|
|
|
|
2016-07-10 20:24:43 +03:00
|
|
|
// test exports for executable target
|
|
|
|
extern "C" {
|
|
|
|
int own_auto_export_function(int i)
|
|
|
|
{
|
|
|
|
return i + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-19 23:12:43 +03:00
|
|
|
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();
|
2016-07-20 18:26:55 +03:00
|
|
|
objlib();
|
2015-06-19 23:12:43 +03:00
|
|
|
printf("\n");
|
|
|
|
return 0;
|
|
|
|
}
|