Menu

#6 Patch for GCC 9.x

open
nobody
patch (1)
1
2020-10-15
2020-10-15
Bob B.
No

GCC 9.x patch

Here's a patch for compiling GLtron using GCC 9.x (also attached to this post):

--- lua/src/lib/liolib_old.c    2020-10-15 13:00:10.814884200 +0000
+++ lua/src/lib/liolib.c    2020-10-15 12:17:10.876159100 +0000
@@ -10,6 +10,7 @@
 #include <stdio.h>
 #define __USE_MISC /* for mkstemp() */
 #include <stdlib.h>
+#include <stdint.h>
 #include <string.h>
 #include <time.h>
 #include <assert.h>
--- nebu/scripting/scripting_old.c  2020-10-15 13:00:00.302948300 +0000
+++ nebu/scripting/scripting.c  2020-10-15 12:57:32.583060500 +0000
@@ -169,16 +169,16 @@
   return status;
 }    

-void scripting_RunFile(char *name) {
+void scripting_RunFile(const char *name) {
   lua_dofile(L, name);
 }

-void scripting_Run(char *command) {
+void scripting_Run(const char *command) {
   /* fprintf(stderr, "[command] %s\n", command); */
   lua_dostring(L, command);
 }

-void scripting_RunFormat(char *format, ... ) {
+void scripting_RunFormat(const char *format, ... ) {
   char buf[4096];
   va_list ap;
   va_start(ap, format);

To apply the patch file, move it to the directory containing the gltron source (gltron-0.70) and run patch -p0 < patch.diff

Additional notes

When running ./configure add the flag --enable-warn=off or else the program won't compile because it will treat warnings as errors.

If you're adding --enable-localdata then delete all Makefiles in the music directory before running the game, there should be only one file remaining there named song_revenge_of_cats.it

1 Attachments

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.