Skip to content

Commit

Permalink
Fixes for g++ 4.7 and OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatheny committed Apr 25, 2013
1 parent 196fa6b commit 913b1a2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
22 changes: 18 additions & 4 deletions configure.ac
Expand Up @@ -15,6 +15,8 @@ AC_LANG([C++])
# Checks for programs
CXXFLAGS="$CXXFLAGS -std=c++0x" # Will fail if not g++44 or later
AC_PROG_CXX([g++44 g++ gcc cxx cc++ c++])
AC_PROG_CXXCPP
CXXCPP="$CXXCPP -std=c++0x" # This must come after AC_PROG_CXXCPP
AC_PROG_LIBTOOL

# Check for typedefs, structures, and compiler characteristics
Expand All @@ -39,14 +41,26 @@ esac
# Check for headers
AC_CHECK_HEADERS([getopt.h])
AC_CHECK_HEADERS([pcrecpp.h])
AC_CHECK_HEADERS([cstdatomic])
AC_CHECK_HEADERS([atomic])

# Checks for libraries
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([getopt],[getopt_long])
AC_CHECK_LIB([gnugetopt],[getopt_long])

PCRECPP=""
AC_ARG_WITH([libpcrecpp],
AS_HELP_STRING([--with-libpcrecpp=DIR], [libpcre base directory]),
[with_libpcrecpp="$withval"],
[with_libpcrecpp="no"])
if test "x$with_libpcrecpp" != "xno"; then
LDFLAGS="${LDFLAGS} -L${with_libpcrecpp}/lib"
CPPFLAGS="${CPPFLAGS} -I${with_libpcrecpp}/include"
fi
# Fail if pcrecpp is not found
AC_CHECK_LIB([pcrecpp], [pcre_exec],,
[AC_MSG_ERROR([libpcrecpp not found but required])])
AC_CHECK_LIB(getopt,getopt_long)
AC_CHECK_LIB(gnugetopt,getopt_long)
AC_CHECK_LIB([pcrecpp], [main],, [AC_MSG_ERROR([libpcrecpp not found but required])])

AC_ARG_WITH(libpcap_includes,
AS_HELP_STRING([--with-libpcap-includes=DIR], [libpcap include directory]),
[with_libpcap_includes="$withval"],
Expand Down
1 change: 1 addition & 0 deletions src/net/memcache_command.cpp
Expand Up @@ -59,6 +59,7 @@ MemcacheCommand::MemcacheCommand(const Packet& _packet,
}

tcpHeader = (struct tcphdr*)(packet + ether_header_sz + ip_sz);
(void)tcpHeader;
data = (u_char*)(packet + ether_header_sz + ip_sz + tcphdr_sz);
dataLength = pkthdr->len - (ether_header_sz + ip_sz + tcphdr_sz);
if (dataLength > pkthdr->caplen) {
Expand Down
10 changes: 10 additions & 0 deletions src/util/stat.h
@@ -1,8 +1,18 @@
#ifndef _UTIL_STAT_H
#define _UTIL_STAT_H

#ifdef HAVE_CONFIG_H
#include "mconfig.h"
#endif

#include <cstdint>

#ifdef HAVE_ATOMIC
#include <atomic>
#else
#include <cstdatomic>
#endif

#include <functional>
#include <unordered_map>
#include <string>
Expand Down

0 comments on commit 913b1a2

Please sign in to comment.