cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: compiling curl on AIX 5.3

From: Song Ma <songmash_at_gmail.com>
Date: Thu, 28 Jun 2007 10:52:40 +0800

Hi Marty,

Daniel explained well the root cause. I've encountered the same problem on
another UNIX platform which is using specialized C compiler. The reason is
because "curl.h" can not set "CURL_ISOCPP" to "defined" status by telling
the compiler type. The fix is to define CURL_ISOCPP explicitly before line
530.

BTW, I am curious to say "-qlanglvl=extc89" is not the cause of your error.
Contrarily, "cc -qlanglvl=extc89" will set the macro "__STDC__" on AIX 5.3.
I guess your other compiler options may turn off this macro setting. Here is
a little testing:
(root@) /tmp> uname -a
AIX 53JTEST2 3 5 00CEBB4A4C00
(root@) /tmp> cat test.c
#include <stdio.h>

int main(void)
{

#ifdef __STDC__
printf("I am STDC\n");
#else
printf("I am just CC\n");
#endif

return 0;
}
(root@) /tmp> cc -qlanglvl=extc89 test.c
(root@) /tmp> ./a.out
I am STDC
(root@) /tmp> cc test.c -o a.out2
(root@) /tmp> ./a.out2
I am just CC

attached "curl.h" code fragment:
     519 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
|| \
     520 defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) ||
\
     521 defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__)
     522
     523 /* This compiler is believed to have an ISO compatible
preprocessor */
     524 #define CURL_ISOCPP
     525 #else
     526 /* This compiler is believed NOT to have an ISO compatible
preprocessor */
     527 #undef CURL_ISOCPP
     528 #endif
     529
     530 #ifdef CURL_ISOCPP
     531 #define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ##
type + number
     532 #else
"

2007/6/26, Daniel Stenberg <daniel_at_haxx.se>:
>
> On Mon, 25 Jun 2007, Everett, Marty wrote:
>
> > I did not change the config options from 7.15 to 7.16. I have tried
> other
> > version of 7.16 with the same results but with different line numbers.
>
> (Please don't top-post)
>
> The only difference (from 7.15.5 to 7.16.0) I could see that would affect
> that
> enum is that the latter checks for __HIGHC__ as well and consider such a
> compiler to be ISO C (and that's for the Metaware's High-C compiler).
>
> If you define CURL_ISOCPP before the first #ifdef CURL_ISOPP line, does
> that
> make it compile?
>
> BTW, I just tried a recent curl version on AIX 5.3 box, and configure
> found cc
> and I could build curl fine with it (no extra option for C89 or anything
> required).
>
Received on 2007-06-28