From: Kjell W. <kje...@gm...> - 2007-09-11 22:40:11
|
On 9/11/07, William S Fulton <ws...@fu...> wrote: > The test-suite has examples which use the typemaps in the patch. I had > to tweak the typemaps slightly to use limits.h to get the definitions of > LONG_LONG_MAX / LLONG_MAX. However, even with the latest gcc, this does > not compile using default compiler options. It seems that the compiler > will accept the 'long long' by default, but not these macros. Both 'long > long' and these macros are in the C99 standard and everything compiles > if we pass the --std=c99. Personally I think that gcc should be using > the C99 standard by default but as it is not, we need to think up a > better solution. I'm not keen on changing the compiler options we test > with unless we really have to. Ah, right. I had forgotten about this little "feature". The most common workaround for this issue (that I know of) is to add -std=gnu99 to CFLAGS (which is nowhere near as draconian as passing -std=c99) > Is there anything in tcl.h that can help? This is likely going to bite the other languages, too (at least, anything that wants to parse a long long correctly). Perhaps some configure.in magic? There's a nice template in the OpenSSH sources that tries 1) the correct header, 2) -std=gnu99, and finally 3) compute the constants directly. I don't believe LONG_LONG_MAX is particularly portable either. I think adding the requisite magic to configure.in would be the right way to go (until the compilers catch up) > >> Perhaps this the problem perl > >> testcase: > >> Checking testcase li_std_string (with run test) under perl5 > >> SWIG Perl test failed: > >> > >> TypeError in method 'Foo_testl', argument 2 of type 'unsigned long long' > > > > I don't think it is, but that one should be fairly straightforward to > > track down, too. If I get a sec, I'll have a peek. > > > Your help here will be much appreciated as I'd like to fix this before > releasing 1.3.32. I'll have a look and get back to you. |