Subject: [clisp-list] #include (was: now you can use the regexp module on MS-Windows)

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Wed Apr 3 12:10:30 2002

Sam Steingold wrote:
>are you sure this is necessary?  GNU Emacs does not have this special
>casing and it does work on win32.
Maybe compiling using gcc or cygwin? I don't have that there.

I'd like for somebody with more than the two hours experience of using MS-VC that I have (!) to comment on these portability issues.
I was really very pleased that compilation of CLISP went smooth, following win32msvc/INSTALL by the letter. Thanks to you all!

regex.c:
> + #ifdef _MSC_VER /* Microsoft VC */
> + #include <malloc.h>
> + #define alloca _alloca
>do I understand correctly that without this the MS regexp would use
>malloc/free instead of alloca?

Worse: If I remember what I did, linking lisp.exe complained about alloca being undefined -> no .exe. So I looked at how src/LISPBIBL.D declares it. Voila!

regexi.c (not part of GNU regex):
>   #include <sys/types.h> /* regex.h needs this */
> + #include <stdlib.h> /* declare malloc(), free() */
>   #include "regex.h"

If I remember correctly, size_t was not found.
Anyway, I think it's good practise to include system headers first.

Maybe one of these issues would disappear if I had compiled with -D STDC_HEADERS right from the beginning. I hope somebody else will confirm or deny these #define compatibility issues.

Regards,
	Jorg Hohle