[PATCH 2/2] main_dd.c: Eliminate no prototype warning for swab()
Joel Sherrill
joel at rtems.org
Sun Aug 27 21:02:04 UTC 2017
---
cpukit/libmisc/shell/main_dd.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/cpukit/libmisc/shell/main_dd.c b/cpukit/libmisc/shell/main_dd.c
index e9c8bf3..6ae4abb 100644
--- a/cpukit/libmisc/shell/main_dd.c
+++ b/cpukit/libmisc/shell/main_dd.c
@@ -73,6 +73,17 @@ __FBSDID("$FreeBSD: src/bin/dd/dd.c,v 1.43 2004/08/15 19:10:05 rwatson Exp $");
#include <string.h>
#include <unistd.h>
+#ifdef __rtems__
+/*
+ * We should be able to define _XOPEN_SOURCE=900 to get a prototype for
+ * swab() but if that is defined before including <rtems.h>, then the RTEMS
+ * headers don't compile. If defined after including <rtems.h>, then
+ * it still doesn't trip the include. Thus this prototype.
+ */
+
+void swab(const void *from, void *to, ssize_t n);
+#endif
+
#include "dd.h"
#include "extern-dd.h"
--
1.8.3.1
More information about the devel
mailing list