Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS - try to address errors (std::array, fgets) #571

Merged
merged 2 commits into from
Sep 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions commandLine/src/utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@
#include <iostream>
#include <fstream>
#include <string>
#include <regex>
#include <array>
#include <stdio.h>

#ifdef TARGET_WIN32
#include <direct.h>

#define GetCurrentDir _getcwd
#include <direct.h>
#define GetCurrentDir _getcwd
#elif defined(TARGET_LINUX)
#include <unistd.h>
#define GetCurrentDir getcwd
#include <unistd.h>
#define GetCurrentDir getcwd
#else
#include <mach-o/dyld.h> /* _NSGetExecutablePath */
#include <limits.h> /* PATH_MAX */
#include <mach-o/dyld.h> /* _NSGetExecutablePath */
#include <limits.h> /* PATH_MAX */
#endif

#include <regex>

using std::unique_ptr;

Expand All @@ -61,12 +62,6 @@ std::string execute_popen(const char* cmd) {
auto rc = pclose(pipe);
#endif


if (rc == EXIT_SUCCESS) { // == 0

} else if (rc == EXIT_FAILURE) { // EXIT_FAILURE is not used by all programs, maybe needs some adaptation.

}
// trim last line break
result.pop_back();
return result;
Expand Down