glib under OS X

Larry Campbell campbell at world.std.com
Tue Mar 6 10:18:53 PST 2001


On Monday, March 5, 2001, at 07:27 PM, Stan Shebs wrote:

> Ideally, someone would write a special autoconf test that would 
> try compiling a program with the problematic macro definition, 
> then add a -traditional-cpp (or -no-cpp-precomp, which is what it 
> will be in the final; -traditional-cpp is supposed to mean something 
> else). 

Here's an autoconf test I wrote. It's actually testing for a weird behavior (bug, I say) unrelated to macros, but it works for me:

dnl Check to see if we have the (ObjC?) braindamage that --traditional-cpp turns off
AC_CACHE_CHECK(if we need --traditional-cpp to get valid code to compile, ac_cv_need_traditional_cpp,
    [
    AC_TRY_COMPILE(,[
        void foo(int x) {
            switch (x) {
            default:
            }
        }
    ], ac_cv_need_traditional_cpp=no, ac_cv_need_traditional_cpp=yes)
])
if test "x$ac_cv_need_traditional_cpp" = "xyes"; then
    CPPFLAGS="${CPPFLAGS} --traditional-cpp"
fi

I'd be interested to know whether this bug (the failure to compile what I think is correct code) is fixed in a more recent (than PB) build of the compiler.



More information about the MacOSX-dev mailing list