Skip to content

Commit

Permalink
gdal: define __STDC_FORMAT_MACROS if needed (#21457)
Browse files Browse the repository at this point in the history
ancient MacOSX SDKs require this definition explicitly added.

(The requirement was removed in MacOSX SDK 10.7 and newer.)
  • Loading branch information
barracuda156 committed Nov 20, 2023
1 parent 2bdcebe commit b4dafeb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gis/gdal/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ cmake.set_cxx_standard yes
# See https://trac.macports.org/ticket/56908
compiler.thread_local_storage yes

# https://github.com/OSGeo/gdal/pull/8748
# https://trac.macports.org/ticket/68734
patchfiles-append 0001-sqlite_rtree_bulk_load.c-define-__STDC_FORMAT_MACROS.patch

configure.optflags -DGDAL_COMPILATION

depends_build-append \
Expand Down Expand Up @@ -275,7 +279,6 @@ configure.args-append \
-DGDAL_USE_XERCESC=OFF \
-DGDAL_USE_ZSTD=ON


configure.args-append \
-DLIBAEC_INCLUDE_DIR=${prefix}/lib/libaec/include \
-DLIBAEC_LIBRARY=${prefix}/lib/libaec/lib/libaec.dylib
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From b0e8b43f019ce12a3234036a7267d1a7dbd7d318 Mon Sep 17 00:00:00 2001
From: barracuda156 <vital.had@gmail.com>
Date: Sun, 19 Nov 2023 13:07:23 +0800
Subject: [PATCH] sqlite_rtree_bulk_load.c: define __STDC_FORMAT_MACROS to
unbreak build on platforms which need it

---
.../sqlite/sqlite_rtree_bulk_load/sqlite_rtree_bulk_load.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git ogr/ogrsf_frmts/sqlite/sqlite_rtree_bulk_load/sqlite_rtree_bulk_load.c ogr/ogrsf_frmts/sqlite/sqlite_rtree_bulk_load/sqlite_rtree_bulk_load.c
index b19d91808b..598d5047bd 100644
--- ogr/ogrsf_frmts/sqlite/sqlite_rtree_bulk_load/sqlite_rtree_bulk_load.c
+++ ogr/ogrsf_frmts/sqlite/sqlite_rtree_bulk_load/sqlite_rtree_bulk_load.c
@@ -26,6 +26,10 @@
* DEALINGS IN THE SOFTWARE.
****************************************************************************/

+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
+
#include "sqlite_rtree_bulk_load.h"

#include <assert.h>

0 comments on commit b4dafeb

Please sign in to comment.