mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Removed obsolete io.h wrappers, included atlbase.h in atom_main.cc
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
|
||||
#include "osfhandle.h"
|
||||
|
||||
#include <io.h>
|
||||
|
||||
#if !defined(DEBUG)
|
||||
#define U_I18N_IMPLEMENTATION
|
||||
#define U_COMMON_IMPLEMENTATION
|
||||
@@ -32,14 +30,6 @@
|
||||
|
||||
namespace node {
|
||||
|
||||
int open_osfhandle(intptr_t osfhandle, int flags) {
|
||||
return _open_osfhandle(osfhandle, flags);
|
||||
}
|
||||
|
||||
int close(int fd) {
|
||||
return _close(fd);
|
||||
}
|
||||
|
||||
void ReferenceSymbols() {
|
||||
// Following symbols are used by electron.exe but got stripped by compiler,
|
||||
// by using the symbols we can force compiler to keep the objects in node.dll,
|
||||
|
||||
@@ -5,22 +5,8 @@
|
||||
#ifndef ATOM_NODE_OSFHANDLE_H_
|
||||
#define ATOM_NODE_OSFHANDLE_H_
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace node {
|
||||
|
||||
// The _open_osfhandle and _close functions on Windows are provided by the
|
||||
// Visual C++ library, so the fd returned by them can only be used in the
|
||||
// same instance of VC++ library.
|
||||
// However Electron is linking with VC++ library statically, so electron.exe
|
||||
// shares a different instance of VC++ library with node.exe. This results
|
||||
// in fd created in electron.exe not usable in node.dll, so we have to ensure
|
||||
// we always create fd in one instance of VC++ library.
|
||||
// Followings wrappers are compiled in node.dll, and all code in electron.exe
|
||||
// should call these wrappers instead of calling _open_osfhandle directly.
|
||||
__declspec(dllexport) int open_osfhandle(intptr_t osfhandle, int flags);
|
||||
__declspec(dllexport) int close(int fd);
|
||||
|
||||
// A trick to force referencing symbols.
|
||||
__declspec(dllexport) void ReferenceSymbols();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user