[Hat] Hat and Windows

Neil Mitchell ndmitchell at gmail.com
Tue Jun 27 06:10:57 EDT 2006


Hi,

Continuing on the "Hat on Windows" stuff I have now written hat-make,
which builds a program for Hat tracing on Windows. I'll send this over
once I have written a Windows makefile which builds the Hat stuff.

Attached is a patch to fix hat-c.c, and a new ntohl.h file to be added
in hat\include. Since ntohl.h is not available on Windows and is used
in a few of the Hat tools it makes sense to separate this off.

Thanks

Neil

On 6/26/06, Olaf Chitil <O.Chitil at kent.ac.uk> wrote:
> Neil Mitchell wrote:
>
> >
> > I've tried to get Hat compiling on Windows today, and have had some
> > success. I found the following problems and fixes:
>
> Sounds great. Neither Malcolm nor I know much about Windows. So it's
> great that you are getting Hat to work under Windows.
>
> Ciao,
> Olaf
>
> PS: Concerning Int vs Integer I agree with Malcolm that it would only
> partially solve the problem with the defaulting rule; I think changing
> all Integers to Int is a too complex hack for a too unclear gain. I
> hardly ever had problems with the defaulting rule (except for one-line
> test programs), but that probably depends a lot on the kind of programs
> one writes.
> _______________________________________________
> Hat mailing list
> Hat at haskell.org
> http://www.haskell.org/mailman/listinfo/hat
>
-------------- next part --------------

#if defined(WIN32)

/* Windows does not have ntohl, so define it here */
#define htonl(x) ntohl(x)

int ntohl(int x){
       int ret;
       unsigned char* pr = (unsigned char*) &ret;
       unsigned char* px = (unsigned char*) &x;

       pr[0] =px[3]; pr[1] = px[2]; pr[2] = px[1]; pr[3] = px[0];
       return ret;
}

#else

/* Unix does, so just use it */
#include <netinet/in.h>		/* for ntohl() macro */

#endif /* WIN32 */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hat-c.c.patch
Type: application/octet-stream
Size: 1693 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/hat/attachments/20060627/caf558dd/hat-c.c.obj


More information about the Hat mailing list