Opened 13 years ago
Closed 5 years ago
#4282 closed enhancement (wontfix)
Prevent redefinitions in cpl_config.h
Reported by: | fwobbe | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | closed_because_of_github_migration |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | cpl_config.h |
Cc: |
Description
Hi, the #undef statements in the header template file 'port/cpl_config.h.in' are not wrapped in #ifndef ... #endif conditions. The problem with this is that e.g. HAVE_UNISTD_H and HAVE_UNISTD_H are standard symbol names generated by autoconf (AC_CHECK_HEADERS). This can cause unwanted redefinition of the symbols, when gdal.h is included in projects that also use autoconf. To resolve this issue I suggest to apply the attached patch to trunk. Cheers.
Attachments (1)
Change History (9)
by , 13 years ago
Attachment: | cpl_config.h.in.patch added |
---|
comment:1 by , 13 years ago
Version: | unspecified → svn-trunk |
---|
follow-up: 3 comment:2 by , 13 years ago
comment:3 by , 13 years ago
Replying to rouault:
[...] The main problem is that we should follow the common practice that wants that cpl_config.h should not be included by public GDAL headers [...]
Good point. Thanks for addressing that.
comment:4 by , 12 years ago
Keywords: | cpl_config.h added; haspatch removed |
---|---|
Milestone: | 1.8.2 |
Removing the milestone. I don't think we will be addressing this before 2.0.
While I agree with Even's suggestion in general, in practice I don't see how we can do it since the public headers depend on many build specific configuration options from cpl_config.h. So I don't see how this can be accomplished.
comment:6 by , 9 years ago
Does "While I agree with Even's suggestion in general, in practice I don't see how we can do it..." mean => wontfix?
comment:8 by , 5 years ago
Milestone: | → closed_because_of_github_migration |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.
I don't believe this is the right approach. We shouldn't have to mess up with that file. The main problem is that we should follow the common practice that wants that cpl_config.h should not be included by public GDAL headers to start with, but this might require quite a bit of code change to move its inclusion from cpl_port.h (which seems to be the only includer at first sight, but cpl_port.h is dragged by everybody) into all needed places.