Follow up on this after some serious head scratching...

At some point it appears cutil.c with its wrapper functions replaced usleep.c and this had not made it into the Windows make file. cutil.c uses the include file sleep.h which in turn does the macro translations necessary to implement the usleep function in a portable manner. With the make file updated with cutil.c in place of usleep.c the compile completes correctly under MinGW32 on windows.

I probably would have figured this out quicker but on my first glance of sleep.h I saw the leading # on every statement and went... hmmm, why is that commented out? It took about four more glances before I realized every statement was a directive and not commented out.

Sorry for any confusing that I caused.

73 de Bill ND0B


-----Original Message----- From: Joe Taylor
Sent: Monday, February 10, 2014 8:01 PM
To: WSJT Devel
Subject: Re: [Wsjt-devel] usleep.c

Bill --

Happy to learn that you have now been successful in compiling wsjt9.exe
in Windows.

To reduce likely confusion caused to others, I'll offer several brief
corrections to your note.

ND0B wrote:
usleep.c is a windows specific file (only built in windows make files)
that contains the stub function usleep_ (which is called by the
function usleep in cutils.c).   The intent was to be an interface
to the windows specific usleep function.

In fact, usleep_() is not called by usleep() -- it's the other way around.

The file usleep.c was never used together with anything in cutil.c, but
rather as a *replacement* for cutil.c.

All the functions in cutil.c, including usleep_(), are simply
fortran-callable wrappers for functions in the standard C libraries.

 I replaced the code within usleep.c with the following:

/* usleep(3) */
#include <windows.h>
int usleep_(unsigned long *microsec)
{
  Sleep((*microsec) / 1000L);
  return(0);
}

There are many ways to obtain the needed requirement for a "sleep()"
function with resolution of milliseconds or less.  The course adopted in
WSJT is portable across platforms (e.g., it works in Windows, Linux,
FreeBSD, and OS X).  The call to Sleep() is not portable.

-- 73, Joe, K1JT

-- 73, Joe, K1JT
_______________________________________________
Wsjt-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/wsjt-devel
_______________________________________________
Wsjt-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/wsjt-devel

Reply via email to