Skip to content

Commit

Permalink
fix define versions in compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
HarpyWar committed May 6, 2018
1 parent 8fba1e9 commit 583dfab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ MurmurVersionCompiler/bin/
MurmurVersionCompiler/obj/
MurmurVersionCompiler/slice2cs/
MurmurTest/
.localhistory/
*.suo
*.user
*.prr
Expand Down
14 changes: 11 additions & 3 deletions MurmurVersionCompiler/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ static void Main(string[] args)
var v = Path.GetFileName(f).Replace("Murmur_", "").Replace(".cs", "");
versions.Add(v);
}


// cerrect sort
versions.Sort((x, y) => {
return x.CompareTo(y);
});

foreach (var v in versions)
{
contentDic.Clear();
Expand Down Expand Up @@ -71,17 +76,20 @@ static void Main(string[] args)
static void Build(string version)
{
string shortVersion = version.Replace(".", "");
string _shortVersion;

// add all versions on defines
// add current version, including all previous, to defines
string defines = "";
foreach (var v in versions)
{
defines += string.Format("MURMUR_{0};", shortVersion);
_shortVersion = v.Replace(".", "");
defines += string.Format("MURMUR_{0};", _shortVersion);

// stop adding constants
if (v == version)
break;
}

// Instantiate a new Engine object
var engine = new Engine();

Expand Down

0 comments on commit 583dfab

Please sign in to comment.