config.h must be included first, because it affects all the later
included headers, even the system ones. Also, struct timeval
requires inclusion of sys/time.h.
This fixes the build with CC=clang CFLAGS='-std=c99 -fgnuc-version=0'
Fixes: aec1081c7df3 ("tests: Add ovs-barrier unit test.")
Fixes: 2eac33c6cc4a ("id-fpool: Module for fast ID generation.")
Fixes: 5396ba5b21c4 ("mpsc-queue: Module for lock-free message passing.")
Signed-off-by: Ilya Maximets <[email protected]>
---
tests/test-barrier.c | 8 ++++----
tests/test-id-fpool.c | 4 ++--
tests/test-mpsc-queue.c | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tests/test-barrier.c b/tests/test-barrier.c
index 3bc5291cc..fb0ab0e69 100644
--- a/tests/test-barrier.c
+++ b/tests/test-barrier.c
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-#include <getopt.h>
-
#include <config.h>
+#undef NDEBUG
+#include <getopt.h>
-#include "ovs-thread.h"
-#include "ovs-rcu.h"
#include "ovstest.h"
+#include "ovs-rcu.h"
+#include "ovs-thread.h"
#include "random.h"
#include "util.h"
diff --git a/tests/test-id-fpool.c b/tests/test-id-fpool.c
index 25275d9ae..27800aa9b 100644
--- a/tests/test-id-fpool.c
+++ b/tests/test-id-fpool.c
@@ -14,12 +14,12 @@
* limitations under the License.
*/
+#include <config.h>
#undef NDEBUG
#include <assert.h>
#include <getopt.h>
#include <string.h>
-
-#include <config.h>
+#include <sys/time.h>
#include "command-line.h"
#include "id-fpool.h"
diff --git a/tests/test-mpsc-queue.c b/tests/test-mpsc-queue.c
index a38bf9e6d..16aa804a0 100644
--- a/tests/test-mpsc-queue.c
+++ b/tests/test-mpsc-queue.c
@@ -14,12 +14,12 @@
* limitations under the License.
*/
+#include <config.h>
#undef NDEBUG
#include <assert.h>
#include <getopt.h>
#include <string.h>
-
-#include <config.h>
+#include <sys/time.h>
#include "command-line.h"
#include "guarded-list.h"
--
2.40.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev