Skip to content

Instantly share code, notes, and snippets.

@BitPuffin
Last active April 25, 2019 09:04
Show Gist options
  • Save BitPuffin/b918854e8cbe2535aa5c380cb14d420d to your computer and use it in GitHub Desktop.
Save BitPuffin/b918854e8cbe2535aa5c380cb14d420d to your computer and use it in GitHub Desktop.
preprocessor memes
#define interface void
using System;
namespace redefine
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Foo("hejsan");
Greet("Kalle Anka");
}
public static interface Foo(string msg) {
Console.WriteLine(msg);
}
#include "my_mixin.cs"
}
}
#compile with
cc -x c -P -E Program.cs -o Program1.cs
public static interface Greet(string name) {
Console.WriteLine("Hi there, " + name + "!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment