From: Jonathan Brandmeyer <jbrandmeyer@ea...> - 2002-12-29 20:46:49
> From: "John Conner" <conner_john@...>
> To: mingw-users@...
> Date: Sun, 29 Dec 2002 01:19:37 +0000
> Subject: [Mingw-users] porting from linux to win32
> I have a program working under Linux and am now trying to make it cross
> compilable under windows in a dll. I have been able to get everything to
> compile and link except for three functions.
> The first two are ntohl and ntohs. It looks like these are defined in
> winsock.h & winsock2.h however I have not been able to get them to link. I
> receive a 'undefined reference to ntohl@...' error message during linkage.
> I am using gcc 3.0 under cygwin for the compilation. I am using flags
> -mno-cygwin -mms-bitfields for compile/link which I'm assuming is using the
> mingw libraries.
> The last function I am using under linux is gettimeofday(). Is there a
> similar method to use under windows?
> Thanks in advance for any porting tips,
If the program is using gettimeofday as a stopwatch, you can use the
Win32 high-performance counter. QueryPerformanceFrequency will tell you
the resolution of the high-performance counter, if available, in ticks
per second. Calls to QueryPerformanceCounter will get the time in
ticks. Then you must convert the difference in tick counts to something
usable in microseconds (or whatever) based on QueryPerformanceFrequency.
For reference, my P3 800 counter has a resolution of about .279
From: Luke Dunstan <coder_infidel@ho...> - 2002-12-30 06:21:09
----- Original Message -----
From: "Greg Chicares" <chicares@...>
To: "Wu Yongwei" <adah@...>; "mingw-users"
Sent: Monday, December 30, 2002 12:21 PM
Subject: Re: [Mingw-users] porting from linux to win32
> Wu Yongwei wrote:
> > http://mywebpage.netscape.com/yongweiwu/timeval.h.txt
> #ifndef __GNUC__
> #define EPOCHFILETIME (116444736000000000i64)
> #define EPOCHFILETIME (116444736000000000LL)
> Is 'i64' a __GNUC__ thing, or a __MINGW32__ thing?
Note that the conditional is "ifndef", suggesting that "i64" is for Windows
compilers other than GCC, probably MSVC.