forked from osmocom/wireshark
regex: Prefer C99/POSIX types
Replace 'gssize' with 'ssize_t'. Add a CMake configure check for ssize_t. Fix missing "config.h" includes.pespin/osmux-wip
parent
e5088eea4a
commit
b30a2112e8
|
@ -103,6 +103,10 @@ check_struct_has_member("struct tm" tm_zone time.h HAVE_STRUC
|
|||
#Symbols but NOT enums or types
|
||||
check_symbol_exists(tzname "time.h" HAVE_TZNAME)
|
||||
|
||||
# Types
|
||||
include(CheckTypeSize)
|
||||
check_type_size("ssize_t" SSIZE_T)
|
||||
|
||||
#
|
||||
# Check if the libc vsnprintf() conforms to C99. If this fails we may
|
||||
# need to fall-back on GLib I/O.
|
||||
|
|
|
@ -294,10 +294,14 @@
|
|||
/* Note: not use in the code */
|
||||
#cmakedefine YYTEXT_POINTER
|
||||
|
||||
/* Define to 1 if the 'ssize_t' type exists. */
|
||||
#cmakedefine HAVE_SSIZE_T 1
|
||||
|
||||
#ifndef HAVE_SSIZE_T
|
||||
# define ssize_t long int
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# if !defined(QT_VERSION) || !defined(_SSIZE_T_DEFINED)
|
||||
typedef int ssize_t;
|
||||
# endif
|
||||
# define strncasecmp strnicmp
|
||||
# define popen _popen
|
||||
# define pclose _pclose
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include "packet-bpsec.h"
|
||||
#include "packet-bpv7.h"
|
||||
#include <epan/packet.h>
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include "packet-bpv7.h"
|
||||
#include "epan/wscbor.h"
|
||||
#include <epan/packet.h>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
* https://www.bluetooth.com/specifications/mesh-specifications
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <epan/packet.h>
|
||||
#include <epan/prefs.h>
|
||||
#include <epan/expert.h>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
* https://www.bluetooth.com/specifications/mesh-specifications
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <epan/packet.h>
|
||||
#include <epan/prefs.h>
|
||||
#include <epan/reassemble.h>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
* https://www.bluetooth.com/specifications/mesh-specifications
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <epan/packet.h>
|
||||
#include <epan/prefs.h>
|
||||
#include <epan/expert.h>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
* https://www.bluetooth.com/specifications/mesh-specifications
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <epan/packet.h>
|
||||
#include <epan/prefs.h>
|
||||
#include <epan/reassemble.h>
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <epan/packet.h>
|
||||
#include "packet-knxip.h"
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
* for the specifications.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define WS_LOG_DOMAIN "packet-knxip"
|
||||
|
||||
#include <wsutil/file_util.h>
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <epan/packet.h>
|
||||
#include <epan/to_str.h>
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <epan/packet.h>
|
||||
#include <epan/exceptions.h>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#ifndef NDEBUG
|
||||
#define NDEBUG
|
||||
#endif
|
||||
#include "config.h"
|
||||
|
||||
#include "mate.h"
|
||||
#include "mate_grammar.h"
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "file.h"
|
||||
|
||||
#include <wiretap/wtap.h>
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <ui/rtp_media.h>
|
||||
#include <ui/tap-rtp-common.h>
|
||||
#include "rtp_player_dialog.h"
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <epan/epan_dissect.h>
|
||||
#include "epan/epan.h"
|
||||
#include "epan/column.h"
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "wireshark_file_dialog.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
|
@ -83,7 +83,7 @@ ws_regex_compile(const char *patt, char **errmsg)
|
|||
|
||||
|
||||
static bool
|
||||
match_pcre2(pcre2_code *code, const char *subj, gssize subj_size)
|
||||
match_pcre2(pcre2_code *code, const char *subj, ssize_t subj_size)
|
||||
{
|
||||
PCRE2_SIZE length;
|
||||
pcre2_match_data *match_data;
|
||||
|
@ -123,7 +123,7 @@ match_pcre2(pcre2_code *code, const char *subj, gssize subj_size)
|
|||
|
||||
|
||||
bool
|
||||
ws_regex_matches(const ws_regex_t *re, const char *subj, gssize subj_size)
|
||||
ws_regex_matches(const ws_regex_t *re, const char *subj, ssize_t subj_size)
|
||||
{
|
||||
ws_return_val_if_null(re, FALSE);
|
||||
ws_return_val_if_null(subj, FALSE);
|
||||
|
|
|
@ -23,7 +23,7 @@ WS_DLL_PUBLIC ws_regex_t *
|
|||
ws_regex_compile(const char *patt, char **errmsg);
|
||||
|
||||
WS_DLL_PUBLIC bool
|
||||
ws_regex_matches(const ws_regex_t *re, const char *subj, gssize subj_size);
|
||||
ws_regex_matches(const ws_regex_t *re, const char *subj, ssize_t subj_size);
|
||||
|
||||
WS_DLL_PUBLIC void
|
||||
ws_regex_free(ws_regex_t *re);
|
||||
|
|
Loading…
Reference in New Issue