Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report CPU architecture in test app.
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
#include <stdio.h> | ||
int hello(void) { printf("hello from a shared library!\n"); return 0; } | ||
|
||
#if defined(__i386__) | ||
#define cpu "x86" | ||
#elif defined(__x86_64__) | ||
#define cpu "x86-64" | ||
#elif defined(__powerpc64__) | ||
#define cpu "powerpc64" | ||
#elif defined(__powerpc__) | ||
#define cpu "powerpc" | ||
#else | ||
#error Please add your CPU architecture here. | ||
#endif | ||
|
||
int hello(void) | ||
{ | ||
printf("hello from a shared library! This binary's arch is: %s!\n", cpu); | ||
return 0; | ||
} | ||
|
||
/* end of hello-lib.c ... */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters