From 98d0daa2fde49741ed5b922f087f540cf0e49ebf Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Thu, 17 Jan 2019 15:58:47 -0800 Subject: [PATCH] chore: remove unused osfhandle hack (#16305) --- atom/node/osfhandle.cc | 67 ------------------------------------------ atom/node/osfhandle.h | 15 ---------- script/lint.js | 1 - 3 files changed, 83 deletions(-) delete mode 100644 atom/node/osfhandle.cc delete mode 100644 atom/node/osfhandle.h diff --git a/atom/node/osfhandle.cc b/atom/node/osfhandle.cc deleted file mode 100644 index 98fe04624af2..000000000000 --- a/atom/node/osfhandle.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2016 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#include "osfhandle.h" - -#if !defined(DEBUG) -#define U_I18N_IMPLEMENTATION -#define U_COMMON_IMPLEMENTATION -#define U_COMBINED_IMPLEMENTATION -#endif - -#include "third_party/icu/source/common/unicode/ubidi.h" -#include "third_party/icu/source/common/unicode/uchar.h" -#include "third_party/icu/source/common/unicode/uidna.h" -#include "third_party/icu/source/common/unicode/unistr.h" -#include "third_party/icu/source/common/unicode/unorm.h" -#include "third_party/icu/source/common/unicode/urename.h" -#include "third_party/icu/source/common/unicode/ustring.h" -#include "third_party/icu/source/i18n/unicode/dtitvfmt.h" -#include "third_party/icu/source/i18n/unicode/measfmt.h" -#include "third_party/icu/source/i18n/unicode/translit.h" -#include "third_party/icu/source/i18n/unicode/ucsdet.h" -#include "third_party/icu/source/i18n/unicode/ulocdata.h" -#include "third_party/icu/source/i18n/unicode/uregex.h" -#include "third_party/icu/source/i18n/unicode/usearch.h" -#include "third_party/icu/source/i18n/unicode/uspoof.h" -#include "v8-inspector.h" -#include "v8-profiler.h" - -namespace node { - -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, - // thus electron.exe can link with the exported symbols. - - // v8_profiler symbols: - v8::TracingCpuProfiler::Create(nullptr); - // v8_inspector symbols: - reinterpret_cast(nullptr) - ->canDispatchMethod(v8_inspector::StringView()); - reinterpret_cast(nullptr)->unmuteMetrics(0); - // icu symbols: - u_errorName(U_ZERO_ERROR); - ubidi_setPara(nullptr, nullptr, 0, 0, nullptr, nullptr); - ucsdet_getName(nullptr, nullptr); - uidna_openUTS46(UIDNA_CHECK_BIDI, nullptr); - ulocdata_close(nullptr); - unorm_normalize(nullptr, 0, UNORM_NFC, 0, nullptr, 0, nullptr); - uregex_matches(nullptr, 0, nullptr); - uspoof_open(nullptr); - usearch_setPattern(nullptr, nullptr, 0, nullptr); - usearch_setPattern(nullptr, nullptr, 0, nullptr); - UMeasureFormatWidth width = UMEASFMT_WIDTH_WIDE; - UErrorCode status = U_ZERO_ERROR; - icu::MeasureFormat format(icu::Locale::getRoot(), width, status); - icu::DateInterval internal(0, 0); - icu::DateIntervalFormat::createInstance(UnicodeString(), - icu::Locale::getRoot(), status); - reinterpret_cast(nullptr)->clone(); - UParseError parse_error; - icu::Transliterator::createFromRules(UnicodeString(), UnicodeString(), - UTRANS_FORWARD, parse_error, status); -} - -} // namespace node diff --git a/atom/node/osfhandle.h b/atom/node/osfhandle.h deleted file mode 100644 index 06b91ba51fb8..000000000000 --- a/atom/node/osfhandle.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2016 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#ifndef ATOM_NODE_OSFHANDLE_H_ -#define ATOM_NODE_OSFHANDLE_H_ - -namespace node { - -// A trick to force referencing symbols. -__declspec(dllexport) void ReferenceSymbols(); - -} // namespace node - -#endif // ATOM_NODE_OSFHANDLE_H_ diff --git a/script/lint.js b/script/lint.js index c84d0204490c..3d458588bc41 100755 --- a/script/lint.js +++ b/script/lint.js @@ -29,7 +29,6 @@ const BLACKLIST = new Set([ ['atom', 'common', 'common_message_generator.cc'], ['atom', 'common', 'common_message_generator.h'], ['atom', 'common', 'node_includes.h'], - ['atom', 'node', 'osfhandle.cc'], ['spec', 'static', 'jquery-2.0.3.min.js'] ].map(tokens => path.join(SOURCE_ROOT, ...tokens)))