https://github.com/Kitware/CMake
Raw File
Tip revision: 9f3546bbb44e23b97ea226fce155330eb352f75b authored by Brad King on 13 June 2016, 14:28:02 UTC
CMake 3.6.0-rc2
Tip revision: 9f3546b
say.cxx
#include "hello.h"
#include <stdio.h>
#ifdef _MSC_VER
#include "windows.h"
#else
#define WINAPI
#endif

extern "C" {
// test __cdecl stuff
int WINAPI foo();
// test regular C
int bar();
}

// 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;
}
back to top