summaryrefslogtreecommitdiff
path: root/src/compat-libs/linkwarning.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-19 08:50:02 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-25 18:10:08 -0500
commit53e856e16ac37fe30b8bb59153ff69aad0fa9c27 (patch)
tree0bbd3b2a038de5cc66249fdf892f38001d4f0586 /src/compat-libs/linkwarning.h
parent242465b5bfcc2ea1b1d704907e7dd5f1c15d4404 (diff)
build-sys: create "compatibility libraries" section
Compat stuff is moved to src/compat-libs/. Warnings are issued when programs are linked with the deprecated library.
Diffstat (limited to 'src/compat-libs/linkwarning.h')
-rw-r--r--src/compat-libs/linkwarning.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/compat-libs/linkwarning.h b/src/compat-libs/linkwarning.h
new file mode 100644
index 0000000000..b6a6ac2940
--- /dev/null
+++ b/src/compat-libs/linkwarning.h
@@ -0,0 +1,34 @@
+/***
+ This file is part of systemd, but is heavily based on
+ glibc's libc-symbols.h.
+
+ Copyright (C) 1995-1998,2000-2006,2008,2009 Free Software Foundation, Inc
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+
+#define __make_section_unallocated(section_string) \
+ asm (".section " section_string "\n\t.previous");
+
+#define __sec_comment "\n#APP\n\t#"
+
+#define link_warning(symbol, msg) \
+ __make_section_unallocated (".gnu.warning." #symbol) \
+ static const char __evoke_link_warning_##symbol[] \
+ __attribute__ ((used, section (".gnu.warning." #symbol __sec_comment))) \
+ = msg
+
+#define obsolete_lib(name, lib) \
+ link_warning(name, #name " was moved to libsystemd. Do not use " #lib ".")