osfhandle.cc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright (c) 2016 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #include "osfhandle.h"
  5. #if !defined(DEBUG)
  6. #define U_I18N_IMPLEMENTATION
  7. #define U_COMMON_IMPLEMENTATION
  8. #define U_COMBINED_IMPLEMENTATION
  9. #endif
  10. #include "third_party/icu/source/common/unicode/ubidi.h"
  11. #include "third_party/icu/source/common/unicode/uchar.h"
  12. #include "third_party/icu/source/common/unicode/uidna.h"
  13. #include "third_party/icu/source/common/unicode/unistr.h"
  14. #include "third_party/icu/source/common/unicode/unorm.h"
  15. #include "third_party/icu/source/common/unicode/urename.h"
  16. #include "third_party/icu/source/common/unicode/ustring.h"
  17. #include "third_party/icu/source/i18n/unicode/dtitvfmt.h"
  18. #include "third_party/icu/source/i18n/unicode/measfmt.h"
  19. #include "third_party/icu/source/i18n/unicode/translit.h"
  20. #include "third_party/icu/source/i18n/unicode/ucsdet.h"
  21. #include "third_party/icu/source/i18n/unicode/ulocdata.h"
  22. #include "third_party/icu/source/i18n/unicode/uregex.h"
  23. #include "third_party/icu/source/i18n/unicode/usearch.h"
  24. #include "third_party/icu/source/i18n/unicode/uspoof.h"
  25. #include "v8-inspector.h"
  26. #include "v8-profiler.h"
  27. namespace node {
  28. void ReferenceSymbols() {
  29. // Following symbols are used by electron.exe but got stripped by compiler,
  30. // by using the symbols we can force compiler to keep the objects in node.dll,
  31. // thus electron.exe can link with the exported symbols.
  32. // v8_profiler symbols:
  33. v8::TracingCpuProfiler::Create(nullptr);
  34. // v8_inspector symbols:
  35. reinterpret_cast<v8_inspector::V8InspectorSession*>(nullptr)
  36. ->canDispatchMethod(v8_inspector::StringView());
  37. reinterpret_cast<v8_inspector::V8InspectorClient*>(nullptr)->unmuteMetrics(0);
  38. // icu symbols:
  39. u_errorName(U_ZERO_ERROR);
  40. ubidi_setPara(nullptr, nullptr, 0, 0, nullptr, nullptr);
  41. ucsdet_getName(nullptr, nullptr);
  42. uidna_openUTS46(UIDNA_CHECK_BIDI, nullptr);
  43. ulocdata_close(nullptr);
  44. unorm_normalize(nullptr, 0, UNORM_NFC, 0, nullptr, 0, nullptr);
  45. uregex_matches(nullptr, 0, nullptr);
  46. uspoof_open(nullptr);
  47. usearch_setPattern(nullptr, nullptr, 0, nullptr);
  48. usearch_setPattern(nullptr, nullptr, 0, nullptr);
  49. UMeasureFormatWidth width = UMEASFMT_WIDTH_WIDE;
  50. UErrorCode status = U_ZERO_ERROR;
  51. icu::MeasureFormat format(icu::Locale::getRoot(), width, status);
  52. icu::DateInterval internal(0, 0);
  53. icu::DateIntervalFormat::createInstance(UnicodeString(),
  54. icu::Locale::getRoot(), status);
  55. reinterpret_cast<icu::Transliterator*>(nullptr)->clone();
  56. UParseError parse_error;
  57. icu::Transliterator::createFromRules(UnicodeString(), UnicodeString(),
  58. UTRANS_FORWARD, parse_error, status);
  59. }
  60. } // namespace node