Skip to content

ogrgeometry: do not redefine SFCGAL VERSION macros if they already exist#14667

Merged
rouault merged 2 commits into
OSGeo:masterfrom
ptitjano:sfcgal-macros-fixes
May 27, 2026
Merged

ogrgeometry: do not redefine SFCGAL VERSION macros if they already exist#14667
rouault merged 2 commits into
OSGeo:masterfrom
ptitjano:sfcgal-macros-fixes

Conversation

@ptitjano
Copy link
Copy Markdown
Contributor

SFCGAL_MAKE_VERSION and SFCGAL_VERSION_NUM have been available since SFCGAL 2.3

This fixes the following warning with SFCGAL 2.3 (not released yet):

/home/jean/dev/gdal/ogr/ogrgeometry.cpp:44:9: warning: ‘SFCGAL_MAKE_VERSION’ redefined
   44 | #define SFCGAL_MAKE_VERSION(major, minor, patch)                               \
      |         ^~~~~~~~~~~~~~~~~~~
In file included from /opt/sfcgal/include/SFCGAL/capi/sfcgal_c.h:10,
                 from /home/jean/dev/gdal/build/ogr/ogr_sfcgal.h:17,
                 from /home/jean/dev/gdal/ogr/ogrgeometry.cpp:37:
/opt/sfcgal/include/SFCGAL/version.h:22:9: note: this is the location of the previous definition
   22 | #define SFCGAL_MAKE_VERSION( major, minor, patch ) ( ( ( major ) * 10000 ) + ( ( minor ) * 100 ) + ( patch ) )
      |         ^~~~~~~~~~~~~~~~~~~
/home/jean/dev/gdal/ogr/ogrgeometry.cpp:46:9: warning: ‘SFCGAL_VERSION_NUM’ redefined
   46 | #define SFCGAL_VERSION_NUM                                                     \
      |         ^~~~~~~~~~~~~~~~~~
/opt/sfcgal/include/SFCGAL/version.h:25:9: note: this is the location of the previous definition
   25 | #define SFCGAL_VERSION_NUM SFCGAL_MAKE_VERSION( 2, 3, 0 )

cc @lbartoletti

ptitjano added 2 commits May 27, 2026 10:57
SFCGAL already defines SFCGAL_VERSION macro to define SFCGAL version
as a string (for example "2.3.0"). Rename SFCGAL_VERSION to
SFCGAL_VERSION_NUM to avoid name collision.
`SFCGAL_MAKE_VERSION` and `SFCGAL_VERSION_NUM` have been available
since SFCGAL 2.3.

See: https://gitlab.com/sfcgal/SFCGAL/-/merge_requests/654
@rouault rouault added the backport release/3.13 Backport to release/3.13 label May 27, 2026
@rouault rouault merged commit 2dec2c8 into OSGeo:master May 27, 2026
46 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/3.13 Backport to release/3.13

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants