apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Striker" <stri...@apache.org>
Subject Exports, make_export.awk WAS: RE: a patch for apr_sms_threads.h
Date Fri, 13 Jul 2001 12:00:23 GMT
> hi,
> The included is a patch which will help you making
> httpd-2.0 successfully on such OSs as FreeBSD.
> Unless applying this patch, the correct apr.exports
> file cannot be created and the make fails when server/exports.c
> is being compiled.

Oh dear, I got bitten by buildexports/make_export, didn't I?
Ok, I'll move the #if down a few lines (and the matching
#endif up) and see if that fixes the problem.

Someone should really look into make_export one day and
resolve the issues you won't expect when you code outside
of httpd (ie, in apr).


#ifdef __cplusplus

#ifdef __cplusplus


Shouldn't be any different (from buildexports point of view) than:

#ifdef __cplusplus


#ifdef __cplusplus

The problem seems to be in apr/build/make_export:

/^#[ \t]*if(def)? (AP[RU]?_|!?defined).*/ {
        if (old_filename != FILENAME) {
                if (old_filename != "") printf("%s", line)
                macro_no = 0
                found = 0
                count = 0
                old_filename = FILENAME
                line = ""
        macro_stack[macro_no++] = macro
        macro = substr($0, length($1)+2)
        line = line macro "\n"

/^#[ \t]*endif/ {
        if (count > 0) {
                line = line "/" macro "\n"
                macro = macro_stack[--macro_no]
        if (count == 0) {
                if (found != 0) {
                        printf("%s", line)
                line = ""

The 'endif rule' reduces the count, but the count isn't increased
when an if other than #if APR_ or defined is present. So
#ifdef __cplusplus doesn't bump the count, where the matching
#endif does reduce it. Am I missing something? If not, I can't
think of a decent fix right now, but it should be possible.

Hmmm, total weirdness, I can't reproduce Hiroyukis problem on
my machine... (linux from scratch, linux 2.4.2, glibc 2.2.2,
gawk 3.0.6). Can someone reproduce it on their systems, so
maybe we can look for a constructive fix?

Thoughts anyone?


PS. Hiroyuki, could you send me your httpd-2.0/srclib/apr/apr.exports
    please? I'm curious if my thoughts are matching the behaviour on
    your machine.

View raw message