From 9f0bf35cfdcf1c852922f31a0fd1df936afc0fb8 Mon Sep 17 00:00:00 2001 From: William Metcalf Date: Wed, 16 Jun 2010 15:33:29 -0500 Subject: [PATCH] Set -std=gnu99 CFLAG always and Use -march=native by default if supported by installed version of gcc --- configure.in | 9 ++------- src/util-mpm-b2g.c | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index 350ec93b9d..54c819553b 100644 --- a/configure.in +++ b/configure.in @@ -52,6 +52,7 @@ AC_INIT(configure.in) CFLAGS="$CFLAGS -Wall -fno-strict-aliasing" CFLAGS="$CFLAGS -Wno-unused-parameter" + CFLAGS="$CFLAGS -std=gnu99" # Checks for programs. AC_PROG_AWK @@ -181,17 +182,11 @@ AC_INIT(configure.in) #enable gcc march=native gcc 4.2 or later AC_ARG_ENABLE(gccmarch_native, - AS_HELP_STRING([--enable-gccmarch-native], [Enable gcc march=native gcc 4.2 and later only]),,[enable_gccmarch_native=no]) + AS_HELP_STRING([--enable-gccmarch-native], [Enable gcc march=native gcc 4.2 and later only]),,[enable_gccmarch_native=yes]) AS_IF([test "x$enable_gccmarch_native" = "xyes"], [ if test "$gccvernum" -ge "402"; then dnl gcc 4.2 or later CFLAGS="$CFLAGS -march=native" - else - echo - echo " You specified --enable-gccmarch-native but looks like you are running gcc < 4.2" - echo " Please update your version of gcc or remove this option from configure." - echo - exit 1 fi ]) diff --git a/src/util-mpm-b2g.c b/src/util-mpm-b2g.c index 00ab841130..468fa73fed 100644 --- a/src/util-mpm-b2g.c +++ b/src/util-mpm-b2g.c @@ -63,7 +63,7 @@ void B2gThreadDestroyCtx(MpmCtx *, MpmThreadCtx *); int B2gAddPatternCI(MpmCtx *, uint8_t *, uint16_t, uint16_t, uint16_t, uint32_t, uint32_t, uint8_t); int B2gAddPatternCS(MpmCtx *, uint8_t *, uint16_t, uint16_t, uint16_t, uint32_t, uint32_t, uint8_t); int B2gPreparePatterns(MpmCtx *mpm_ctx); -inline uint32_t B2gSearchWrap(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, PatternMatcherQueue *, uint8_t *buf, uint16_t buflen); +uint32_t B2gSearchWrap(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, PatternMatcherQueue *, uint8_t *buf, uint16_t buflen); uint32_t B2gSearch1(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, PatternMatcherQueue *, uint8_t *buf, uint16_t buflen); #ifdef B2G_SEARCH2 uint32_t B2gSearch2(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, PatternMatcherQueue *, uint8_t *buf, uint16_t buflen); @@ -868,7 +868,7 @@ void B2gThreadDestroyCtx(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx) { } } -inline uint32_t B2gSearchWrap(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, PatternMatcherQueue *pmq, uint8_t *buf, uint16_t buflen) { +uint32_t B2gSearchWrap(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, PatternMatcherQueue *pmq, uint8_t *buf, uint16_t buflen) { B2gCtx *ctx = (B2gCtx *)mpm_ctx->ctx; return ctx ? ctx->Search(mpm_ctx, mpm_thread_ctx, pmq, buf, buflen) : 0; }