Try to fix the builds.

Change-Id: I3ccb5c1b40504cd9314da5a09b225e3e2bf991b8
Reviewed-on: https://code.wireshark.org/review/2073
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
AndersBroman 2014-06-09 17:30:08 +02:00 committed by Anders Broman
parent 9dbf2ff28e
commit 8e8a4ceba3
5 changed files with 47 additions and 12 deletions

View File

@ -44,6 +44,7 @@
#include "wsutil/unicode-utils.h"
#include "wsutil/nstime.h"
#include "wsutil/time_util.h"
#include "wsutil/ws_mempbrk.h"
#include "tvbuff.h"
#include "tvbuff-int.h"
#include "strutil.h"
@ -739,8 +740,6 @@ fast_ensure_contiguous(tvbuff_t *tvb, const gint offset, const guint length)
return NULL;
}
extern const guint8 *ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles);
static inline const guint8*
guint8_pbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles, guchar *found_needle)
{

View File

@ -104,7 +104,9 @@ LIBWSUTIL_INCLUDES = \
type_util.h \
u3.h \
unicode-utils.h \
ws_cpuid.h
ws_cpuid.h \
ws_mempbrk.h \
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html

View File

@ -24,12 +24,7 @@
#include <glib.h>
#include "ws_symbol_export.h"
#include "ws_cpuid.h"
#ifdef HAVE_SSE42
extern const char *_ws_mempbrk_sse42(const char* haystack, size_t haystacklen, const char *needles);
#endif
const guint8 *_ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles);
#include "ws_mempbrk.h"
const guint8 *
_ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles)
@ -56,7 +51,7 @@ ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles)
#ifdef HAVE_SSE42
guint32 CPUInfo[4];
guint32 bSSE42Extensions;
/*const int has_sse42 = 1;*/ /* XXX, use CPUID */
#endif
if (*needles == 0)
return NULL;

36
wsutil/ws_mempbrk.h Normal file
View File

@ -0,0 +1,36 @@
/* ws_mempbrk.h
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __WS_MEMPBRK_H__
#define __WS_MEMPBRK_H__
#include "ws_symbol_export.h"
WS_DLL_PUBLIC const guint8 *ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles);
#ifdef HAVE_SSE42
const char *_ws_mempbrk_sse42(const char* haystack, size_t haystacklen, const char *needles);
#endif
const guint8 *_ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles);
#endif /* __WS_MEMPBRK_H__ */

View File

@ -28,9 +28,10 @@
#include <nmmintrin.h>
#include <string.h>
#include "ws_mempbrk.h"
#ifdef HAVE_SSE42
extern const guint8 *_ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles);
const char *_ws_mempbrk_sse42(const char* haystack, size_t haystacklen, const char *needles);
/* Helper for variable shifts of SSE registers.
Copyright (C) 2010 Free Software Foundation, Inc.
@ -186,3 +187,5 @@ _ws_mempbrk_sse42(const char *s, size_t slen, const char *a)
/* XXX, use mempbrk_slow here? */
return _ws_mempbrk(aligned, slen, a);
}
#endif /* HAVE_SSE42 */