httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: [PATCH] Take2: Show compile time switches for server
Date Sat, 08 Nov 1997 00:11:57 GMT
#define X 1

#define S(x) S1(x)
#define S1(x) #x

char *foo = S(X);

I thought that was an example in the standard ... interesting.  It's the
way to do it though... every level of indirection adds another layer of
expansion. 

Dean

On Fri, 7 Nov 1997, Martin Kraemer wrote:

> On Fri, Nov 07, 1997 at 02:48:07AM -0800, Dean Gaudet wrote:
> > +1 on -V, but it looks like you put NO_WRITEV inside the USE_MMAP_FILES
> > section, which is wrong ... NO_WRITEV isn't related to USE_MMAP_FILES. 
> 
> 
> Ok, moved to behind the "#ifdef USE_MMAP_FILES" block.
> 
> BTW: I was thinking of reducing the code bloat a bit by using string
> concatenation to collect all the strings into one printf() by writing...
> 
>     printf("Server compiled with....\n"
> #ifdef BIG_SECURITY_HOLE
> 	   " -D BIG_SECURITY_HOLE\n"
> #endif
> #ifdef HTTPD_ROOT
> 	   " -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n"
> #endif
> ....
> 	   "\n");
> 
> But then I'd need a (portable) ANSI-Stringizing Macro which converts
> the _value_ of the num-valued macros into a string, like...
> 
> #define NUMSTR(n)   some_#_magic_i_couldnt_find_out
> #ifdef MMAP_SEGMENT_SIZE
>        " -D MMAP_SEGMENT_SIZE=" NUMSTR(MMAP_SEGMENT_SIZE) "\n"
> #endif
> 
> Somehow I couldn't get it to work. The X3J11 standard doesn't give an
> example either. Thus still Take 2: the printf() version (corrected re
> NO_WRITEV).
> 
>     Martin
> -- 
> | S I E M E N S |  <Martin.Kraemer@mch.sni.de>  |      Siemens Nixdorf
> | ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
> | N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
> ~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
> 

Mime
View raw message