summaryrefslogtreecommitdiff
path: root/wsutil
AgeCommit message (Collapse)AuthorFilesLines
2015-01-30Disable SSE4.2 _ws_mempbrk_sse42 only for older Apple compilersHadriel Kaplan1-3/+13
This is a longer term fix to disable _ws_mempbrk_sse42 in older Apple compilers, which the buildbots currently use. This fix is the longer-term fix for the temprorary one introduced in g9a366b04/I2e438ff29. Bug: 10798 Change-Id: I051ca003610c07f7d75cc19b20ff823fe4c1ce05 Reviewed-on: https://code.wireshark.org/review/6851 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-29Disable SSE4.2 _ws_mempbrk_sse42 due to bug 10798Hadriel Kaplan1-0/+3
This is a (possibly) temporary change to master to disable _ws_mempbrk_sse42 to see if that fixes bug 10798. Ping-Bug: 10798 Change-Id: I2e438ff299f55709c66a37634d2a7e799c513ac9 Reviewed-on: https://code.wireshark.org/review/6844 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-01-28win32: fix detection of Windows 10 Technical PreviewPascal Quantin1-2/+20
The version number changed from 6.4 to 10.0 Change-Id: Ie749c97e8335f77d414d80edbd69373bd9a1cdad Reviewed-on: https://code.wireshark.org/review/6820 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-25Replace "GIT" with "VCS" in make-version.pl and files it manipulates.Guy Harris1-2/+2
That makes it more VCS-neutral - apparently some people maintain private versions under VCSes other than Git, and make-version.pl still handles those VCSes. Change-Id: Ie4914b16fea8ce800582729260c5e9b9cf1111f4 Reviewed-on: https://code.wireshark.org/review/6779 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-21Also support -xarch=sse_42 in the Sun C compiler for x86(-64).Guy Harris1-7/+12
Change-Id: Ib6d0ae9c237b96568e2522d2077b311b3ac5af2e Reviewed-on: https://code.wireshark.org/review/6706 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-21Always set the COMPILE_FLAGS property, so we can always fetch it.Guy Harris1-0/+10
If we aren't adding -Werror, just set it to a null string, so when we fetch it to add the SSE 4.2 flag to it for ws_mempbrk_sse42.c, it doesn't fail. Change-Id: I53858130c025e094ed8d0d975451961506fb1a39 Reviewed-on: https://code.wireshark.org/review/6704 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-21Don't set SSE4_2_FLAG to -msse4.2 unless -msse4.2 works.Guy Harris1-1/+3
Change-Id: I54eca86d53dc0e4015a15491b9adfdfe9ef9e346 Reviewed-on: https://code.wireshark.org/review/6703 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-21Check whether we can use nmmintrin.h.Guy Harris1-22/+33
If we think the compiler supports SSE 4.2, check whether we can use nmmintrin.h if we tell the compiler to compile with SSE 4.2 support; if not, disable SSE 4.2 support. This matches what we do in autotools. Change-Id: I474d53d2fe7e2628faca7309efd7155b63bd7eab Reviewed-on: https://code.wireshark.org/review/6702 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-21Only turn -msse4.2 on for ws_mempbrk_sse42.c, and don't always build it.Guy Harris1-3/+23
Move all the SSE 4.2 stuff to wsutil/CMakeLists.txt. Don't put ws_mempbrk_sse42.c in WSUTIL_FILES by default; add it if we think the compiler supports compiling for SSE 4.2. Add -msse4.2 to its COMPILE_FLAGS, but don't add it to any other compiler flags - we don't want to build anything else with -msse4.2 by default, as the only code that uses SSE 4.2 instructions but *only* does so if the processor supports it is our mempbrk implementation. (And *add* it, don't *replace* the existing flags with -msse4.2; that way, -Werror is left in there as well.) Change-Id: I979b37a37e4b88b3af11e2275e89441118c8ce0a Reviewed-on: https://code.wireshark.org/review/6698 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-20CMake: Set an output directory for plugins.Gerald Combs1-5/+5
Redefine PLUGIN_DIR similar to DATAFILE_DIR and use it on all platforms. Add WiresharkPlugin.cmake so that we can start defining common macros for plugins/*/CMakeLists.txt. Load plugins in out-of-tree builds. Change-Id: I8c1359ed3cf8a71788b8320ff89dfe2d3969def2 Reviewed-on: https://code.wireshark.org/review/6640 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-13Consistently use the "g_string_free returns a C string pointer" idiom.Guy Harris1-2/+1
g_string_free(str, FALSE) frees the GString container but not the underlying g_malloc()ed string; instead, it returns a pointer to the g_malloc()ed string. Fix those places that didn't already get the string pointer from g_string_free() to do so rather than manually extracting the string themselves. And fix one place that didn't even need to use a string - it was just scanning a C string without even modifying it. Change-Id: Ibbf4872bf5b9935b9907f539b6edb1013f3053a5 Reviewed-on: https://code.wireshark.org/review/6532 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-11Fix CMake generation and use of Windows .rc filesGraham Bloice1-1/+1
CMake now generates local copies of .rc files for all the Windows components and uses the files in the build of the components. The .rc.in files that include an icon were modified to allow the icon path to be set by CMake. The path is removed for nmake builds. Updated build architecture detection, required for wireshark.manifest.in Change-Id: I7b1ff43050e9b0efb861d1041636fb4aef49a4f8 Reviewed-on: https://code.wireshark.org/review/6482 Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2015-01-05Minor CMake updates to better group build artefactsGraham Bloice1-1/+1
Move capchild, caputils, codecs and wsutil into a Libs group Move gtkui into UI group Move update-sminmpec into tools group Change-Id: Iaf2bfe4697265af2c3ed9c9d7de2d5d1ef3cafee Reviewed-on: https://code.wireshark.org/review/6332 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Graham Bloice <graham.bloice@trihedral.com>
2015-01-02Add back "version.h" inclusionPascal Quantin1-0/+2
It got removed by the automatic include cleaning scripts Also add it to text2pcap.c as it is used to get the version when writing a pcapng file Change-Id: I3d56985fa1d04bcb066fe015a588c24cf3cb7267 Reviewed-on: https://code.wireshark.org/review/6248 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-02Add '*.nativecodeanalysis.xml' to 'clean' targetsBill Meier1-1/+1
Change-Id: I90dbf0b31fc737150a01533763a7869b34c68cb6 Reviewed-on: https://code.wireshark.org/review/6220 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-01Welcome in 2015Pascal Quantin1-1/+1
Change-Id: Ib581b9383b211ea8dbcea1cadf98a2b8c3548ab5 Reviewed-on: https://code.wireshark.org/review/6204 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-31Use setlocale() to get the current locale.Guy Harris1-6/+18
This: 1) should work on Windows; 2) reflects what the C environment is actually set up to use, rather than what the environment variables for locale are set up to use - C programs default to the C locale and only pick up the setting from the environment variables etc. if you explicitly request the system locale with a setlocale() call. Change-Id: Iee064237e70501a5450d4daa9ab849391f200efd Reviewed-on: https://code.wireshark.org/review/6195 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31Swallow get_glib_version_info() into get_compiled_version_info().Guy Harris1-18/+9
It's not that complicated, so we might as well just do it in line. Change-Id: I10809db554e668a853d28e7dca48b2de0ed51ad3 Reviewed-on: https://code.wireshark.org/review/6190 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31"#else", not "#elif", for the last part of a chain of conditionals.Guy Harris1-2/+24
Also give more details, for future reference, on how to determine whether the processor supports CPUID. Change-Id: I01e7173e45b0079f02338e51248238c05302dbd2 Reviewed-on: https://code.wireshark.org/review/6189 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31ws_cpuid() returns a success/failure indication; make it gboolean.Guy Harris1-10/+10
Change-Id: I03403ce29c4ac343d56fc2cf33aa8da90a082cbb Reviewed-on: https://code.wireshark.org/review/6185 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31Distinguish between IA-32 and non-x86.Guy Harris1-3/+9
In case we make ws_cpuid() work on IA-32 processors, add a separate "always returns no" version of ws_cpuid() for non-x86 processors. Change-Id: Id6fbd3e5c7d4f04063bc9bcd8f1644cd617b297e Reviewed-on: https://code.wireshark.org/review/6184 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31Move some routines into ws_version_info.c.Guy Harris11-492/+153
The routines to get compiler, GLib version, CPU, and memory info are used only in routines in ws_version_info.c; move them into ws_version_info.c and make them static. Change-Id: I58edd18da3301095012d2c7a3c5198e5a7073964 Reviewed-on: https://code.wireshark.org/review/6183 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31Do the full string in get_{compiled,runtime}_version_info().Guy Harris2-24/+46
Have them start the string with "Compiled" or "Running on", and return the string when done. Change-Id: Ic4d290c963621fa0385dc5aab766fd4ad31d3810 Reviewed-on: https://code.wireshark.org/review/6155 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31Move the version_info.c stuff to wsutil/ws_version_info.c.Guy Harris2-1/+135
Change-Id: I3a5c7e219974bfb924819b43b4d445eaf00e5bde Reviewed-on: https://code.wireshark.org/review/6153 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-29Restore string.h to os_version.cMartin Mathieson1-0/+1
Change-Id: I810a38c56829d5d3beaccc0171fc76f26ad79b52 Reviewed-on: https://code.wireshark.org/review/6108 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-29Add back string.h to sha1.c and sober128.cMartin Mathieson2-0/+2
Change-Id: Idd8963717eab804f7d76652d1baf029be8b5997f Reviewed-on: https://code.wireshark.org/review/6105 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-29Restore string.h to md4.cMartin Mathieson1-0/+1
Change-Id: I1a2c57ea20bcb1fd22c0379f3f43d3589e497c1b Reviewed-on: https://code.wireshark.org/review/6104 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-29Add string.h back to rc4.cMartin Mathieson1-0/+1
Change-Id: Idea9369742373e4a50edb3f391bdabfeeb3a2ca7 Reviewed-on: https://code.wireshark.org/review/6103 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-29Add back string.hMartin Mathieson1-0/+1
Change-Id: Ia61c72c7e8d1ef92ec5a38d534620fc225eef365 Reviewed-on: https://code.wireshark.org/review/6102 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-28Add a couple of more needed includesMartin Mathieson2-1/+2
Change-Id: Ie160f81544c6c9b381078b555e91602617cb2700 Reviewed-on: https://code.wireshark.org/review/6101 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-28Restore string.h as OS X misses it for strlen()Martin Mathieson1-0/+1
Change-Id: If1a968d54eed97fae915b8546d8d7a65a56b82db Reviewed-on: https://code.wireshark.org/review/6100 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-28Deleting unnecessary #includes from wsutil.Martin Mathieson23-34/+1
Will look at cleaning up and committing script afterwards. Change-Id: Id785e581740ab62fe9258ecfcb0926761ad9c527 Reviewed-on: https://code.wireshark.org/review/6086 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-28Removed duplicated #include linesDario Lombardo2-2/+0
Change-Id: I9cafa3cd5c74121168777d8c656e7e94e89efd3c Reviewed-on: https://code.wireshark.org/review/6065 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-25Check for getopt_long(), not getopt().Guy Harris1-1/+1
We support three types of platforms: 1) UN*Xes that have both getopt() and getopt_long(); 2) UN*Xes that have getopt() but not getopt_long(); 3) Windows, which has neither. Checking for getopt_long() lets us distinguish between 1) and 2) and build getopt_long() for them. Change-Id: Iaf0f142f9bebaa2eed2128d544ec9786711def45 Reviewed-on: https://code.wireshark.org/review/6045 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-25Include some files based on whether the functions they define are present.Guy Harris1-3/+12
Rather than including wsgetopt.c, inet_aton.c, and strptime.c iff we're building for Windows: include wsgetopt.c iff we don't have getopt(); include inet_aton.c iff we don't have inet_aton(); include strptime.c iff we don't have strptime(). Change-Id: Ibd68306ac372a4ae102c3220a94cdf6ecb04e58c Reviewed-on: https://code.wireshark.org/review/6044 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-24Don't use extra variables for ws_mempbrk_sse42.c and popcount.cGuy Harris1-14/+8
Instead, just add to WSUTIL_FILES as necessary. Change-Id: Iecadbd9a66ec54ee5d90aecfbfe5e636ae56e27e Reviewed-on: https://code.wireshark.org/review/6043 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-24Move twelve show_version() functions from the varoius programs andStephen Fisher2-0/+20
Wireshark UI files into a single one in wsutil. Change-Id: I0a64f0cc8106bd681bd185289c36272c4c43baad Reviewed-on: https://code.wireshark.org/review/6026 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-23Cmake: check for popcount, and build it from wsutil/popcount.c if missing.Guy Harris1-0/+7
Change-Id: Id646a9f0b1fc6acafa99a78725e3f0ec8a48c170 Reviewed-on: https://code.wireshark.org/review/6006 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-23Try to fix Windows build for popcount() unresolved external symbolStephen Fisher1-0/+1
Change-Id: Ie154caa1967ce4016dd52eefcf757e2e58d7ac68 Reviewed-on: https://code.wireshark.org/review/6005 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-23Move popcount() to an optionally built part of wsutil for systems thatStephen Fisher3-0/+77
provide their own popcount(). Change-Id: Ic26f3b50cf0bd2b4af0d42e9c27488ebbac1ab33 Reviewed-on: https://code.wireshark.org/review/5998 Petri-Dish: Stephen Fisher <sfisher@sdf.org> Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-22Fix unknown command tag name [-Wdocumentation-unknown-command]Alexis La Goutte1-1/+2
Change-Id: I6c2564a86e13d9321001856ba1f51681a9f20976 Reviewed-on: https://code.wireshark.org/review/5979 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-12-20Don't bother with __builtin_floorl().Guy Harris1-11/+0
At least as I read the GCC documentation, if GCC supports a builtin floorl() at all, it will always treat floorl() and __builtin_floorl() the same (it's reserved in C90 and defined in C99, so nobody should ever write C code assuming floorl() won't be treated in that afshion). In addition, the GCC 3.3.6 manual says nothing about __builtin_floorl(), so it probably won't help to use it. If it appears to help, there's probably something else going on. Also, GCC appears not to like "#ifdef (__GNUC__)", as the parentheses mean it's testing an expression, not a macro name. Change-Id: Ib88b52c366d7f3b1637bb408fb18d04b67c27e4b Reviewed-on: https://code.wireshark.org/review/5909 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20Include <math.h> to declare floor().Guy Harris1-0/+2
Change-Id: I39de31c3e38b83aaec76396048e6960f609bc63e Reviewed-on: https://code.wireshark.org/review/5907 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20Remove trailing white space.Guy Harris2-2/+2
Change-Id: I0777945a5234cf380e2f3bc2461cc638c316f499 Reviewed-on: https://code.wireshark.org/review/5906 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20Rename wsutil/floor.[ch] to wsutil/floorl.[ch].Guy Harris3-7/+7
That better indicates what they do - they don't supply floor(), as that's a standard math.h feature dating back before C89, they supply floorl(). Change-Id: Ib1278c51cdfc57680c28c51de87eafb2cb50c8eb Reviewed-on: https://code.wireshark.org/review/5905 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20If we don't have GCC, fall back on using floor().Guy Harris1-2/+10
Add the closing brace for the function body while we're at it. Change-Id: I73170fdc0885972dce531b553ff8601cceea182e Reviewed-on: https://code.wireshark.org/review/5902 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20Handle floorl() the same way we handle other not-on-all-platforms functions.Guy Harris2-4/+11
Use AC_CHECK_FUNC() for it, define FLOORL_LO to floorl.lo if we *don't* have it, add FLOORL_LO to the list of items conditionally built in libwsutil, and include "wsutil/floor.h" only if HAVE_FLOORL is *not* defined, as that means it's *not* supplied by the platform and thus *not* declared in <math.h>. Also, use the standard export stuff in wsutil/floor.h. Change-Id: Ic24aa69f65f2d15450d8b84b0c2b0c58f38edebe Reviewed-on: https://code.wireshark.org/review/5901 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20Include floor.c and floor.h in the source tarball.Guy Harris1-0/+2
Change-Id: Iabc0403643a05eaa7dbd525a94bc720d100d54d5 Reviewed-on: https://code.wireshark.org/review/5899 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20Another missing changeStephen Fisher1-2/+1
Change-Id: Icaaaeda75f411ecc7cf3027440c8af2b85021be3 Reviewed-on: https://code.wireshark.org/review/5897 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-19Add missing files from last commitStephen Fisher2-0/+70
Change-Id: I4a6dd1b60893d19b91f5bc0f85be9ee99cd3eb5e Reviewed-on: https://code.wireshark.org/review/5892 Reviewed-by: Stephen Fisher <sfisher@sdf.org>