-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathhello.cpp
More file actions
35 lines (29 loc) · 726 Bytes
/
hello.cpp
File metadata and controls
35 lines (29 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "config.h"
#if HAVE_IOSTREAM
#include <iostream>
#elif HAVE_STDIO_H
#include <stdio.h>
#endif // IO
#if HAVE_SYS_IMPROBABLE_H
#warning "Improbable header present, probably a fault in the build system"
#endif
#ifndef HAVE_IOSTREAM
#warning "We expect to have iostream"
#endif
extern "C" int lib1_foo(void);
extern "C" int lib2_bar(void);
int main()
{
#if HAVE_IOSTREAM
std::cout << "You successfully built using build\n";
#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
if (lib1_foo() != 0)
exit(1);
if (lib2_bar() != 0)
exit(2);
return 0;
}