Skip to content

Commit

Permalink
Merge pull request #189 from jsakkine/cdecl
Browse files Browse the repository at this point in the history
Remove redunant definitions
  • Loading branch information
baconpaul authored Jan 4, 2019
2 parents ad8509d + 1318ff9 commit c771131
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
5 changes: 0 additions & 5 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ if (os.istarget("macosx")) then
{
"_aligned_malloc(x,a)=malloc(x)",
"_aligned_free(x)=free(x)",
"stricmp=strcasecmp",
"SSE_VERSION=3",
"MAC_COCOA=1",
"COCOA=1",
"OBJC_OLD_DISPATCH_PROTOTYPES=1"
Expand Down Expand Up @@ -71,9 +69,6 @@ elseif (os.istarget("linux")) then
{
"_aligned_malloc(x,a)=malloc(x)",
"_aligned_free(x)=free(x)",
"stricmp=strcasecmp",
"SSE_VERSION=3",
"__cdecl="
}

links
Expand Down
4 changes: 2 additions & 2 deletions src/common/Sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ bool Sample::load(const char* file_name)
*comma = 0;
}

if (!stricmp(extension, "wav"))
if (!_stricmp(extension, "wav"))
{
bool result = this->load_riff_wave_mk2(filename);
return result;
}
return false;
}

#endif
#endif
6 changes: 3 additions & 3 deletions src/common/SurgeStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void SurgeStorage::refreshPatchlistAddDir(bool userDir, string subdir)

for (auto& f : fs::directory_iterator(p))
{
if (stricmp(f.path().extension().c_str(), ".fxp") == 0)
if (_stricmp(f.path().extension().c_str(), ".fxp") == 0)
{
patchlist_entry e;
e.category = category;
Expand Down Expand Up @@ -345,7 +345,7 @@ void SurgeStorage::refresh_wtlist()

for (auto& f : fs::directory_iterator(p))
{
if (stricmp(f.path().extension().c_str(),".wt") == 0)
if (_stricmp(f.path().extension().c_str(),".wt") == 0)
{
patchlist_entry e;
e.category = category;
Expand All @@ -354,7 +354,7 @@ void SurgeStorage::refresh_wtlist()
e.name = e.name.substr(0, e.name.size() - 3);
wt_list.push_back(e);
}
else if (stricmp(f.path().extension().c_str(),".wav") == 0)
else if (_stricmp(f.path().extension().c_str(),".wav") == 0)
{
patchlist_entry e;
e.category = category;
Expand Down
5 changes: 0 additions & 5 deletions src/common/dsp/DspUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,7 @@ inline bool is_yes(const char* str)
{
if (!str)
return 0;
#if WINDOWS
if (_stricmp(str, "yes") == 0)
return 1;
#else
if (strcasecmp(str, "yes") == 0)
return 1;
#endif
return 0;
}
9 changes: 9 additions & 0 deletions src/common/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@

using namespace std;

#if MAC || __linux__
#include <strings.h>

static inline int _stricmp(const char *s1, const char *s2)
{
return strcasecmp(s1, s2);
}
#endif

const int namechars = 64;
const int block_size = 32;
const int osc_oversampling = 2;
Expand Down
2 changes: 1 addition & 1 deletion src/common/gui/CSurgeSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ CSurgeSlider::~CSurgeSlider()

void CSurgeSlider::setLabel(const char* txt)
{
if (!stricmp(txt, "filter balance"))
if (!_stricmp(txt, "filter balance"))
{
strcpy(label, "F2");
strcpy(leftlabel, "F1");
Expand Down

0 comments on commit c771131

Please sign in to comment.