shithub: rgbds

Download patch

ref: 65121e6d5d2b9cb15283a0d5c46addeb67d20a7b
parent: c86e6fef0ac5f7432bec75b4a3571fc588beaaeb
author: Trung Lê <[email protected]>
date: Tue Apr 7 10:48:30 EDT 2020

Fix multiple definitions for GCC10

--- a/include/gfx/main.h
+++ b/include/gfx/main.h
@@ -83,7 +83,7 @@
 	int size;
 };
 
-int depth, colors;
+extern int depth, colors;
 
 #include "gfx/makepng.h"
 #include "gfx/gb.h"
--- a/src/gfx/gb.c
+++ b/src/gfx/gb.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "gfx/main.h"
+#include "gfx/gb.h"
 
 void transpose_tiles(struct GBImage *gb, int width)
 {
--- a/src/gfx/main.c
+++ b/src/gfx/main.c
@@ -15,6 +15,8 @@
 #include "extern/getopt.h"
 #include "version.h"
 
+int depth, colors;
+
 /* Short options */
 static char const *optstring = "Aa:CDd:Ffhmo:Pp:Tt:uVvx:";
 
--- a/src/gfx/makepng.c
+++ b/src/gfx/makepng.c
@@ -11,7 +11,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "gfx/main.h"
+#include "gfx/makepng.h"
 
 static void initialize_png(struct PNGImage *img, FILE * f);
 static struct RawIndexedImage *indexed_png_to_raw(struct PNGImage *img);