Skip to content

Instantly share code, notes, and snippets.

View genuinelucifer's full-sized avatar

Abhinav Tripathi genuinelucifer

  • Indore, Madhya Pradesh
View GitHub Profile
public override bool VisitMethodDecl(Method method)
{
var expansions = method.PreprocessedEntities.OfType<MacroExpansion>();
if (expansions.Any(e => e.Text == Prefix + "_HASHCODE"
|| e.Text == Prefix + "_EQUALS"))
method.ExplicitlyIgnore();
/* I added this */
if (expansions.Any(e => e.Text == Prefix + "_INTERNAL")) //Flag a method as internal to an assembly
method.Access = AccessSpecifier.Internal; // Something like --> method.Access=internal;
index 1e1a59a..9a8b0b5 100644
--- a/examples/SDL/SDL.cs
+++ b/examples/SDL/SDL.cs
@@ -10,7 +10,7 @@ public void Setup(Driver driver)
var options = driver.Options;
options.LibraryName = "SDL";
options.Headers.Add("SDL.h");
- options.addIncludeDirs("../../../examples/SDL/SDL-2.0/include");
+ options.addIncludeDirs("../../examples/SDL/SDL-2.0/include");
options.OutputDir = "SDL";
diff --git a/src/AST/Class.cs b/src/AST/Class.cs
index 45b535f..07e1d53 100644
--- a/src/AST/Class.cs
+++ b/src/AST/Class.cs
@@ -10,7 +10,8 @@ public enum AccessSpecifier
{
Private,
Protected,
- Public
+ Public,
diff --git a/src/AST/Class.cs b/src/AST/Class.cs
index 45b535f..07e1d53 100644
--- a/src/AST/Class.cs
+++ b/src/AST/Class.cs
@@ -10,7 +10,8 @@ public enum AccessSpecifier
{
Private,
Protected,
- Public
+ Public,
@genuinelucifer
genuinelucifer / cs_internal_final.diff
Created May 11, 2015 05:46
Complete CS_INTERNAL Implementation and testing
diff --git a/src/AST/Class.cs b/src/AST/Class.cs
index 45b535f..07e1d53 100644
--- a/src/AST/Class.cs
+++ b/src/AST/Class.cs
@@ -10,7 +10,8 @@ public enum AccessSpecifier
{
Private,
Protected,
- Public
+ Public,
@genuinelucifer
genuinelucifer / varGeneration.diff
Created May 13, 2015 13:28
Trying to re-create variable regeneration issue
diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h
index 488dd2c..41fdc5e 100644
--- a/tests/Basic/Basic.h
+++ b/tests/Basic/Basic.h
@@ -6,6 +6,9 @@
#endif
#include <string>
+static int staticTest;
+int normalTest;
@genuinelucifer
genuinelucifer / anonNesting.diff
Created May 14, 2015 03:34
compilable code when nesting more than one anonymous type! :)
diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generat
index ef0a242..1baed7a 100644
--- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs
+++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs
@@ -34,11 +34,27 @@ public static class Helpers
"void", "partial", "yield", "where"
};
+ private static int numSafeIden = 0;
public static string SafeIdentifier(string id)
@genuinelucifer
genuinelucifer / oneArray.diff
Created May 19, 2015 06:47
CS_VALUE_TYPE struct incompilable even with one array...
diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h
index 488dd2c..62ec2a8 100644
--- a/tests/Basic/Basic.h
+++ b/tests/Basic/Basic.h
@@ -710,3 +710,17 @@ public:
bool operator ==(const DifferentConstOverloads& other);
bool operator ==(int number) const;
};
+
+#define SCE_NP_ONLINEID_MAX_LENGTH 5
diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generato
index eb00737..bc6da59 100644
--- a/src/Generator/Generators/CLI/CLIMarshal.cs
+++ b/src/Generator/Generators/CLI/CLIMarshal.cs
@@ -40,13 +40,16 @@ public override bool VisitTagType(TagType tag, TypeQualifier
return decl.Visit(this);
}
+ private static int _arrayNum = 0;
public override bool VisitArrayType(ArrayType array, TypeQualifiers qua
diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generato
index eb00737..bc6da59 100644
--- a/src/Generator/Generators/CLI/CLIMarshal.cs
+++ b/src/Generator/Generators/CLI/CLIMarshal.cs
@@ -40,13 +40,16 @@ public override bool VisitTagType(TagType tag, TypeQualifier
return decl.Visit(this);
}
+ private static int _arrayNum = 0;
public override bool VisitArrayType(ArrayType array, TypeQualifiers qua