Browse Source

Provide fallback definition for __packed

Otherwise, systems that don't support it will treat it as a name for a
global `struct ntp_msg` variable.
master
Michael Forney 5 years ago
parent
commit
bc2cd89715
2 changed files with 5 additions and 0 deletions
  1. +4
    -0
      include/sys/types.h
  2. +1
    -0
      m4/check-os-options.m4

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

@ -22,6 +22,10 @@
# define __bounded__(x, y, z)
#endif
#if !defined(HAVE_ATTRIBUTE__PACKED) && !defined(__packed)
# define __packed __attribute__((__packed__))
#endif
/*
* Define BSD-style unsigned bits types for systems that do not have them.
*/


+ 1
- 0
m4/check-os-options.m4 View File

@ -69,6 +69,7 @@ case $host_os in
HOST_ABI=elf
AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded])
AC_DEFINE([HAVE_ATTRIBUTE__DEAD], [1], [OpenBSD gcc has __dead])
AC_DEFINE([HAVE_ATTRIBUTE__PACKED], [1], [OpenBSD gcc has __packed])
;;
*solaris*)
HOST_OS=solaris


Loading…
Cancel
Save