typedefs_md.h

Roman Kennke roman.kennke at aicas.com
Mon Oct 8 09:49:12 UTC 2007


Hi,

This patches addresses a problem with typedefs_md.h when trying to
compile for VxWorks. In this file we see definitions like these:

 #define _UINT32_T
 #ifndef uint32_t /* [sbb] scaffolding */
 typedef unsigned int uint32_t;
 #endif /* [sbb] scaffolding */


The problem with such a construct is when uint32_t isn't a macro, but a
real type that is defined with typedef. Then the compiler tries to
re-typedef this type which conflicts with the system type. My solution
here looks like this:

 #define _UINT32_T
 #if ! defined uint32_t && ! defined HAVE_UINT32_DEFINED
 typedef unsigned int uint32_t;
 #endif /* [sbb] scaffolding */

that is, we check the HAVE_UINT32_DEFINED. This has to be defined on a
target system where uint32_t is defined as type. In my setup I do this
in a configure-check, but OpenJDK doesn't use configure, so I left this
out. It should be possible to pass as compiler flag too. If this macro
isn't defined at all (the default) then the behaviour is exactly as
before.

Comments? Better solutions?

BTW: If this isn't the correct list, then please re-direct me to the
appropriate list.

/Roman

-- 
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openjdk_typedefs.diff
Type: text/x-patch
Size: 1266 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20071008/9bf98d97/openjdk_typedefs.diff>


More information about the build-dev mailing list