From 4ff22025e83cfddb4cc1694dc0185133e157c899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Mon, 1 Nov 2021 08:47:42 +0000 Subject: [PATCH] README.developer: Add note about portability on Windows --- doc/README.developer | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/README.developer b/doc/README.developer index 65919d68ce..90089923dd 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -430,6 +430,16 @@ Wireshark uses Libgcrypt as general-purpose crypto library. To use it from your dissector, do not include gcrypt.h directly, but use the wrapper file wsutil/wsgcrypt.h instead. +We support building on Windows using MinGW-w64 (experimental) so be mindful +of the difference between an #ifdef on _WIN32 and _MSC_VER. The first tests +if the platform is some version of Windows and also applies to MinGW. The +latter tests if the toolchain is Microsoft Visual Studio. Sometimes you need +one or the other, depending on whether the condition applies to all Windows +compilers or only Microsoft's compiler. Use #ifdef __MINGW32__ to test for +a MinGW toolchain, including MinGW-w64. The same concern applies to CMake +code. Depending on the particular situation you may need to use if(WIN32) or +if(MSVC) or if(MINGW). + 2. String handling Do not use functions such as strcat() or strcpy().