Skip to content

Commit

Permalink
fixed gha
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben2020 committed Jan 19, 2025
1 parent a31c67b commit dac0495
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Print env
run: |
Expand Down
10 changes: 10 additions & 0 deletions THIRDPARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ License file: [querylib/getopt2.h](querylib/getopt2.h)
Linking method: Static linking
Distribution method: Included in CodeQuery binaries

winmain.cpp from gosu project
-----------------------------
Title: WinMain.cpp (gosu)
Author: Julian Raschke, Jan Lücker, cyberarm, and all
Source: https://github.com/gosu/gosu/blob/master/src/WinMain.cpp
License: MIT
License file: [gui/winmain.cpp](gui/winmain.cpp)
Linking method: Static linking
Distribution method: Included in CodeQuery binaries for Windows

showgraph
---------
Title: showgraph
Expand Down
66 changes: 29 additions & 37 deletions gui/winmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Taken from:
This license applies only to this file:
Copyright (C) 2001-2017 Julian Raschke, Jan Lücker and all contributors.
Copyright (C) 2001-2023 Julian Raschke, Jan Lücker, cyberarm, and all
other contributors: https://github.com/gosu/gosu/graphs/contributors
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand All @@ -27,58 +28,51 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Julian Raschke <[email protected]> & contributors
http://www.libgosu.org/
https://www.libgosu.org/
*/

//#ifdef _MSC_VER
#ifdef _WIN32

#include <windows.h>
#include <exception>
#include <string>
#include <vector>
#include <windows.h>
using namespace std;

vector<string> splitCmdLine()
vector<string> split_cmd_line()
{
vector<string> result;

const char* cmdLine = ::GetCommandLineA();
const char* cmd_line = ::GetCommandLineA();

const char* argBegin = 0;
bool isQuotedArg = false;
const char* arg_begin = nullptr;
bool is_quoted_arg = false;

while (*cmdLine)
{
if (*cmdLine == '"')
{
if (argBegin == 0)
{
argBegin = cmdLine + 1;
isQuotedArg = true;
while (*cmd_line) {
if (*cmd_line == '"') {
if (arg_begin == nullptr) {
arg_begin = cmd_line + 1;
is_quoted_arg = true;
}
else if (isQuotedArg)
{
result.push_back(std::string(argBegin, cmdLine));
argBegin = 0;
else if (is_quoted_arg) {
result.push_back(string(arg_begin, cmd_line));
arg_begin = nullptr;
}
}
else if (!isspace((unsigned char)*cmdLine) && argBegin == 0)
{
argBegin = cmdLine;
isQuotedArg = false;
else if (!isspace((unsigned char)*cmd_line) && arg_begin == nullptr) {
arg_begin = cmd_line;
is_quoted_arg = false;
}
else if (isspace((unsigned char)*cmdLine) && argBegin != 0 && !isQuotedArg)
{
result.push_back(std::string(argBegin, cmdLine + 1));
argBegin = 0;
else if (isspace((unsigned char)*cmd_line) && arg_begin != nullptr && !is_quoted_arg) {
result.push_back(string(arg_begin, cmd_line + 1));
arg_begin = nullptr;
}
++cmdLine;
++cmd_line;
}

if (argBegin != 0)
result.push_back(argBegin);
if (arg_begin != 0) result.push_back(arg_begin);

return result;
}
Expand All @@ -87,20 +81,18 @@ int main(int argc, char* argv[]);

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
vector<string> arguments = splitCmdLine();
try {
vector<string> arguments = split_cmd_line();
vector<char*> argv(arguments.size());
for (unsigned i = 0; i < argv.size(); ++i)
for (unsigned i = 0; i < argv.size(); ++i) {
argv[i] = const_cast<char*>(arguments[i].c_str());
}
return main(argv.size(), &argv[0]);
}
catch (const std::exception& e)
{
catch (const exception& e) {
::MessageBoxA(0, e.what(), "Uncaught Exception", MB_OK | MB_ICONERROR);
return EXIT_FAILURE;
}
}

#endif

2 changes: 1 addition & 1 deletion windows-install/qt6/buildqt6.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ cd output
windeployqt --release codequery.exe
dir/b/a/s
candle.exe -ext WixUIExtension -ext WixUtilExtension "c:\workspace\codequery\windows-install\qt6\codequeryqt690.wxs"
light.exe -ext WixUIExtension -ext WixUtilExtension codequeryqt671.wixobj
light.exe -ext WixUIExtension -ext WixUtilExtension codequeryqt690.wixobj

0 comments on commit dac0495

Please sign in to comment.