httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [apreq-2] order of declarations
Date Wed, 23 Apr 2003 05:24:30 GMT
Randy Kobes wrote:
> On Wed, 23 Apr 2003, Stas Bekman wrote:
> 
> 
>>So it expands into:
>>
>>const char *bdry, *ct = APREQ_ENV.in(req->env, "Content-Type");
>>apr_size_t blen;
>>
>>Does it still complain if you replace the macro?
> 
> 
> You're good at this :) The above does compile fine ...

What gives? VC++ C-preprocessor is borked?

>>May be it's because APREQ_ENV.in is a callback?:
>>
>>    const char          *(*in)(void *ctx, const char *name);
>>
>>Finally does this work?
>>
>>const char *bdry;
>>const char *ct = apreq_env_content_type(req->env);
>>apr_size_t blen;
> 
> 
> No, that gives the same error as before:
>    syntax error : missing ';' before 'type'
> referring to the apr_size_t blen line, and then,
> referring to the next line,
>   'apr_status_t' : illegal use of this type as an expression

Meaning that its C-preprocessor has problems with substituting macros in the 
declaration sections. That feels like it does the substitution in two path, 
first doing the declarations and then the rest of the code.

What happens if you do this:

#define foo(c) APREQ_ENV.in(c, "Content-Type")
     if (parser->v.size == 0) {
         const char *bdry, *ct = foo(req->env);
         apr_size_t blen;

anything related to the case of macro? This?

#define FOO(c) APREQ_ENV.in(c, "Content-Type")
     if (parser->v.size == 0) {
         const char *bdry, *ct = FOO(req->env);
         apr_size_t blen;

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message