13a6ff31be
Teach Visual Studio generators to include object files from object libraries in the list of objects whose symbols are to be exported. The Makefile and Ninja generators already did this. Update the test to cover this case. Reported-by: Bertrand Bellenot <Bertrand.Bellenot@cern.ch>
47 lines
632 B
C++
47 lines
632 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();
|
|
}
|
|
|
|
// 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");
|
|
return 0;
|
|
}
|