-
-
Save ibuclaw/d1fad77b074fded2682a16df93369a84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/source/main.d b/source/main.d | |
index e366b3c..e7db6e8 100644 | |
--- a/source/main.d | |
+++ b/source/main.d | |
@@ -20,7 +20,7 @@ import trace = stm32f42.trace; | |
import statusLED = board.statusLED; | |
import random = board.random; | |
-void main() | |
+int main(char[][] args) | |
{ | |
lcd.fillRect(0, 0, lcd.getWidth(), lcd.getHeight(), 0x07E0); | |
@@ -41,4 +41,5 @@ void main() | |
statusLED.toggle(); | |
} | |
+ return 0; | |
} | |
\ No newline at end of file | |
diff --git a/source/runtime/__entrypoint.d b/source/runtime/__entrypoint.d | |
index a78e3ac..c6a421a 100644 | |
--- a/source/runtime/__entrypoint.d | |
+++ b/source/runtime/__entrypoint.d | |
@@ -3,10 +3,9 @@ | |
// See https://github.com/D-Programming-GDC/GDC/blob/48384612969fe90bdf88f562d1017bd8c5ec8612/gcc/d/d-lang.cc#L747 | |
module __entrypoint; | |
-extern(C) int _Dmain(char[][] args); | |
-extern(C) int _d_run_main(int argc, char **argv, void* mainFunc); | |
- | |
extern(C) int main(int argc, char **argv) | |
{ | |
- return _d_run_main(argc, argv, &_Dmain); | |
+ static import dmain2; | |
+ static import main; | |
+ return dmain2._d_run_main(argc, argv, &main.main); | |
} | |
\ No newline at end of file | |
diff --git a/source/runtime/dmain2.d b/source/runtime/dmain2.d | |
index ac83bc8..9754017 100644 | |
--- a/source/runtime/dmain2.d | |
+++ b/source/runtime/dmain2.d | |
@@ -1,6 +1,6 @@ | |
module dmain2; | |
-private alias extern(C) int function(char[][] args) MainFunc; | |
+private alias int function(char[][] args) MainFunc; | |
extern (C) int _d_run_main(int argc, char **argv, MainFunc mainFunc) | |
{ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment