clwrapper.cpp

来自「linux下开源浏览器WebKit的源码,市面上的很多商用浏览器都是移植自Web」· C++ 代码 · 共 53 行

CPP
53
字号
// CLWrapper.cpp : Calls the perl script parallelcl to perform parallel compilation#define WIN32_LEAN_AND_MEAN    // Exclude rarely-used stuff from Windows headers#include <process.h>#include <stdio.h>#include <string>#include <windows.h>using namespace std;int wmain(int argc, wchar_t* argv[]){    const int numArgs = 3;#ifndef NDEBUG    fwprintf(stderr, L"######### im in ur IDE, compiling ur c0des ########\n");#endif    wstring** args = new wstring*[numArgs];    args[0] = new wstring(L"sh");    args[1] = new wstring(L"-c");    args[2] = new wstring(L"\"parallelcl");    for (int i = 1; i < argc; ++i) {        args[2]->append(L" '");        args[2]->append(argv[i]);        if (i < argc - 1)            args[2]->append(L"' ");        else            args[2]->append(L"'");    }    args[2]->append(L"\"");    for (unsigned i = 0; i < args[2]->length(); i++) {       if (args[2]->at(i) == '\\')            args[2]->at(i) = '/';    }    wchar_t** newArgv = new wchar_t*[numArgs + 1];    for (int i = 0; i < numArgs; i++)        newArgv[i] = (wchar_t*)args[i]->c_str();    newArgv[numArgs] = 0;#ifndef NDEBUG    fwprintf(stderr, L"exec(\"%s\", \"%s\", \"%s\", \"%s\")\n", L"sh", newArgv[0], newArgv[1], newArgv[2]);#endif    return _wspawnvp(_P_WAIT, L"sh", newArgv);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?