diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-02-12 11:07:18 (GMT) |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-02-12 11:07:18 (GMT) |
commit | bd7029a99b0c2974265c6665638ef14a052f42ab (patch) | |
tree | f5661ba73366d81ef6e91f889ea7fec5ebe07b6b /build-aux/link-warning.h | |
parent | f99612320d6eda67644c07be04bb21aa4d7789db (diff) | |
download | monitoring-plugins-bd7029a99b0c2974265c6665638ef14a052f42ab.tar.gz |
Sync to latest Gnulib
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1925 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'build-aux/link-warning.h')
-rw-r--r-- | build-aux/link-warning.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/build-aux/link-warning.h b/build-aux/link-warning.h new file mode 100644 index 0000000..fda0194 --- /dev/null +++ b/build-aux/link-warning.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* GL_LINK_WARNING("literal string") arranges to emit the literal string as | ||
2 | a linker warning on most glibc systems. | ||
3 | We use a linker warning rather than a preprocessor warning, because | ||
4 | #warning cannot be used inside macros. */ | ||
5 | #ifndef GL_LINK_WARNING | ||
6 | /* This works on platforms with GNU ld and ELF object format. | ||
7 | Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. | ||
8 | Testing __ELF__ guarantees the ELF object format. | ||
9 | Testing __GNUC__ is necessary for the compound expression syntax. */ | ||
10 | # if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ | ||
11 | # define GL_LINK_WARNING(message) \ | ||
12 | GL_LINK_WARNING1 (__FILE__, __LINE__, message) | ||
13 | # define GL_LINK_WARNING1(file, line, message) \ | ||
14 | GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ | ||
15 | # define GL_LINK_WARNING2(file, line, message) \ | ||
16 | GL_LINK_WARNING3 (file ":" #line ": warning: " message) | ||
17 | # define GL_LINK_WARNING3(message) \ | ||
18 | ({ static const char warning[sizeof (message)] \ | ||
19 | __attribute__ ((__unused__, \ | ||
20 | __section__ (".gnu.warning"), \ | ||
21 | __aligned__ (1))) \ | ||
22 | = message "\n"; \ | ||
23 | (void)0; \ | ||
24 | }) | ||
25 | # else | ||
26 | # define GL_LINK_WARNING(message) ((void) 0) | ||
27 | # endif | ||
28 | #endif | ||