vcpkg/ports/gdal/0009-atlbase.patch

73 lines
2.0 KiB
Diff
Raw Normal View History

diff --git a/gdal/nmake.opt b/gdal/nmake.opt
index 7e7871e..ac01bf2 100644
--- a/gdal/nmake.opt
+++ b/gdal/nmake.opt
@@ -239,6 +239,11 @@ STDCALL=YES
VERSION = 304
!ENDIF
+# Set HAVE_ATLBASE_H=NO if atlbase.h header is not available
+!IFNDEF HAVE_ATLBASE_H
+HAVE_ATLBASE_H=YES
+!ENDIF
+
# Comment the following out if you want PAM supported disabled
# by default.
!IFNDEF PAM_SETTING
diff --git a/gdal/port/cpl_aws.cpp b/gdal/port/cpl_aws.cpp
index eed23f9..e3a1578 100644
--- a/gdal/port/cpl_aws.cpp
+++ b/gdal/port/cpl_aws.cpp
@@ -43,7 +43,7 @@ CPL_CVSID("$Id$")
// #define DEBUG_VERBOSE 1
#ifdef WIN32
-#if defined(_MSC_VER)
+#if defined(HAVE_ATLBASE_H)
bool CPLFetchWindowsProductUUID(CPLString &osStr); // defined in cpl_aws_win32.cpp
#endif
const char* CPLGetWineVersion(); // defined in cpl_vsil_win32.cpp
@@ -688,7 +688,7 @@ static bool IsMachinePotentiallyEC2Instance()
}
else
{
-#if defined(_MSC_VER)
+#if defined(HAVE_ATLBASE_H)
CPLString osMachineUUID;
if( CPLFetchWindowsProductUUID(osMachineUUID) )
{
diff --git a/gdal/port/cpl_aws_win32.cpp b/gdal/port/cpl_aws_win32.cpp
index 7742a35..98be522 100644
--- a/gdal/port/cpl_aws_win32.cpp
+++ b/gdal/port/cpl_aws_win32.cpp
@@ -28,7 +28,7 @@
#include "cpl_port.h"
-#if defined(WIN32) && defined(_MSC_VER)
+#if defined(HAVE_ATLBASE_H)
#define _WIN32_DCOM
#include <iostream>
@@ -140,4 +140,4 @@ bool CPLFetchWindowsProductUUID(CPLString &osStr)
return !osWindowsProductUUID.empty();
}
-#endif /* defined(WIN32) && defined(_MSC_VER) */
+#endif /* defined(HAVE_ATLBASE_H) */
diff --git a/gdal/port/makefile.vc b/gdal/port/makefile.vc
index a8b0e02..68da2dd 100644
--- a/gdal/port/makefile.vc
+++ b/gdal/port/makefile.vc
@@ -141,6 +141,10 @@ EXTRAFLAGS = $(EXTRAFLAGS) $(LZ4_CFLAGS) -DHAVE_LZ4
ODBC_OBJ = cpl_odbc.obj
!ENDIF
+!IF "$(HAVE_ATLBASE_H)" == "YES"
+EXTRAFLAGS = $(EXTRAFLAGS) -DHAVE_ATLBASE_H
+!ENDIF
+
default: prev_dllbuild cpl_config.h $(LIB)
$(LIB): $(OBJ)