diff options
author | Brian Smith <brian@dbsoft.org> | 2022-04-26 11:07:23 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2022-04-26 11:07:23 -0500 |
commit | 9e2a89c71ddf67975da35eb100673f6b5546f292 (patch) | |
tree | ca7b972015f5ad2388d416fa0ec8f506cc9fb8d6 /xpcom | |
parent | 68d1c14bdf79d1c536ae05a4ce33fd9601c277eb (diff) | |
download | uxp-9e2a89c71ddf67975da35eb100673f6b5546f292.tar.gz |
Issue #1829 - Revert "Issue #1751 -- Remove XP_DARWIN"
This reverts commit 3d671e4275c73a1484c72713304c6e04ec4ffc7c.
Diffstat (limited to 'xpcom')
-rw-r--r-- | xpcom/ds/nsMathUtils.h | 4 | ||||
-rw-r--r-- | xpcom/io/nsLocalFileUnix.h | 4 | ||||
-rw-r--r-- | xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S | 15 | ||||
-rw-r--r-- | xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp | 4 |
4 files changed, 24 insertions, 3 deletions
diff --git a/xpcom/ds/nsMathUtils.h b/xpcom/ds/nsMathUtils.h index 57228d6634..a3058faaaf 100644 --- a/xpcom/ds/nsMathUtils.h +++ b/xpcom/ds/nsMathUtils.h @@ -103,6 +103,10 @@ NS_finite(double aNum) #ifdef WIN32 // NOTE: '!!' casts an int to bool without spamming MSVC warning C4800. return !!_finite(aNum); +#elif defined(XP_DARWIN) + // Darwin has deprecated |finite| and recommends |isfinite|. The former is + // not present in the iOS SDK. + return std::isfinite(aNum); #else return finite(aNum); #endif diff --git a/xpcom/io/nsLocalFileUnix.h b/xpcom/io/nsLocalFileUnix.h index 5bdc6a3da0..c49f448fd1 100644 --- a/xpcom/io/nsLocalFileUnix.h +++ b/xpcom/io/nsLocalFileUnix.h @@ -61,7 +61,9 @@ #define F_BSIZE f_bsize #endif -#if defined(HAVE_STAT64) && defined(HAVE_LSTAT64) +// stat64 and lstat64 are deprecated on OS X. Normal stat and lstat are +// 64-bit by default on OS X 10.6+. +#if defined(HAVE_STAT64) && defined(HAVE_LSTAT64) && !defined(XP_DARWIN) #define STAT stat64 #define LSTAT lstat64 #define HAVE_STATS64 1 diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S index 92788667cd..131cfc3343 100644 --- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S +++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S @@ -2,6 +2,16 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +# Darwin gives a leading '_' to symbols defined in C code. +#ifdef XP_DARWIN +#define SYM(x) _ ## x +#define CFI_STARTPROC +#define CFI_ENDPROC +#define CFI_DEF_CFA_OFFSET(offset) +#define CFI_OFFSET(reg, offset) +#define CFI_DEF_CFA_REGISTER(reg) +#define CFI_DEF_CFA(reg, offset) +#else #define SYM(x) x #define CFI_STARTPROC .cfi_startproc #define CFI_ENDPROC .cfi_endproc @@ -9,6 +19,7 @@ #define CFI_OFFSET(reg, offset) .cfi_offset reg, offset #define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg #define CFI_DEF_CFA(reg, offset) .cfi_def_cfa reg, offset +#endif .intel_syntax noprefix @@ -16,7 +27,9 @@ # uint32_t argc, nsXPTCVariant* argv); .text .global SYM(NS_InvokeByIndex) +#ifndef XP_DARWIN .type NS_InvokeByIndex, @function +#endif .align 4 SYM(NS_InvokeByIndex): CFI_STARTPROC @@ -103,5 +116,7 @@ SYM(NS_InvokeByIndex): ret CFI_ENDPROC +#ifndef XP_DARWIN // Magic indicating no need for an executable stack .section .note.GNU-stack, "", @progbits ; .previous +#endif diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp index cf68c0d6eb..78664dfcfb 100644 --- a/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp +++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp @@ -8,8 +8,8 @@ #include "xptcprivate.h" #include "xptiprivate.h" -#if !defined(__arm__) && !defined(LINUX) -#error "This code is for Linux ARM only. Please check if it works for you, too.\nDepends strongly on gcc behaviour." +#if !defined(__arm__) && !(defined(LINUX) || defined(XP_DARWIN)) +#error "This code is for Linux/iOS ARM only. Please check if it works for you, too.\nDepends strongly on gcc behaviour." #endif /* Specify explicitly a symbol for this function, don't try to guess the c++ mangled symbol. */ |