Bram Moolenaar wrote:

> James Vega wrote:
>
>> 2010/5/18 Dominique Pellé <[email protected]>:
>> > On Tue, May 18, 2010 at 9:46 PM, James Vega <[email protected]> wrote:
>> >> 2010/5/18 Dominique Pellé <[email protected]>:
>> >>> On Tue, May 18, 2010 at 9:06 PM, Bram Moolenaar <[email protected]> 
>> >>> wrote:
>> >>>>
>> >>>> Then we could not use the autoconf check, it always defines uint32_t.
>> >>>>
>> >>>> I'll undefine uint32_t in vim.h, like it's done for netbeans.
>> >>>
>> >>>
>> >>> The same kind of error still happens when compiling if_python.c:
>> >>>
>> >>> In file included from /usr/local/include/python2.6/pyport.h:7,
>> >>>                 from /usr/local/include/python2.6/Python.h:58,
>> >>>                 from if_python.c:49:
>> >>> /usr/include/stdint.h:52: error: duplicate ‘unsigned’
>> >>> /usr/include/stdint.h:52: error: two or more data types in declaration
>> >>> specifiers
>> >>>
>> >>>
>> >>> Shouldn't we include <stdint.h> (introduced in c99) rather than defining
>> >>> int32_t when stdint.h is available?  With something more or less like...
>> >>>
>> >>> #ifdef HAVE_STDINT_H
>> >>> #include <stdint.h>
>> >>> #else
>> >>> /* Define to `unsigned int' or other type that is 32 bit.  */
>> >>> #define uint32_t unsigned int
>> >>> #endif
>> >>
>> >> That's what the Autoconf macro is supposed to do:
>> >>
>> >>  If stdint.h or inttypes.h does not define the type uint32_t, define
>> >>  uint32_t to an unsigned integer type that is exactly 32 bits wide, if
>> >>  such a type exists.
>> >
>> > Something is wrong then.  I'm using gcc-4.4.1 (Ubuntu-9.10)
>> > which of course has <stdint.h>.  Yet file vim/src/auto/config.h
>> > (generated by configure) redefines uint32_t:
>> >
>> > vim/src/auto/config.h:
>> > ....
>> > /* Define to `unsigned int' or other type that is 32 bit.  */
>> > #define uint32_t unsigned int
>> > ...
>>
>> Ah, the issue is that Vim's configure script isn't checking for stdint.h
>> or inttypes.h.  Attached patch fixes this and should remove the need for
>> the other workarounds Bram added.
>
> These include files also define a bunch of other things.  Are we sure
> these won't cause new problems?
>
> Also, how do we know the uint32_t that stdint.h defines is correct?
> autoconf needs to verify that.  Well, we could write a test for it.

Just to confirm that the latest version (changeset:2187:e741fe7a0547)
works for me on Ubuntu-9.10 with Vim huge GTK2 GNOME GUI
+mzscheme +perl +python +ruby +tcl.

Even if Vim never includes <stdint.h>, some system header files may
perhaps include it? So I'm wondering how safe it is to undefine uint32_t
in vim.h. I quite like the latest patch proposed by James Vega.

Regards
-- Dominique

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui