joetrotta / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

openjpeg does not compile on solaris #178

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
[ 26%] Building C object 
src/lib/openjpip/CMakeFiles/openjpip_local.dir/openjpip.c.o
In file included from 
/home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjp2/opj_stdint.h:29:0,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/byte_manager.h:35,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/index_manager.h:34,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/target_manager.h:35,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/cachemodel_manager.h:35,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/channel_manager.h:36,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/session_manager.h:35,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/openjpip.h:34,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/openjpip.c:32:
/home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjp2/opj_config.h:21:0: 
warning: "_FILE_OFFSET_BITS" redefined [enabled by default]
In file included from 
/usr/local/lib/gcc/i386-pc-solaris2.10/4.7.1/include-fixed/iso/stdlib_iso.h:39:0
,
                 from /usr/include/stdlib.h:18,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/openjpip.c:31:
/usr/local/lib/gcc/i386-pc-solaris2.10/4.7.1/include-fixed/sys/feature_tests.h:1
96:0: note: this is the location of the previous definition
In file included from 
/home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/openjpip.c:32:0:
/home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/openjpip.h:281:23: 
error: conflicting types for 'index_t'
In file included from /usr/include/time.h:22:0,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/channel_manager.h:34,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/session_manager.h:35,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/openjpip.h:34,
                 from /home/bfriesen/src/graphics/openjpeg-svn/src/lib/openjpip/openjpip.c:32:
/usr/include/sys/types.h:109:16: note: previous declaration of 'index_t' was 
here
gmake[2]: *** [src/lib/openjpip/CMakeFiles/openjpip_local.dir/openjpip.c.o] 
Error 1
gmake[1]: *** [src/lib/openjpip/CMakeFiles/openjpip_local.dir/all] Error 2
gmake: *** [all] Error 2

It seems that src/lib/openjpip/openjpip.h uses:

typedef index_param_t index_t;

which conflicts with this from /usr/include/sys/types.h :

typedef short           index_t;

Original issue reported on code.google.com by mathieu.malaterre on 2 Oct 2012 at 6:53

GoogleCodeExporter commented 9 years ago
Here is the header on solaris:

http://www.s-gms.ms.edus.si/cgi-bin/man-cgi?types+3HEAD

Original comment by mathieu.malaterre on 2 Oct 2012 at 6:58

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 25 Feb 2014 at 3:44

GoogleCodeExporter commented 9 years ago
we do not have access to such machine so closing until someone either provide a 
patch and/or a testing machine.

Original comment by mathieu.malaterre on 26 Feb 2014 at 3:58

GoogleCodeExporter commented 9 years ago
The POSIX standard explicitly reserves names with a _t suffix so "index_t" 
should never have been used.
Just changing the typedef to a #define allows the compilation to succeed on 
Solaris but it is an ugly workaround.
Is the typedef to index_t really critical ?
Regards

Aurelien

Original comment by aurelien...@gmail.com on 20 Oct 2014 at 9:59

GoogleCodeExporter commented 9 years ago
I was not aware of the "_t" rules of POSIX. Thanks for clarification. Could you 
provide a patch if you use such arch ? thx

Original comment by mathieu.malaterre on 20 Oct 2014 at 10:09