Browse Source

Revert "use __dead macro from sys/cdefs.h"

This partially reverts commit a7577667d6.
The musl C library does not use an internal cdefs.h header. As a result,
the definitions in sys/cdefs.h have no effect. This breads the build as
follows:
In file included from adjfreq_linux.c:23:0:
../src/ntpd.h:448:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
__dead void fatal(const char *, ...)
^~~~
../src/ntpd.h:450:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
__dead void fatalx(const char *, ...)
^~~~
Refer the related musl FAQ about cdefs.h:
http://wiki.musl-libc.org/wiki/FAQ#Q:_I.27m_trying_to_compile_something_against_musl_and_I_get_error_messages_about_sys.2Fcdefs.h
Keep the compiler attribute definition.
Remove also from noinst_HEADERS.
OPENBSD_6_2
Baruch Siach 6 years ago
parent
commit
17aa5d9819
3 changed files with 4 additions and 17 deletions
  1. +0
    -1
      include/Makefile.am
  2. +0
    -16
      include/sys/cdefs.h
  3. +4
    -0
      include/sys/types.h

+ 0
- 1
include/Makefile.am View File

@ -1,6 +1,5 @@
noinst_HEADERS =
noinst_HEADERS += machine/endian.h
noinst_HEADERS += sys/cdefs.h
noinst_HEADERS += sys/queue.h
noinst_HEADERS += sys/socket.h
noinst_HEADERS += sys/types.h


+ 0
- 16
include/sys/cdefs.h View File

@ -1,16 +0,0 @@
/*
* Public domain
* sys/cdefs.h compatibility shim
*/
#include_next <sys/cdefs.h>
#ifndef LIBCOMPAT_SYS_CDEFS_H
#define LIBCOMPAT_SYS_CDEFS_H
#if !defined(HAVE_ATTRIBUTE__DEAD) && !defined(__dead)
#define __dead __attribute__((__noreturn__))
#define __pure __attribute__((__const__))
#endif
#endif

+ 4
- 0
include/sys/types.h View File

@ -14,6 +14,10 @@
#include <_bsd_types.h>
#endif
#if !defined(HAVE_ATTRIBUTE__DEAD) && !defined(__dead)
#define __dead __attribute__((__noreturn__))
#endif
#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__bounded__)
# define __bounded__(x, y, z)
#endif


Loading…
Cancel
Save