From 7fe9868f396baa636a8c4fea5eb3c24af2669b96 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 3 Apr 2019 12:09:01 +0200 Subject: [PATCH] Add Windows project files and two fixes - make in_p const - adjust path of slurp.hh for Windows builds TODO: implement Windows alternatives for random, timegm and tm.tm_zone --- build-windows/pEpMIME.vcxproj | 199 ++++++++++++++++++++++++++ build-windows/pEpMIME.vcxproj.filters | 143 ++++++++++++++++++ src/to_utf8.cc | 2 +- src/unittest_mime.cc | 4 + 4 files changed, 347 insertions(+), 1 deletion(-) create mode 100644 build-windows/pEpMIME.vcxproj create mode 100644 build-windows/pEpMIME.vcxproj.filters diff --git a/build-windows/pEpMIME.vcxproj b/build-windows/pEpMIME.vcxproj new file mode 100644 index 0000000..3ea5fec --- /dev/null +++ b/build-windows/pEpMIME.vcxproj @@ -0,0 +1,199 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {A6FA4848-3D26-44A3-A305-EFE6D1CB57DF} + Win32Proj + pEpMIME + 10.0.17763.0 + + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + NotUsing + Level3 + Disabled + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + $(SolutionDir);$(SolutionDir)Dependencies;$(SolutionDir)Dependencies\libiconv\include;%(AdditionalIncludeDirectories) + + + Windows + true + + + + + Use + Level3 + Disabled + true + _DEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + NotUsing + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + $(SolutionDir);$(SolutionDir)Dependencies;$(SolutionDir)Dependencies\libiconv\include;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build-windows/pEpMIME.vcxproj.filters b/build-windows/pEpMIME.vcxproj.filters new file mode 100644 index 0000000..b4051b3 --- /dev/null +++ b/build-windows/pEpMIME.vcxproj.filters @@ -0,0 +1,143 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {1c937d85-9b48-46c0-8251-f317745f7b0a} + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + scripts + + + \ No newline at end of file diff --git a/src/to_utf8.cc b/src/to_utf8.cc index bcdb5d7..7f22d29 100644 --- a/src/to_utf8.cc +++ b/src/to_utf8.cc @@ -83,7 +83,7 @@ std::string to_utf8_iconv(const sv& charset, const std::string& s) ret.reserve(s.size()); char buffer[ IconvBufSize ]; - char* in_p = const_cast(s.c_str()); // iconv sucks. + const char* in_p = const_cast(s.c_str()); // iconv sucks. size_t in_len = s.size(); while(in_len) diff --git a/src/unittest_mime.cc b/src/unittest_mime.cc index 1295c65..985e435 100644 --- a/src/unittest_mime.cc +++ b/src/unittest_mime.cc @@ -1,6 +1,10 @@ #include "pEpMIME.hh" #include "base64.hh" +#ifdef WIN32 +#include +#else #include +#endif #include #include