summaryrefslogtreecommitdiff
path: root/pkg/openntpd/patch
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-06-20 18:12:06 -0700
committerMichael Forney <mforney@mforney.org>2019-06-20 18:12:32 -0700
commit452729a128923680a1406870c4e02fd62ef3d427 (patch)
tree223cfd8b736d78f9c61f488d9aff865ae431df97 /pkg/openntpd/patch
parent9dfd182da9ea572bf4ebe7992c53bd82ce39fef4 (diff)
openntpd: Provide definition of __packed
Diffstat (limited to 'pkg/openntpd/patch')
-rw-r--r--pkg/openntpd/patch/0003-Provide-fallback-definition-for-__packed.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkg/openntpd/patch/0003-Provide-fallback-definition-for-__packed.patch b/pkg/openntpd/patch/0003-Provide-fallback-definition-for-__packed.patch
new file mode 100644
index 00000000..a3421a79
--- /dev/null
+++ b/pkg/openntpd/patch/0003-Provide-fallback-definition-for-__packed.patch
@@ -0,0 +1,42 @@
+From 1a01dd331508160aeda3563dbbb6f62aa60c2156 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Thu, 20 Jun 2019 13:52:22 -0700
+Subject: [PATCH] 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.
+---
+ include/sys/types.h | 4 ++++
+ m4/check-os-options.m4 | 1 +
+ 2 files changed, 5 insertions(+)
+
+diff --git a/include/sys/types.h b/include/sys/types.h
+index 86821c7..5492e20 100644
+--- a/include/sys/types.h
++++ b/include/sys/types.h
+@@ -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.
+ */
+diff --git a/m4/check-os-options.m4 b/m4/check-os-options.m4
+index d4d02d9..4883d1f 100644
+--- a/m4/check-os-options.m4
++++ b/m4/check-os-options.m4
+@@ -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
+--
+2.20.1
+