From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by hurricane.the-brannons.com (Postfix) with ESMTPS id C36197913E for ; Fri, 27 Jan 2017 11:01:47 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id r144so60302610wme.0 for ; Fri, 27 Jan 2017 11:02:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geoffair-info.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=3Mbtz84Oj3fSZk5/DsA3ZlyjqvU1BWtYJD+eYa6LcJc=; b=AsxUIuovt3gPgJZJuAkVizgKmvBkjVKuhDAKWAPydilSuDlzPnSShrL8K+J/df+Dkz /gRpCUdx2xiFn+4ZawWQeqofjlLazSFdJOQNGF43gXsiJC0NlOLFncNbudAXupZlP8LG yGGk4PQBt/PYPnVIWFbYM/LVcduFyTUZj3A5c/k3rb//nByo3DEONF4GUF299K4xM20N /o9xwrn+5R8NSOniDdz6UDIEAsO34P1O/5n9cYG07dh+24mOWfH6CMYZgWeTbkM8V82H Hwf2YuL1iwOYcMFUWDPFscvq/fzvkMHos20c4MSXqYgdhQ6YOEok/AawGLSZFnQVqTOW +oww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=3Mbtz84Oj3fSZk5/DsA3ZlyjqvU1BWtYJD+eYa6LcJc=; b=jXmd2oJYmJ91ZPXg85WJqudjU8uWsG2ymup5YBzyOY0SDjzYAvNelLrnbdHrRCnaYD k0mhKZ2ULP6t9qq+H9VtVdfG2o65kZYnPwjYoASs/ivPjKP28Mkg1EqJNozvXJpl9CsC zwxytU/jUctjxGD9Q9btFMigb0yaMO6tkUcNBDtyjfu8Zs0ucYch1EhibPyrwGkEiyu6 HSbFBBDSgVeQKEYGIXgCXqE5MMRKmG14+YUIh/IeOy5lBVoVwyBLQUJAHMHxXVenNI60 XSDoD2fy9lccj2B/OqgqzptkfUl0IAaBmj1+FVTIY6HzNAvzUGawLPgkefyoHQiIBWSe f6vw== X-Gm-Message-State: AIkVDXKZL5DF6lqOReK8guX5BwiD6vW330rfAOGwyN6YrYghQh8XSFP4miC+YPPDbvclNw== X-Received: by 10.223.143.48 with SMTP id p45mr8755127wrb.33.1485543751911; Fri, 27 Jan 2017 11:02:31 -0800 (PST) Received: from ?IPv6:2a01:cb04:4ba:c500:8a0:5a73:d86c:4e3b? (2a01cb0404bac50008a05a73d86c4e3b.ipv6.abo.wanadoo.fr. [2a01:cb04:4ba:c500:8a0:5a73:d86c:4e3b]) by smtp.googlemail.com with ESMTPSA id l10sm9309129wrb.44.2017.01.27.11.02.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jan 2017 11:02:31 -0800 (PST) To: Edbrowse-dev@lists.the-brannons.com From: Geoff McLane Message-ID: Date: Fri, 27 Jan 2017 20:02:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Edbrowse-dev] Windows MSVC140 build X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.23 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2017 19:01:48 -0000 Hi all, This is all about building edbrowse in Windows 10, in 32 and 64-bits... Some time back I retired my trusty MSVC10 (2010), downloaded MSVC14 (2015), and started to re-do each project... first in 32-bits... Unfortunately with edbrowse ran into a horrible warning, that I can not seem able to solve - main.c c:\program files (x86)\microsoft sdks\windows\v7.0a\include\sal_supp.h(57): warning C4005: '__useHeader': macro redefinition [F:\Projects\edbrowse-geoff\build\edbrowse.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\sal.h(2866): note: see previous definition of '__useHeader' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\specstrings_supp.h(77): warning C4005: '__on_failure': macro redefinition [F:\Projects\edbrowse-geoff\build\edbrowse.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\sal.h(2876): note: see previous definition of '__on_failure' This is a horrific warning, since as you can see it seems to be in 'system' header files - the MSVC14 include sal.h is incompatible with the microsoft sdks header sal_supp.h and specstrings_supp.h... bah! For now I have suppressed this warning 4005... but would always strive to avoid that suppression... I have googled around, and found it reported here and there, but none provided a solution yet... Does anyone have any ideas? There are still some dozen other msvc140 warnings... which I have left for now... But the main thing is I had to provide a few small fixes for some 'errors' that msvc140 exposed... At the moment I have only done fixes in my edbrowse-fork, while I test them further... and maybe refine them before finally adding them to edbrowse... The two main ones are in jseng-moz.cpp... in the function readFromEb() 1. Why is 'ssize_t rc;' used, instead of just 'int rc;'? Unfortunately `ssize_t` does not exist in WIN32. Alternatively could provide a define or typedef... but why not an 'int'? Maybe missing something here... 2. Why is '(short unsigned int *)uc_run' used instead of '(const jschar *)uc_run'? Which seems to be what the prototype of JS_EvaluateUCScript in jsapi.h... Again, am I missing something? The other important item is to define HAVE_STRUCT_TIMESPEC. For now I have just defined it in eb.h, but this could perhaps also be done in CMakeLists.txt... As stated, I will continue to test, and refine, but look forward to any further comments meantime... For the 64-bit build I need to also re-do and install libraries like mozjs-24.lib, and maybe others, in 64-bit msvc140 form... quite a pain... but will get there... Are there any others out there who do a Windows MSVC build? Current full patch below... Regards, Geoff. diff --git a/CMakeLists.txt b/CMakeLists.txt index df70164..16b0f16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,8 @@ if(WIN32) # C4101: 'idx' : unreferenced local variable # C4018: '>' : signed/unsigned mismatch # C4800: 'JSBool' : forcing value to bool - foreach(warning 4244 4101 4090 4018 4800) + # C4005: '__useHeader': macro redefinition + foreach(warning 4244 4101 4090 4018 4800 4005) set(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}") endforeach() set( MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS" ) diff --git a/build/build-me.bat b/build/build-me.bat index e5cc744..386f6a7 100644 --- a/build/build-me.bat +++ b/build/build-me.bat @@ -12,6 +12,12 @@ @set TMPINS=..\..\software @set TMPCM=%TMPSRC%\CMakeLists.txt @set DOPAUSE=pause +@set VCVERS=14 +@set GENERATOR=Visual Studio %VCVERS% + +pushd %TMPSRC% +@set TMPSRC=%CD% +popd @call chkmsvc %TMPPRJ% @@ -22,7 +28,7 @@ @if NOT EXIST %TMPCM% goto NOCM @set TMPLOG=bldlog-1.txt -@set TMPOPTS=-DCMAKE_INSTALL_PREFIX=%TMPINS% +@set TMPOPTS=-G "%GENERATOR%" -DCMAKE_INSTALL_PREFIX=%TMPINS% @REM 20151031 - Add OSBC support in WIN32 build @set TMPOPTS=%TMPOPTS% -DBUILD_EDBR_ODBC:BOOL=ON @@ -34,7 +40,7 @@ @goto RPT :GOTCMD -@echo Build %DATE% %TIME% > %TMPLOG% +@echo Build %DATE% %TIME% in %CD% > %TMPLOG% @echo Build source %TMPSRC%... all output to build log %TMPLOG% @echo Build source %TMPSRC%... all output to build log %TMPLOG% >> %TMPLOG% diff --git a/src/eb.h b/src/eb.h index 8cdc3e7..78ec2f2 100644 --- a/src/eb.h +++ b/src/eb.h @@ -25,6 +25,12 @@ #define _GNU_SOURCE #endif +#ifndef HAVE_STRUCT_TIMESPEC +#if defined(_MSC_VER) && (_MSC_VER >= 1900) +#define HAVE_STRUCT_TIMESPEC +#endif +#endif // HAVE_STRUCT_TIMESPEC + /* seems like everybody needs these header files */ #include #include diff --git a/src/jseng-moz.cpp b/src/jseng-moz.cpp index bd276f5..5c411a3 100644 --- a/src/jseng-moz.cpp +++ b/src/jseng-moz.cpp @@ -194,7 +194,7 @@ int js_main(int argc, char **argv) static void readFromEb(void *data_p, int n) { - ssize_t rc; + int rc; unsigned char *bytes_p = (unsigned char *)data_p; if (n == 0) return; @@ -2478,7 +2478,7 @@ static void processMessage(void) head.n = 0; head.proplength = 0; if (JS_EvaluateUCScript - (jcx, parent, (short unsigned int *)uc_run, uc_len / 2, + (jcx, parent, (const jschar *)uc_run, uc_len / 2, "foo", head.lineno, v.address())) { if (v != JSVAL_VOID) { s = 0;