summaryrefslogtreecommitdiffstats
path: root/xpcom/build/PoisonIOInterposer.h
diff options
context:
space:
mode:
Diffstat (limited to 'xpcom/build/PoisonIOInterposer.h')
-rw-r--r--xpcom/build/PoisonIOInterposer.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/xpcom/build/PoisonIOInterposer.h b/xpcom/build/PoisonIOInterposer.h
index 20adeb835b..3217027b9a 100644
--- a/xpcom/build/PoisonIOInterposer.h
+++ b/xpcom/build/PoisonIOInterposer.h
@@ -10,6 +10,12 @@
#include "mozilla/Types.h"
#include <stdio.h>
+#ifdef _WIN32
+typedef void* platform_handle_t;
+#else
+typedef int platform_handle_t;
+#endif
+
MOZ_BEGIN_EXTERN_C
/** Register file handle to be ignored by poisoning IO interposer. This function
@@ -18,7 +24,7 @@ MOZ_BEGIN_EXTERN_C
* when one of them links the static CRT). In such cases, giving file
* descriptors or FILEs
* doesn't work because _get_osfhandle fails with "invalid parameter". */
-void MozillaRegisterDebugHandle(intptr_t aHandle);
+void MozillaRegisterDebugHandle(platform_handle_t aHandle);
/** Register file descriptor to be ignored by poisoning IO interposer */
void MozillaRegisterDebugFD(int aFd);
@@ -27,7 +33,7 @@ void MozillaRegisterDebugFD(int aFd);
void MozillaRegisterDebugFILE(FILE* aFile);
/** Unregister file handle from being ignored by poisoning IO interposer */
-void MozillaUnRegisterDebugHandle(intptr_t aHandle);
+void MozillaUnRegisterDebugHandle(platform_handle_t aHandle);
/** Unregister file descriptor from being ignored by poisoning IO interposer */
void MozillaUnRegisterDebugFD(int aFd);
@@ -45,7 +51,7 @@ namespace mozilla {
/**
* Check if a file is registered as a debug file.
*/
-bool IsDebugFile(intptr_t aFileID);
+bool IsDebugFile(platform_handle_t aFileID);
/**
* Initialize IO poisoning, this is only safe to do on the main-thread when no
@@ -79,7 +85,7 @@ void ClearPoisonIOInterposer();
# ifdef __cplusplus
namespace mozilla {
-inline bool IsDebugFile(intptr_t aFileID) { return true; }
+inline bool IsDebugFile(platform_handle_t aFileID) { return true; }
inline void InitPoisonIOInterposer() {}
inline void ClearPoisonIOInterposer() {}
# ifdef XP_MACOSX