37 lines
496 B
C++
Raw Normal View History

2015-11-17 17:22:37 +01:00
#include "hello.h"
2016-07-09 11:21:54 +02:00
#include <stdio.h>
2015-11-17 17:22:37 +01:00
#ifdef _MSC_VER
#include "windows.h"
#else
#define WINAPI
#endif
2016-07-09 11:21:54 +02:00
extern "C" {
2015-11-17 17:22:37 +01:00
// test __cdecl stuff
2016-07-09 11:21:54 +02:00
int WINAPI foo();
2015-11-17 17:22:37 +01:00
// test regular C
2016-07-09 11:21:54 +02:00
int bar();
2015-11-17 17:22:37 +01: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;
}