DCC version 1.2.34 (really WIN32 building)

Carl Stehle webmaster@instantservers.com
Thu Mar 11 23:56:56 UTC 2004


> > 'nmake' does not like the '!include ...' line, and perhaps other things.
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcepb40/html/_wcepb_using_a_mak_file_for_preprocessing.asp
> seems to say that nmake knows about !include
> Does it want double quotes?
> Or to not have the .mak suffix explicit?
> 
> With -N, the Borland `make` doesn't like my hack for the equivalent of
>     clean clobber:
>             for nm in dir1 dir2 dir3; do \
>                 cd $nm; make $@; cd ..
>             done
> 

Yes, 'nmake' does know about '!include'; I've been away from 'make'
for a while...

- nmake does not know about '.AUTODEPEND'
  [perhaps '(n)make -a' can be used]

- nmake does not know about '$&' in the 'SMAKE' line
  [($*B) may work -- current target base file name minus extension]
  
- nmake has some problems with the 'clean clobber' clause, which
  I am still trying to unravel

> > I am trying to use purely MSVC tools.
> 
> That's a reasonable goal, but the main design goal must be to work
> with the Borland tools.  The Borland tools have the major feature
> of being free.

Yes indeed; but it is quite close to working with MSVC as well.

> 
> > > How is gethostbyname() declared in the Microsoft SDK?
> >
> > gethostbyname() is declared exactly as above.
> > Also, from winsock2.h:
> > #define WSAAPI                  FAR PASCAL
> >
> > The documentation states that 'PASCAL' is now obsolete.
> > Looks like backward compatibility to me.
> >
> > But I think the problem is not in the declaration of
> > gethostbyname() but rather in the declaration of 'fnc' ...
> 
> Without WSAAPI in the declaration of the formal parameter 'fnc', the
> Borland compilers complain that the actual parameter gethostbyname()
> does not match the prototype.
> 
> > apparently masked the fact that this did not work. So, I do not
> > see a way around an MSVC-specific preprocessor switch to declare
> > __stdcall as the calling convention used with 'fnc'.
> 
> I've currently got this in include/dcc_defs:
> 
>     #ifndef WSAAPI
>     #define WSAAPI __stdcall            /* for MSVC */
>     #endif
> 
> That leaves the Borland definition unmolested and works around
> the bug in the Microsoft SDK.  (I don't see how the Microsoft
> compiler's behavior can be justified given the declaration you say
> it has for gethostbyname().)
> 

I think we are saying the same thing about WSAAPI; both compilers
define it similarly and the above #ifndef is not needed
(PASCAL is defined as __stdcall).

However, with MSVC, there is a problem with the parenthesization
in the formal arg:
Fails: struct hostent * WSAAPI (fnc)(const char *))
 but
Works: struct hostent * (WSAAPI fnc)(const char *))
Works: struct hostent * WSAAPI fnc(const char *))


-- 
Carl Stehle



More information about the DCC mailing list

Contact vjs@rhyolite.com by mail or use the form.