FYI,

The functions wcsnlen and wcsncpy_s are not used anywhere
in fossil code, they are only used within dirent.h.

Therefore, forwarded to Toni Rönkkö, for suggestions what
to do with it. Is it worth to fix it?

Regards,
          Jan Nijtmans

---------- Forwarded message ----------
From: Konstantin Khomoutov <flatw...@users.sourceforge.net>
Date: 2012/12/1
Subject: [fossil-users] Trunk not buildable with MSVC 6.0 (was: Fossil
version 1.25 scheduled.)
To: Fossil SCM user's discussion <fossil-users@lists.fossil-scm.org>


On Fri, 30 Nov 2012 16:16:01 -0500
Richard Hipp <d...@sqlite.org> wrote:

> I have put up a change log for Fossil version 1.25 with a tentative
> release date of 2012-12-19
>
>     http://www.fossil-scm.org/fossil/doc/trunk/www/changes.wiki
>
> There has been a *lot* of change since 1.24.  Please test the trunk
> version of Fossil as you are able to.  Report any issues to this
> mailing list, or file a ticket.  We want 1.25 to be a good release,
> but we need your help in testing in order to accomplish that.

Not buildable by MSVC 6.0 compiler as it started do depend on certain
wide-character string functions from newer versions of MSVC runtime.

After I've added two trivial workarounds to win\include\dirent.h
and src\cgi.c to make them compile, I've finally arrived at these
complaints from the linker:

LINK : warning LNK4049: locally defined symbol "_malloc" imported
LINK : warning LNK4049: locally defined symbol "_free" imported
rebuild.obj : error LNK2001: unresolved external symbol _wcsnlen
vfile.obj : error LNK2001: unresolved external symbol _wcsnlen
rebuild.obj : error LNK2001: unresolved external symbol _wcsncpy_s
vfile.obj : error LNK2001: unresolved external symbol _wcsncpy_s

The first two warnings are of unknown importance, but the error
messages that follow indicate two unresolved externals: wcsnlen and
wcsncpy_s.

I'm not sure if this worth fixing or not.
It seems that official Win32 builds are done using MinGW, and while it
links against the same old msvcrt.dll as MSVC 6.0 does it suppsedly
provides its own implementations of those missing functions and hence
official Win32 builds will supposedly remain as much portable as before
the new dependencies have been introduced.

I've attached the patch which fixes dirent.h and cgi.c in case someone
will find it useful.

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Index: src/cgi.c
==================================================================
--- src/cgi.c
+++ src/cgi.c
@@ -21,10 +21,11 @@
 ** formatting function and its cousins, and routines to encode and
 ** decode strings in HTML or HTTP.
 */
 #include "config.h"
 #ifdef _WIN32
+# include <winsock2.h>
 # include <ws2tcpip.h>
 #else
 # include <sys/socket.h>
 # include <netinet/in.h>
 # include <arpa/inet.h>

Index: win/include/dirent.h
==================================================================
--- win/include/dirent.h
+++ win/include/dirent.h
@@ -105,10 +105,18 @@
 #include <errno.h>
 
 /* Windows 8 wide-character string functions */
 #if (_WIN32_WINNT >= 0x0602)
 #   include <stringapiset.h>
+#endif
+
+/*
+ * errno_t is Microsoft-ism, MSVC 6.0 does not define it,
+ * MSVC 8.0 defines it as int, and that's what the standard says.
+ */
+#ifndef errno_t
+typedef int errno_t;
 #endif
 
 /* Entries missing from MSVC 6.0 */
 #if !defined(FILE_ATTRIBUTE_DEVICE)
 # define FILE_ATTRIBUTE_DEVICE 0x40

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to