xinxinlx / openjpeg

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

opj_config.h redefines standard Autoconf macros #196

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
OpenJPEG 2.0 provides an opj_config.h public header file which is #included 
from openjpeg.h.  This file defines macros which collide with standard macros 
defined by Autoconf.  As a result, if a program builds with Autotools and makes 
autodetection decisions that are different from OpenJPEG's, that program will 
see redefinition warnings at build time.  For example:

    In file included from /home/bgilbert/openjpeg/include/openjpeg-2.0/opj_stdint.h:29:0,
                     from /home/bgilbert/openjpeg/include/openjpeg-2.0/openjpeg.h:92,
                     from conftest.c:25:
    /home/bgilbert/openjpeg/include/openjpeg-2.0/opj_config.h:22:0: warning: "HAVE_FSEEKO" redefined [enabled by default]
    conftest.c:10:0: note: this is the location of the previous definition

config.h macros are supposed to be for internal use by the program that 
generates them, and should not be included in any exported API.  At a minimum, 
the macros should be renamed to e.g. OPJ_HAVE_FSEEKO.

Original issue reported on code.google.com by bgilb...@backtick.net on 26 Nov 2012 at 5:43

GoogleCodeExporter commented 9 years ago
Some notes after a closer look with Mickael :

As of now, opj_config.h is included from opj_stdint.h only to get the value of  
:
- HAVE_STDINT_H
- HAVE_SSIZE_T
The other macros are not used in the public API of openjpeg.

Proposed solution :

[1] HAVE_SSIZE_T seems to be an old macro, not used at all in the code.
A grep says it is used in the internal libtiff, but the libtiff configuration 
process handles that itself.
So to my opinion, in opj_stdint.h, the end of the file related to HAVE_SSIZE_T 
can simply be deleted.

[2] Rename HAVE_STDINT_H to OPJ_HAVE_STDINT_H to avoid similar issues.

[3] Move all other macros to an internal opj_config_private.h file, only 
included in .c files.

[4] Rename these other macros with a OPJ_ prefix for consistency.

Original comment by julien.m...@gmail.com on 30 Nov 2012 at 3:57

GoogleCodeExporter commented 9 years ago
This appears to have been fixed in SVN.

Original comment by bgilb...@backtick.net on 9 Jul 2013 at 9:33

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
As per OP reprot, this is now fixed. Closing.

Original comment by mathieu.malaterre on 27 Feb 2014 at 10:17