2017-05-02 17:18:03 +08:00
|
|
|
#include "config.h"
|
2017-06-19 18:59:10 +08:00
|
|
|
#if HAVE_IOSTREAM
|
2017-03-26 07:02:34 +08:00
|
|
|
#include <iostream>
|
2017-06-19 18:59:10 +08:00
|
|
|
#elif HAVE_STDIO_H
|
|
|
|
#include <stdio.h>
|
|
|
|
#endif // IO
|
2017-03-26 07:02:34 +08:00
|
|
|
|
2017-05-02 17:18:03 +08:00
|
|
|
#if HAVE_SYS_IMPROBABLE_H
|
2017-05-02 17:46:14 +08:00
|
|
|
#warning "Improbable header present, probably a fault in the build system"
|
2017-05-02 17:08:14 +08:00
|
|
|
#endif
|
|
|
|
|
2017-05-02 17:46:14 +08:00
|
|
|
#ifndef HAVE_IOSTREAM
|
2017-05-02 17:08:14 +08:00
|
|
|
#warning "We expect to have iostream"
|
|
|
|
#endif
|
|
|
|
|
2017-11-08 18:43:35 +08:00
|
|
|
extern "C" int lib1_foo(void);
|
|
|
|
extern "C" int lib2_bar(void);
|
|
|
|
|
2017-03-26 07:02:34 +08:00
|
|
|
int main()
|
|
|
|
{
|
2017-06-19 18:59:10 +08:00
|
|
|
#if HAVE_IOSTREAM
|
2017-03-26 07:02:34 +08:00
|
|
|
std::cout << "You successfully built using build\n";
|
2017-06-19 18:59:10 +08:00
|
|
|
#elif HAVE_STDIO_H
|
|
|
|
printf("You successfully built using build (without iostream)\n");
|
|
|
|
#else
|
|
|
|
#warning "Building without <iostream> or <stdio.h>. Cross-compiling?"
|
|
|
|
#endif // HAVE_IOSTREAM
|
2017-11-08 18:43:35 +08:00
|
|
|
|
2018-04-05 23:25:12 +08:00
|
|
|
if (lib1_foo() != 42)
|
2017-11-08 18:43:35 +08:00
|
|
|
exit(1);
|
2018-04-05 23:25:12 +08:00
|
|
|
if (lib2_bar() != 42)
|
2017-11-08 18:43:35 +08:00
|
|
|
exit(2);
|
|
|
|
|
|
|
|
return 0;
|
2017-03-26 07:02:34 +08:00
|
|
|
}
|