Skip to content

Commit

Permalink
Fix prototype code.
Browse files Browse the repository at this point in the history
  • Loading branch information
chuggafan committed Jan 4, 2025
1 parent c232d9a commit ec02055
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 98 deletions.
15 changes: 11 additions & 4 deletions src/omake/MakeMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,18 @@ bool MakeMain::LoadJobArgs()
}
void MakeMain::LoadEnvironment()
{
#ifdef TARGET_OS_WINDOWS
char** env = environ;
#else
char** env = 0;
// https://www.man7.org/linux/man-pages/man7/environ.7.html
/*
*Historically and by standard, environ must be declared in the
*user program. However, as a (nonstandard) programmer
*convenience, environ is declared in the header file <unistd.h> if
*the _GNU_SOURCE feature test macro is defined (see
*feature_test_macros(7)).
*/
#ifndef TARGET_OS_WINDOWS
extern char** environ;
#endif
char** env = environ;
Variable::Origin origin;
if (environOverride.GetValue())
origin = Variable::o_environ_override;
Expand Down
2 changes: 1 addition & 1 deletion src/omake/Maker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Maker::Maker(bool Silent, bool DisplayOnly, bool IgnoreResults, bool Touch, Outp
Variable* v = VariableContainer::Instance()->Lookup("SHELL");
std::string shtest = v->GetValue();
std::transform(shtest.begin(), shtest.end(), shtest.begin(), ::toupper);
OS::SetSHEXE(shtest.find("SH.EXE") != std::string::npos || shtest.find("BASH.EXE") != std::string::npos);
OS::SetSHEXE(shtest.find("sh") != std::string::npos);
}
Maker::~Maker() {}
void Maker::SetFirstGoal(const std::string& name)
Expand Down
18 changes: 10 additions & 8 deletions src/omake/Variable.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/* Software License Agreement
*
*
* Copyright(C) 1994-2024 David Lindauer, (LADSoft)
*
*
* This file is part of the Orange C Compiler package.
*
*
* The Orange C Compiler package is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* The Orange C Compiler package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with Orange C. If not, see <http://www.gnu.org/licenses/>.
*
*
* contact information:
* email: [email protected] <David Lindauer>
*
*
*
*
*/

#include "Variable.h"
Expand Down Expand Up @@ -85,6 +85,8 @@ Variable* VariableContainer::Lookup(const std::string& name)
}
void VariableContainer::operator+(Variable* variable)
{
if (!variable)
return;
std::unique_ptr<Variable> temp(variable);
if (variable->GetName().find_first_of('%') != std::string::npos)
{
Expand Down
Loading

0 comments on commit ec02055

Please sign in to comment.