implement compatibility shim for __warn_references
This will allow us to warn about deprecated function references at link-time.
This commit is contained in:
@@ -21,6 +21,7 @@ noinst_HEADERS += machine/endian.h
|
||||
noinst_HEADERS += netinet/in.h
|
||||
noinst_HEADERS += netinet/tcp.h
|
||||
|
||||
noinst_HEADERS += sys/cdefs.h
|
||||
noinst_HEADERS += sys/ioctl.h
|
||||
noinst_HEADERS += sys/mman.h
|
||||
noinst_HEADERS += sys/select.h
|
||||
|
31
include/sys/cdefs.h
Normal file
31
include/sys/cdefs.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Public domain
|
||||
* sys/cdefs.h compatibility shim
|
||||
*/
|
||||
|
||||
#ifndef LIBCRYPTOCOMPAT_SYS_CDEFS_H
|
||||
#define LIBCRYPTOCOMPAT_SYS_CDEFS_H
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#define __warn_references(sym,msg)
|
||||
|
||||
#else
|
||||
|
||||
#include_next <sys/cdefs.h>
|
||||
|
||||
#ifndef __warn_references
|
||||
|
||||
#if defined(__GNUC__) && defined (HAS_GNU_WARNING_LONG)
|
||||
#define __warn_references(sym,msg) \
|
||||
__asm__(".section .gnu.warning." __STRING(sym) \
|
||||
" ; .ascii \"" msg "\" ; .text");
|
||||
#else
|
||||
#define __warn_references(sym,msg)
|
||||
#endif
|
||||
|
||||
#endif /* __warn_references */
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#endif /* LIBCRYPTOCOMPAT_SYS_CDEFS_H */
|
Reference in New Issue
Block a user