mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 22:31:18 -05:00
3250b9a122
Revert the main logic change of commit v3.9.0-rc1~192^2 (bindexplib: fix constants symbols export, 2017-04-26) and its test case. Unfortunately some constants may be provided by multiple object files with different `@...` suffixes, leading to ambiguous references. Revert support pending further investigation. Fixes: #17045
51 lines
687 B
C++
51 lines
687 B
C++
#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();
|
|
int objlib();
|
|
void justnop();
|
|
}
|
|
|
|
// test c++ functions
|
|
// forward declare hello and world
|
|
void hello();
|
|
void world();
|
|
|
|
// test exports for executable target
|
|
extern "C" {
|
|
int own_auto_export_function(int i)
|
|
{
|
|
return i + 1;
|
|
}
|
|
}
|
|
|
|
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();
|
|
objlib();
|
|
printf("\n");
|
|
#ifdef HAS_JUSTNOP
|
|
justnop();
|
|
#endif
|
|
return 0;
|
|
}
|