]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-magic: fix build when magic is not available
authorEric Leblond <eric@regit.org>
Tue, 20 Dec 2016 09:43:07 +0000 (10:43 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 20 Dec 2016 10:46:00 +0000 (11:46 +0100)
If HAVE_MAGIC is not defined then we don't have the test functions
so we can't register them.

src/util-magic.c

index e0f08a2ac214ce3762adc35dee7e926ea296b94c..96af56e1710341da7f35c6637ee69c01d6cedaa1 100644 (file)
@@ -659,6 +659,7 @@ end:
 
 void MagicRegisterTests(void)
 {
+#ifdef HAVE_MAGIC
 #ifdef UNITTESTS
     UtRegisterTest("MagicInitTest01", MagicInitTest01);
     UtRegisterTest("MagicInitTest02", MagicInitTest02);
@@ -676,4 +677,6 @@ void MagicRegisterTests(void)
     UtRegisterTest("MagicDetectTest10ValgrindError",
                    MagicDetectTest10ValgrindError);
 #endif /* UNITTESTS */
+#endif /* HAVE_MAGIC */
 }
+