Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 78e9f0f

Browse files
committed
Fix Mac OS X build break due to deprecation warnings as errors
1 parent 6ef2364 commit 78e9f0f

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/Native/System.IO.Native/nativeio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "nativeio.h"
88
#include <sys/stat.h>
99

10-
#if HAVE_STAT64 && !(defined(__APPLE__) && defined(_AMD64_))
10+
#if HAVE_STAT64
1111
# define stat_ stat64
1212
# define fstat_ fstat64
1313
#else

src/Native/System.Security.Cryptography.Native/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ project(System.Security.Cryptography.Native)
33

44
set(CMAKE_INCLUDE_CURRENT_DIR ON)
55

6+
# Issue 2546 - Many deprecation warnings in System.Security.Cryptography.Native on Mac OS X
7+
add_compile_options(-Wno-deprecated-declarations)
8+
69
add_definitions(-DPIC=1)
710

811
find_library(CRYPTO NAMES crypto)

src/Native/config.h.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,12 @@
22

33
#cmakedefine01 HAVE_STAT64
44
#cmakedefine01 HAVE_STAT_BIRTHTIME
5+
6+
// Mac OS X has stat64, but it is deprecated since plain stat now
7+
// provides the same 64-bit aware struct when targeting OS X > 10.5
8+
// and not passing _DARWIN_NO_64_BIT_INODE.
9+
#ifdef __APPLE__
10+
# undef HAVE_STAT64
11+
# define HAVE_STAT64 0
12+
#endif
13+

0 commit comments

Comments
 (0)