Wireshark-dev: [Wireshark-dev] Building Wireshark with MSVC6 gives error in 'packet-nasdaq-itch

From: "Speck, Michael" <Michael.Speck@xxxxxxx>
Date: Wed, 17 Dec 2008 10:09:02 +0100
Hi.

I've just downloaded latest sources from SVN. Then I tried building it
on Windows XP using MSVC6.

Calling 'make all' (after 'make distclean' and 'make setup') gives
following error:

	cl -DWIN32 -DNULL=0 -D_MT -D_DLL -WX -DHAVE_CONFIG_H /I. /I..
/I../.. /ID:\openSource\wireshark-win32-libs\glib\include\glib-2.0
/ID:\openSource\wireshark-win32-libs\glib\lib\glib-2.0\include
/ID:\openSource\wireshark-win32-libs\zlib123\include
/ID:\openSource\wireshark-win32-libs\pcre-7.0\include
/ID:\openSource\wireshark-win32-libs\gnutls-2.6.3-1\include /DNOCRYPT
/ID:\openSource\wireshark-win32-libs\kfw-2.5\inc
/ID:\openSource\wireshark-win32-libs\WPdpack\include -D_U_="" /Zi /W3
/MD /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1200 -Fd.\ -c
packet-nasdaq-itch.c 
packet-nasdaq-itch.c
packet-nasdaq-itch.c(259) : error C2520: conversion from unsigned
__int64 to double not implemented, use signed __int64



The erroneous line reads:
      gdouble value = nasdaq_itch_atoull(str_value,
size)/((big)?1000000.0:10000.0);

Looking at function 'nasdaq_itch_atoull()' shows, that this function
returns a guint64.


How to solve this?
I do not know nasdaq-itch protocol, so I cannot say if it is better to
make nasdaq_itch_atoull() returning a signed int64 (gint64) as compiler
suggests or it it would be more reasonable to do a implicit typecast in
line 259? 

Attached you'll find patches for both possibilities. Solution 1 does a
implicit typecast, solution 2 changes return value of the function. Both
could be compiled without errors on my machine.



best regards
Mike



PS:
There seems to be some more errors in latest sources, preventing from
building wireshark with MSVC6:
	version_info.c(410) : error C2065: 'VER_NT_WORKSTATION' :
undeclared identifier 
I haven't had a deeper look at this so far.

Attachment: packet-nasdaq-itch.solution_1.patch
Description: packet-nasdaq-itch.solution_1.patch

Attachment: packet-nasdaq-itch.solution_2.patch
Description: packet-nasdaq-itch.solution_2.patch