diff options
author | Moonchild <moonchild@palemoon.org> | 2021-03-21 16:15:54 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-03-21 16:15:54 +0000 |
commit | b59777a67b8e0180eed34d43117db73186c7e1e1 (patch) | |
tree | d895127d670bb13d41ec6de6234cbd8ef3362932 | |
parent | a94a86ff785e246caa9c71b2914e0bb5f7b03333 (diff) | |
download | uxp-b59777a67b8e0180eed34d43117db73186c7e1e1.tar.gz |
Issue #1053 - Remove __ANDROID__ defines (except in third party code)
-rw-r--r-- | dom/media/AudioStream.cpp | 7 | ||||
-rw-r--r-- | dom/media/GraphDriver.cpp | 8 | ||||
-rw-r--r-- | gfx/cairo/libpixman/src/pixman-arm.c | 42 | ||||
-rw-r--r-- | gfx/cairo/libpixman/src/pixman-cpu.c | 48 | ||||
-rw-r--r-- | gfx/harfbuzz/src/hb-private.hh | 9 | ||||
-rw-r--r-- | js/src/jit/JitSpewer.cpp | 2 | ||||
-rw-r--r-- | js/src/jit/PerfSpewer.cpp | 11 | ||||
-rw-r--r-- | js/src/threading/posix/ConditionVariable.cpp | 5 | ||||
-rw-r--r-- | tools/profiler/core/PlatformMacros.h | 10 | ||||
-rw-r--r-- | tools/profiler/lul/LulPlatformMacros.h | 12 |
10 files changed, 17 insertions, 137 deletions
diff --git a/dom/media/AudioStream.cpp b/dom/media/AudioStream.cpp index 4b1d82c37f..77ed512eee 100644 --- a/dom/media/AudioStream.cpp +++ b/dom/media/AudioStream.cpp @@ -331,13 +331,6 @@ AudioStream::Init(uint32_t aNumChannels, uint32_t aRate, cubeb_stream_params params; params.rate = aRate; params.channels = mOutChannels; -#if defined(__ANDROID__) - params.stream_type = CUBEB_STREAM_TYPE_MUSIC; - - if (params.stream_type == CUBEB_STREAM_TYPE_MAX) { - return NS_ERROR_INVALID_ARG; - } -#endif params.format = ToCubebFormat<AUDIO_OUTPUT_FORMAT>::value; mAudioClock.Init(aRate); diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp index fe40c82e24..e8b71a2318 100644 --- a/dom/media/GraphDriver.cpp +++ b/dom/media/GraphDriver.cpp @@ -630,15 +630,7 @@ AudioCallbackDriver::Init() mSampleRate = output.rate = CubebUtils::PreferredSampleRate(); -#if defined(__ANDROID__) - output.stream_type = CUBEB_STREAM_TYPE_MUSIC; - if (output.stream_type == CUBEB_STREAM_TYPE_MAX) { - NS_WARNING("Bad stream type"); - return; - } -#else (void)mAudioChannel; -#endif output.channels = mGraphImpl->AudioChannelCount(); if (AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_S16) { diff --git a/gfx/cairo/libpixman/src/pixman-arm.c b/gfx/cairo/libpixman/src/pixman-arm.c index 145bd9050b..358372e50a 100644 --- a/gfx/cairo/libpixman/src/pixman-arm.c +++ b/gfx/cairo/libpixman/src/pixman-arm.c @@ -1,19 +1,20 @@ /* * Copyright © 2000 SuSE, Inc. * Copyright © 2007 Red Hat, Inc. + * Copyright © 2021 Moonchild Productions * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or + * documentation, and that the names of the authors not be used in advertising or * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the + * written prior permission. The authors make no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHORS * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN @@ -94,39 +95,6 @@ detect_cpu_features (void) return features; } -#elif defined(__ANDROID__) || defined(ANDROID) /* Android */ - -static arm_cpu_features_t -detect_cpu_features (void) -{ - arm_cpu_features_t features = 0; - char buf[1024]; - char* pos; - const char* ver_token = "CPU architecture: "; - FILE* f = fopen("/proc/cpuinfo", "r"); - if (!f) { - return features; - } - - fread(buf, sizeof(char), sizeof(buf), f); - fclose(f); - pos = strstr(buf, ver_token); - if (pos) { - char vchar = *(pos + strlen(ver_token)); - if (vchar >= '0' && vchar <= '9') { - int ver = vchar - '0'; - if (ver >= 7) - features |= ARM_V7; - } - } - if (strstr(buf, "neon") != NULL) - features |= ARM_NEON; - if (strstr(buf, "vfp") != NULL) - features |= ARM_VFP; - - return features; -} - #elif defined (__linux__) /* linux ELF */ #include <unistd.h> diff --git a/gfx/cairo/libpixman/src/pixman-cpu.c b/gfx/cairo/libpixman/src/pixman-cpu.c index 0eabb4e256..30f5fba8a4 100644 --- a/gfx/cairo/libpixman/src/pixman-cpu.c +++ b/gfx/cairo/libpixman/src/pixman-cpu.c @@ -1,19 +1,20 @@ /* * Copyright © 2000 SuSE, Inc. * Copyright © 2007 Red Hat, Inc. + * Copyright © 2021 Moonchild Productions * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or + * documentation, and that the names of the authors not be used in advertising or * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the + * written prior permission. The authors make no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHORS * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN @@ -290,7 +291,7 @@ pixman_have_arm_iwmmxt (void) #endif } -#elif defined (__linux__) || defined(__ANDROID__) || defined(ANDROID) /* linux ELF or ANDROID */ +#elif defined (__linux__) /* linux ELF */ static pixman_bool_t arm_has_v7 = FALSE; static pixman_bool_t arm_has_v6 = FALSE; @@ -299,39 +300,6 @@ static pixman_bool_t arm_has_neon = FALSE; static pixman_bool_t arm_has_iwmmxt = FALSE; static pixman_bool_t arm_tests_initialized = FALSE; -#if defined(__ANDROID__) || defined(ANDROID) /* Android device support */ - -static void -pixman_arm_read_auxv_or_cpu_features () -{ - char buf[1024]; - char* pos; - const char* ver_token = "CPU architecture: "; - FILE* f = fopen("/proc/cpuinfo", "r"); - if (!f) { - arm_tests_initialized = TRUE; - return; - } - - fread(buf, sizeof(char), sizeof(buf), f); - fclose(f); - pos = strstr(buf, ver_token); - if (pos) { - char vchar = *(pos + strlen(ver_token)); - if (vchar >= '0' && vchar <= '9') { - int ver = vchar - '0'; - arm_has_v7 = ver >= 7; - arm_has_v6 = ver >= 6; - } - } - arm_has_neon = strstr(buf, "neon") != NULL; - arm_has_vfp = strstr(buf, "vfp") != NULL; - arm_has_iwmmxt = strstr(buf, "iwmmxt") != NULL; - arm_tests_initialized = TRUE; -} - -#elif defined (__linux__) /* linux ELF */ - #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> @@ -382,8 +350,6 @@ pixman_arm_read_auxv_or_cpu_features () arm_tests_initialized = TRUE; } -#endif /* Linux elf */ - #if defined(USE_ARM_SIMD) pixman_bool_t pixman_have_arm_simd (void) @@ -420,7 +386,7 @@ pixman_have_arm_iwmmxt (void) #endif /* USE_ARM_IWMMXT */ -#else /* !_MSC_VER && !Linux elf && !Android */ +#else /* !_MSC_VER && !Linux elf */ #define pixman_have_arm_simd() FALSE #define pixman_have_arm_neon() FALSE diff --git a/gfx/harfbuzz/src/hb-private.hh b/gfx/harfbuzz/src/hb-private.hh index c1418d8a5d..7fd825318e 100644 --- a/gfx/harfbuzz/src/hb-private.hh +++ b/gfx/harfbuzz/src/hb-private.hh @@ -1,6 +1,7 @@ /* * Copyright © 2007,2008,2009 Red Hat, Inc. * Copyright © 2011,2012 Google, Inc. + * Copyright © 2021 Moonchild Productions * * This is part of HarfBuzz, a text shaping library. * @@ -24,6 +25,7 @@ * * Red Hat Author(s): Behdad Esfahbod * Google Author(s): Behdad Esfahbod + * Moonchild Productions Author(s): Moonchild Straver */ #ifndef HB_PRIVATE_HH @@ -200,13 +202,6 @@ static int errno = 0; /* Use something better? */ * mingw32 headers say atexit is safe to use in shared libraries. */ # define HB_USE_ATEXIT 1 -# elif defined(__ANDROID__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -/* This was fixed in Android NKD r8 or r8b: - * https://code.google.com/p/android/issues/detail?id=6455 - * which introduced GCC 4.6: - * https://developer.android.com/tools/sdk/ndk/index.html - */ -# define HB_USE_ATEXIT 1 # endif #endif diff --git a/js/src/jit/JitSpewer.cpp b/js/src/jit/JitSpewer.cpp index 0248c0a71f..12544b9301 100644 --- a/js/src/jit/JitSpewer.cpp +++ b/js/src/jit/JitSpewer.cpp @@ -30,8 +30,6 @@ #ifndef JIT_SPEW_DIR # if defined(_WIN32) # define JIT_SPEW_DIR "" -# elif defined(__ANDROID__) -# define JIT_SPEW_DIR "/data/local/tmp/" # else # define JIT_SPEW_DIR "/tmp/" # endif diff --git a/js/src/jit/PerfSpewer.cpp b/js/src/jit/PerfSpewer.cpp index 2dfa2c1f54..d428a8f926 100644 --- a/js/src/jit/PerfSpewer.cpp +++ b/js/src/jit/PerfSpewer.cpp @@ -28,12 +28,7 @@ // so also try /sdcard/. #ifndef PERF_SPEW_DIR -# if defined(__ANDROID__) -# define PERF_SPEW_DIR "/data/local/tmp/" -# define PERF_SPEW_DIR_2 "/sdcard/" -# else # define PERF_SPEW_DIR "/tmp/" -# endif #endif using namespace js; @@ -104,12 +99,6 @@ js::jit::CheckPerf() { return; } -#if defined(__ANDROID__) - if (openPerfMap(PERF_SPEW_DIR_2)) { - PerfChecked = true; - return; - } -#endif fprintf(stderr, "Failed to open perf map file. Disabling IONPERF.\n"); PerfMode = PERF_MODE_NONE; } diff --git a/js/src/threading/posix/ConditionVariable.cpp b/js/src/threading/posix/ConditionVariable.cpp index 6189fab989..fe768eae3b 100644 --- a/js/src/threading/posix/ConditionVariable.cpp +++ b/js/src/threading/posix/ConditionVariable.cpp @@ -22,9 +22,8 @@ using mozilla::TimeStamp; static const long NanoSecPerSec = 1000000000; -// Android 32-bit & macOS 10.12 has the clock functions, but not pthread_condattr_setclock. -#if defined(HAVE_CLOCK_MONOTONIC) && \ - !(defined(__ANDROID__) && !defined(__LP64__)) && !defined(__APPLE__) +// MacOS 10.12 has the clock functions, but not pthread_condattr_setclock. +#if defined(HAVE_CLOCK_MONOTONIC) && !defined(__APPLE__) # define USE_CLOCK_API #endif diff --git a/tools/profiler/core/PlatformMacros.h b/tools/profiler/core/PlatformMacros.h index 9a544a42e3..0bedbd512f 100644 --- a/tools/profiler/core/PlatformMacros.h +++ b/tools/profiler/core/PlatformMacros.h @@ -34,16 +34,6 @@ # define SPS_ARCH_amd64 1 # define SPS_OS_linux 1 -#elif defined(__ANDROID__) && defined(__arm__) -# define SPS_PLAT_arm_android 1 -# define SPS_ARCH_arm 1 -# define SPS_OS_android 1 - -#elif defined(__ANDROID__) && defined(__i386__) -# define SPS_PLAT_x86_android 1 -# define SPS_ARCH_x86 1 -# define SPS_OS_android 1 - #elif defined(__linux__) && defined(__i386__) # define SPS_PLAT_x86_linux 1 # define SPS_ARCH_x86 1 diff --git a/tools/profiler/lul/LulPlatformMacros.h b/tools/profiler/lul/LulPlatformMacros.h index 9a19bae106..6464da0678 100644 --- a/tools/profiler/lul/LulPlatformMacros.h +++ b/tools/profiler/lul/LulPlatformMacros.h @@ -30,21 +30,11 @@ # define LUL_ARCH_x64 1 # define LUL_OS_linux 1 -#elif defined(__linux__) && defined(__i386__) && !defined(__ANDROID__) +#elif defined(__linux__) && defined(__i386__) # define LUL_PLAT_x86_linux 1 # define LUL_ARCH_x86 1 # define LUL_OS_linux 1 -#elif defined(__ANDROID__) && defined(__arm__) -# define LUL_PLAT_arm_android 1 -# define LUL_ARCH_arm 1 -# define LUL_OS_android 1 - -#elif defined(__ANDROID__) && defined(__i386__) -# define LUL_PLAT_x86_android 1 -# define LUL_ARCH_x86 1 -# define LUL_OS_android 1 - #else # error "Unsupported platform" #endif |