Commit Graph

13 Commits

Author SHA1 Message Date
Guy Harris db27fb777a exceptions: make the exception handler stack per-thread.
This prevents the weird failures I saw on macOS in #17856; instead, it
should fail on *all* platforms with

    Unhandled exception ("epan/proto.c:8800: failed assertion "DISSECTOR_ASSERT_NOT_REACHED"", group=1, code=6)

(which it does on macOS 11.6/Xcode 12.5.1 and Windows 10/VS 2019
16.11.8; according to

https://en.wikipedia.org/w/index.php?title=Thread-local_storage&oldid=1064900318#C_and_C++

the major UN*X C compilers support __thread and the major Windows C
compilers support __declspec(thread).).

@jvalverde: on branches that require C11/C++11 support, we could perhaps
just use _Thread_local for C and thread_local for C++.  Note that
<thread.h> is optional in C11, and macOS 11.6/Xcode 12.5.1 does not
appear to include it.)

This does not *fix* the aforementioned issue; to do *that* we need to do
TRY in the register-dissectors thread code.  I'm committing this
separately because it fixes a bug in our exception package that could
cause all sorts of randomness now and in the future - what we're doing
now is Just Wrong.

(Yes, there's code to support per-thread exception handler stacks *on
platforms with pthreads*, but this is simpler *and* also works on
Windows.)
2022-01-11 05:00:42 +00:00
João Valverde 60533a55ff wslog: Add WS_DEBUG_HERE() macro
Add a LOG_LEVEL_ECHO that is always active and always non-fatal.

Use that to implement a WS_DEBUG_HERE() macro for quick print outs
during debugging sessions.
2021-12-29 15:21:46 +00:00
João Valverde 9a52634c5f Add ws_version.h to wireshark.h 2021-12-21 23:00:04 +00:00
João Valverde 4448b6494e Add a ws_posix_compat.h header
Currently used to define ssize_t on platforms that lack it.

Fix some Windows build errors caused by moving the definition into a
separate header.

Fix some narrowing warnings on Windows x64 from changing the definition
of ssize_t from long int to int64_t.

The casts in dumpcap are ugly but necessary. The whole code needs
to be rewritten for portability, or the warnings disabled.
2021-12-21 01:30:06 +00:00
João Valverde 64c0e166d1 Add string.h to wireshark.h
Wireshark development requires handling strings a lot. Add this
standard header to the base environment to avoid unnecessary repetition.
2021-12-18 20:28:54 +00:00
João Valverde f19c18a299 Add wmem.h to wireshark.h
Wmem is an alternative to GLib data structures so it should
have the same scope and be equally as convenient to use.

Wmem does not and cannot depend on anything else other than
GLib.
2021-12-18 20:28:54 +00:00
João Valverde d443197097 Prefer the portable _Noreturn attribute (C11)
Use _Noreturn, available with C11, instead of vendor specific
attributes. It's not compatible with C++ so we we must keep
the old code for now.
2021-12-18 18:54:08 +00:00
João Valverde 64e8a2817e Add wsutil/glib-compat.h to wireshark.h
We are already adding glib.h, we should include glib-compat.h
as well in the base environment.
2021-12-17 19:34:54 +00:00
João Valverde 689976477a Add inttypes.h to wireshark.h
For convenience, having to add this header constantly is annoying
and kind of pointless, now that we are relying more on stdio.h.
2021-12-17 19:34:54 +00:00
João Valverde cef5e81146 Define more log domains for extcaps 2021-12-05 00:28:26 +00:00
Moshe Kaplan 1c3a9af869 Add files with WS_DLL_PUBLIC to Doxygen
Add @file markers for most files that
contain functions exported with
WS_DLL_PUBLIC so that Doxygen will
generate documentation for them.
2021-11-29 21:27:45 +00:00
João Valverde 9bdccce574 More workarounds for Debian 2021-11-14 21:00:59 +00:00
João Valverde ca06d7e4fe Add an include sub-directory to the tree
Blind attempt to fix Debian package brokenness managing
headers separately from install rules.

Global public headers that don't fit any of the Wireshark
libraries should be placed in include/.

Eventually the C files in the root dir should be placed somewhere
else as well (like src/) but this is not a priority.

Fixes #17726.
2021-11-12 17:33:13 +00:00