File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 2828#include < cstring>
2929#include < locale>
3030#include < ranges>
31- #include < regex> // NOLINT(build/c++11)
3231#include " node_revert.h"
3332#include " util.h"
3433
34+ #ifdef _WIN32
35+ #include < regex> // NOLINT(build/c++11)
36+ #endif // _WIN32
37+
3538#define CHAR_TEST (bits, name, expr ) \
3639 template <typename T> \
3740 bool name (const T ch) { \
@@ -588,9 +591,8 @@ constexpr std::string_view FastStringKey::as_string_view() const {
588591 return name_;
589592}
590593
591- // Inline so the compiler can fully optimize it away on Unix platforms.
592- bool IsWindowsBatchFile (const char * filename) {
593594#ifdef _WIN32
595+ inline bool IsWindowsBatchFile (const char * filename) {
594596 std::string file_with_extension = filename;
595597 // Regex to match the last extension part after the last dot, ignoring
596598 // trailing spaces and dots
@@ -603,12 +605,8 @@ bool IsWindowsBatchFile(const char* filename) {
603605 }
604606
605607 return !extension.empty () && (extension == " cmd" || extension == " bat" );
606- #else
607- return false ;
608- #endif // _WIN32
609608}
610609
611- #ifdef _WIN32
612610inline std::wstring ConvertToWideString (const std::string& str,
613611 UINT code_page) {
614612 int size_needed = MultiByteToWideChar (
Original file line number Diff line number Diff line change @@ -1026,9 +1026,12 @@ v8::Maybe<int> GetValidFileMode(Environment* env,
10261026 v8::Local<v8::Value> input,
10271027 uv_fs_type type);
10281028
1029+ #ifdef _WIN32
10291030// Returns true if OS==Windows and filename ends in .bat or .cmd,
10301031// case insensitive.
10311032inline bool IsWindowsBatchFile (const char * filename);
1033+ inline std::wstring ConvertToWideString (const std::string& str, UINT code_page);
1034+ #endif // _WIN32
10321035
10331036} // namespace node
10341037
You can’t perform that action at this time.
0 commit comments