Skip to content Navigation Menu Toggle navigation Sign in Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests... Search Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Saved searches Use saved searches to filter your results more quickly Name Query To see all available qualifiers, see our documentation. Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} anonrig / node Public forked from nodejs/node Notifications You must be signed in to change notification settings Fork 0 Star 5 Code Pull requests 5 Projects Security and quality 0 Insights Additional navigation options Code Pull requests Projects Security and quality Insights FilesExpand file tree mainBreadcrumbsnode/tools/executable_wrapper.hCopy pathBlameMore file actionsBlameMore file actions Latest commit HistoryHistoryHistory55 lines (48 loc) · 1.48 KB mainBreadcrumbsnode/tools/executable_wrapper.hCopy pathTopFile metadata and controlsCodeBlame55 lines (48 loc) · 1.48 KBRawCopy raw fileDownload raw fileOpen symbols panelEdit and raw actions12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455#ifndef TOOLS_EXECUTABLE_WRAPPER_H_#define TOOLS_EXECUTABLE_WRAPPER_H_ // TODO(joyeecheung): reuse this in mksnapshot.#include "uv.h"#ifdef _WIN32#include <windows.h>#endif namespace node {#ifdef _WIN32using argv_type = wchar_t*;#define NODE_MAIN int wmain void FixupMain(int argc, argv_type raw_argv[], char*** argv) { // Convert argv to UTF8. *argv = new char*[argc + 1]; for (int i = 0; i < argc; i++) { // Compute the size of the required buffer DWORD size = WideCharToMultiByte( CP_UTF8, 0, raw_argv[i], -1, nullptr, 0, nullptr, nullptr); if (size == 0) { // This should never happen. fprintf(stderr, "Could not convert arguments to utf8."); exit(1); } // Do the actual conversion (*argv)[i] = new char[size]; DWORD result = WideCharToMultiByte( CP_UTF8, 0, raw_argv[i], -1, (*argv)[i], size, nullptr, nullptr); if (result == 0) { // This should never happen. fprintf(stderr, "Could not convert arguments to utf8."); exit(1); } } (*argv)[argc] = nullptr;}#else using argv_type = char*;#define NODE_MAIN int main void FixupMain(int argc, argv_type raw_argv[], char*** argv) { *argv = uv_setup_args(argc, raw_argv); // Disable stdio buffering, it interacts poorly with printf() // calls elsewhere in the program (e.g., any logging from V8.) setvbuf(stdout, nullptr, _IONBF, 0); setvbuf(stderr, nullptr, _IONBF, 0);}#endif } // namespace node #endif // TOOLS_EXECUTABLE_WRAPPER_H_ You can’t perform that action at this time.