Last Comment Bug 651444 - qcmstypes.h redefines intX_t types already defined by sys/types.h
: qcmstypes.h redefines intX_t types already defined by sys/types.h
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: GFX: Color Management (show other bugs)
: Trunk
: All OpenBSD
: -- normal (vote)
: mozilla10
Assigned To: Landry Breuil (:gaston)
:
:
Mentors:
Depends on:
Blocks: openbsdmeta
  Show dependency treegraph
 
Reported: 2011-04-20 01:34 PDT by Landry Breuil (:gaston)
Modified: 2011-09-28 02:01 PDT (History)
2 users (show)
emorley: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Don't redefine int*_t types on OpenBSD, they come from sys/types.h (1.03 KB, patch)
2011-09-19 01:51 PDT, Landry Breuil (:gaston)
jmuizelaar: review-
Details | Diff | Splinter Review
Don't redefine int*_t types on OpenBSD, they come from sys/types.h (831 bytes, patch)
2011-09-20 08:10 PDT, Landry Breuil (:gaston)
jmuizelaar: review+
emorley: checkin+
Details | Diff | Splinter Review
include inttypes.h for uintptr_t (841 bytes, patch)
2011-09-22 11:40 PDT, Landry Breuil (:gaston)
jmuizelaar: review+
Details | Diff | Splinter Review
include inttypes.h for uintptr_t (893 bytes, patch)
2011-09-27 09:43 PDT, Landry Breuil (:gaston)
jmuizelaar: review+
emorley: checkin+
Details | Diff | Splinter Review

Description Landry Breuil (:gaston) 2011-04-20 01:34:17 PDT
Currently qcms fails to build on OpenBSD :

gcc -o transform-sse2.o -c -I../../dist/system_wrappers -include /home/landry/src/mozilla-central/config/gcc_hidden.h -DMOZILLA_INTERNAL_AP
I -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DSTATIC_EX
PORTABLE_JS_API -DOSTYPE=\"OpenBSD4\" -DOSARCH=OpenBSD  -I/home/landry/src/mozilla-central/gfx/qcms -I. -I../../dist/include -I../../dist/i
nclude/nsprpub  -I/usr/ports/pobj/m-c/dist/include/nspr -I/usr/ports/pobj/m-c/dist/include/nss       -fPIC -I/usr/X11R6/include -Wall -W -W
no-unused -Wpointer-arith -Wcast-align -W -pedantic -Wno-long-long -fno-strict-aliasing -pthread -pipe  -DNDEBUG -DTRIMMED -g -O -DMOZ_QCMS
 -Wno-missing-field-initializers  -I/usr/X11R6/include -include ../../mozilla-config.h -DMOZILLA_CLIENT -MD -MF .deps/transform-sse2.pp -ms
se2 /home/landry/src/mozilla-central/gfx/qcms/transform-sse2.c
In file included from /home/landry/src/mozilla-central/gfx/qcms/qcmsint.h:1,
                 from /home/landry/src/mozilla-central/gfx/qcms/iccread.c:29:
/home/landry/src/mozilla-central/gfx/qcms/qcms.h:75: warning: ISO C restricts enumerator values to range of 'int'
In file included from /home/landry/src/mozilla-central/gfx/qcms/qcmsint.h:2,
                 from /home/landry/src/mozilla-central/gfx/qcms/iccread.c:29:
/home/landry/src/mozilla-central/gfx/qcms/qcmstypes.h:22: error: conflicting types for 'int64_t'
/usr/include/sys/types.h:102: error: previous declaration of 'int64_t' was here
/home/landry/src/mozilla-central/gfx/qcms/qcmstypes.h:23: error: conflicting types for 'uint64_t'
/usr/include/sys/types.h:107: error: previous declaration of 'uint64_t' was here

sys/types.h happens to be included before prtypes.h, which messes things around.

My current workaround would be to _not_ redefine basic types in qcmstypes.h (ie add OpenBSD to the #if !ANDROID block), but i'm not sure it's the best fix. How come sys/types.h is included first, and how come so many headers like to redefine systemwide types ?
Comment 1 Landry Breuil (:gaston) 2011-09-19 01:51:28 PDT
Created attachment 560862 [details] [diff] [review]
Don't redefine int*_t types on OpenBSD, they come from sys/types.h

Maybe not the best fix, but at least there's a patch for review..
Comment 2 Landry Breuil (:gaston) 2011-09-19 02:41:16 PDT
Or, a better fix might be #elif (!defined(ANDROID) && !defined(__OpenBSD__)), but given the spaghetti #ifdef maze this header is already....
Comment 3 Jeff Muizelaar [:jrmuizel] 2011-09-20 07:50:38 PDT
Comment on attachment 560862 [details] [diff] [review]
Don't redefine int*_t types on OpenBSD, they come from sys/types.h

I would prefer #elif !defined(ANDROID) && !defined(__OpenBSD__)
Comment 4 Landry Breuil (:gaston) 2011-09-20 08:10:46 PDT
Created attachment 561192 [details] [diff] [review]
Don't redefine int*_t types on OpenBSD, they come from sys/types.h

Your call, here's a new one with that.
Comment 6 Marco Bonardo [::mak] 2011-09-21 02:54:01 PDT
https://hg.mozilla.org/mozilla-central/rev/2718a99132a2
Comment 7 Landry Breuil (:gaston) 2011-09-22 11:40:32 PDT
Created attachment 561809 [details] [diff] [review]
include inttypes.h for uintptr_t

Doh, i knew that last minute change was going to bite me. as openbsd is in the same ifdef as android, it doesn't define uintptr_t anymore, while my initial patch didn't reach that far. So now the build fails with missing uintptr_t type.

Here's a patch that correctly includes inttypes.h, instead of doing one more typedef ...
Comment 8 Ed Morley [:emorley] 2011-09-22 16:00:41 PDT
Comment on attachment 561809 [details] [diff] [review]
include inttypes.h for uintptr_t

Review of attachment 561809 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/qcms/qcmstypes.h
@@ +17,1 @@
>  #elif !defined(ANDROID) && !defined(__OpenBSD__)

The |&& !defined(__OpenBSD__)| on line 17 can be taken out now surely? :-)
Comment 9 Ed Morley [:emorley] 2011-09-23 07:13:50 PDT
Removing checkin-needed for comment 8.
Comment 10 Landry Breuil (:gaston) 2011-09-27 09:43:34 PDT
Created attachment 562795 [details] [diff] [review]
include inttypes.h for uintptr_t

Doh, indeed. Here's the final diff i'm trying, results in a few.
Comment 11 Landry Breuil (:gaston) 2011-09-27 09:46:43 PDT
And qcms part of the tree built fine with that diff..
Comment 12 Ed Morley [:emorley] 2011-09-27 12:01:08 PDT
Comment on attachment 562795 [details] [diff] [review]
include inttypes.h for uintptr_t

https://hg.mozilla.org/integration/mozilla-inbound/rev/c81e6b2dc155
Comment 13 Ed Morley [:emorley] 2011-09-27 12:02:09 PDT
(For whomever merges, both patches have now landed, ok to close on merge)
Comment 14 Marco Bonardo [::mak] 2011-09-28 02:01:57 PDT
https://hg.mozilla.org/mozilla-central/rev/c81e6b2dc155

Note You need to log in before you can comment on or make changes to this bug.