Skip to content

Commit

Permalink
Bug 1730275 - Move util/Windows.h to util/WindowsWrapper.h so that ut…
Browse files Browse the repository at this point in the history
…il/moz.build can be added in a subsequent rev without inducing <windows.h>/"Windows.h" conflicts. r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D125902
  • Loading branch information
jswalden committed Sep 17, 2021
1 parent efaa2eb commit e6c31ee
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion config/check_spidermonkey_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"frontend/ReservedWordsGenerated.h",
"gc/StatsPhasesGenerated.h", # Included in the body of gc/Statistics.h
"gc/StatsPhasesGenerated.inc", # Included in the body of gc/Statistics.cpp
"psapi.h", # Must be included after "util/Windows.h" on Windows
"psapi.h", # Must be included after "util/WindowsWrapper.h" on Windows
"machine/endian.h", # Must be included after <sys/types.h> on BSD
"winbase.h", # Must precede other system headers(?)
"windef.h", # Must precede other system headers(?)
Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/DataViewObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "js/PropertySpec.h"
#include "js/Wrapper.h"
#include "util/DifferentialTesting.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/ArrayBufferObject.h"
#include "vm/GlobalObject.h"
#include "vm/Interpreter.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/ctypes/CTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#include "js/Vector.h"
#include "util/Text.h"
#include "util/Unicode.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/JSContext.h"
#include "vm/JSFunction.h"
#include "vm/JSObject.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/devtools/vprof/vprof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// running in the same process.

#ifdef WIN32
# include "util/Windows.h"
# include "util/WindowsWrapper.h"
#else
# define __cdecl
# include <stdarg.h>
Expand Down
2 changes: 1 addition & 1 deletion js/src/ds/MemoryProtectionExceptionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "mozilla/Atomics.h"

#if defined(XP_WIN)
# include "util/Windows.h"
# include "util/WindowsWrapper.h"
#elif defined(__wasi__)
// Nothing.
#elif defined(XP_UNIX) && !defined(XP_DARWIN)
Expand Down
2 changes: 1 addition & 1 deletion js/src/gc/GC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
#include "proxy/DeadObjectProxy.h"
#include "util/DifferentialTesting.h"
#include "util/Poison.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/BigIntType.h"
#include "vm/GetterSetter.h"
#include "vm/HelperThreadState.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/gc/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#ifdef XP_WIN

# include "util/Windows.h"
# include "util/WindowsWrapper.h"
# include <psapi.h>

#else
Expand Down
2 changes: 1 addition & 1 deletion js/src/jit/Ion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include "js/Printf.h"
#include "js/UniquePtr.h"
#include "util/Memory.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/HelperThreads.h"
#include "vm/Realm.h"
#include "vm/TraceLogging.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/jit/ProcessExecutableMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "threading/Mutex.h"
#include "util/Memory.h"
#include "util/Poison.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/MutexIDs.h"

#ifdef XP_WIN
Expand Down
2 changes: 1 addition & 1 deletion js/src/jit/arm64/vixl/MozCpu-vixl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "jit/arm64/vixl/Cpu-vixl.h"
#include "jit/arm64/vixl/Simulator-vixl.h"
#include "jit/arm64/vixl/Utils-vixl.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"

#if defined(XP_DARWIN)
# include <libkern/OSCacheControl.h>
Expand Down
2 changes: 1 addition & 1 deletion js/src/jsapi-tests/testGCAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "jsapi-tests/tests.h"

#if defined(XP_WIN)
# include "util/Windows.h"
# include "util/WindowsWrapper.h"
# include <psapi.h>
#elif defined(__wasi__)
// Nothing.
Expand Down
2 changes: 1 addition & 1 deletion js/src/jsapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4190,7 +4190,7 @@ JS_PUBLIC_API bool JS_GetGlobalJitCompilerOption(JSContext* cx,
#if !defined(STATIC_EXPORTABLE_JS_API) && !defined(STATIC_JS_API) && \
defined(XP_WIN)

# include "util/Windows.h"
# include "util/WindowsWrapper.h"

/*
* Initialization routine for the JS DLL.
Expand Down
2 changes: 1 addition & 1 deletion js/src/jsmath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "jit/InlinableNatives.h"
#include "js/Class.h"
#include "js/PropertySpec.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/JSAtom.h"
#include "vm/JSContext.h"
#include "vm/Realm.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/shell/OSObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include "util/GetPidProvider.h" // getpid()
#include "util/StringBuffer.h"
#include "util/Text.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/JSObject.h"
#include "vm/TypedArrayObject.h"

Expand Down
2 changes: 1 addition & 1 deletion js/src/shell/js.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
#include "util/DifferentialTesting.h"
#include "util/StringBuffer.h"
#include "util/Text.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/ArgumentsObject.h"
#include "vm/Compression.h"
#include "vm/ErrorObject.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/threading/windows/CpuCount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "threading/CpuCount.h"

#include "util/Windows.h"
#include "util/WindowsWrapper.h"

uint32_t js::GetCPUCount() {
static uint32_t ncpus = 0;
Expand Down
2 changes: 1 addition & 1 deletion js/src/threading/windows/ThreadPlatformData.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "threading/Thread.h"

#include "util/Windows.h"
#include "util/WindowsWrapper.h"

namespace js {

Expand Down
2 changes: 1 addition & 1 deletion js/src/util/NativeStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "mozilla/Assertions.h" // MOZ_ASSERT, MOZ_RELEASE_ASSERT, MOZ_CRASH

#ifdef XP_WIN
# include "util/Windows.h"
# include "util/WindowsWrapper.h"
#elif defined(__wasi__)
// Nothing
#elif defined(XP_DARWIN) || defined(DARWIN) || defined(XP_UNIX)
Expand Down
2 changes: 1 addition & 1 deletion js/src/util/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "jstypes.h"

#include "util/Poison.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/HelperThreads.h"

using namespace js;
Expand Down
6 changes: 3 additions & 3 deletions js/src/util/Windows.h → js/src/util/WindowsWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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/. */

#ifndef util_Windows_h
#define util_Windows_h
#ifndef util_WindowsWrapper_h
#define util_WindowsWrapper_h

/*
* This file is a wrapper around <windows.h> to prevent the mangling of
Expand All @@ -25,4 +25,4 @@
# undef PASSTHROUGH
#endif

#endif /* util_Windows_h */
#endif /* util_WindowsWrapper_h */
2 changes: 1 addition & 1 deletion js/src/vm/ArrayBufferObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include "js/PropertySpec.h"
#include "js/SharedArrayBuffer.h"
#include "js/Wrapper.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/GlobalObject.h"
#include "vm/Interpreter.h"
#include "vm/JSContext.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/JSContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include "util/DoubleToString.h"
#include "util/NativeStack.h"
#include "util/Text.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/BytecodeUtil.h" // JSDVG_IGNORE_STACK
#include "vm/ErrorObject.h"
#include "vm/ErrorReporting.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/JSObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include "proxy/DeadObjectProxy.h"
#include "util/Memory.h"
#include "util/Text.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/ArgumentsObject.h"
#include "vm/BytecodeUtil.h"
#include "vm/DateObject.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/Printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "js/CharacterEncoding.h"
#include "util/Memory.h"
#include "util/Text.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/JSContext.h"

using mozilla::PodCopy;
Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#if JS_HAS_INTL_API
# include "unicode/uloc.h"
#endif
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/DateTime.h"
#include "vm/JSAtom.h"
#include "vm/JSObject.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/TypedArrayObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "js/Wrapper.h"
#include "util/DifferentialTesting.h"
#include "util/Text.h"
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
#include "vm/ArrayBufferObject.h"
#include "vm/FunctionFlags.h" // js::FunctionFlags
#include "vm/GlobalObject.h"
Expand Down
2 changes: 1 addition & 1 deletion js/src/vtune/ittnotify_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@

/* OS communication functions */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#include "util/Windows.h"
#include "util/WindowsWrapper.h"
typedef HMODULE lib_t;
typedef DWORD TIDT;
typedef CRITICAL_SECTION mutex_t;
Expand Down
4 changes: 2 additions & 2 deletions js/src/wasm/WasmSignalHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "wasm/WasmInstance.h"

#if defined(XP_WIN)
# include <winternl.h> // must include before util/Windows.h's `#undef`s
# include "util/Windows.h"
# include <winternl.h> // must include before util/WindowsWrapper.h's `#undef`s
# include "util/WindowsWrapper.h"
#elif defined(XP_DARWIN)
# include <mach/exc.h>
# include <mach/mach.h>
Expand Down

0 comments on commit e6c31ee

Please sign in to comment.