sgl

changeset 41:f4ea3a88b05a tip

macos build fixes. Patch by Andrew Woods
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 25 Jan 2025 22:26:40 +0200
parents f7de32814f34
children
files Makefile.in include/sgl.h src/wsys_cocoa.m tests/simple/simple.c tests/tests-makefile
diffstat 5 files changed, 16 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/Makefile.in	Thu Jun 28 03:42:26 2012 +0300
     1.2 +++ b/Makefile.in	Sat Jan 25 22:26:40 2025 +0200
     1.3 @@ -26,6 +26,10 @@
     1.4  CFLAGS = -pedantic -Wall -g -fPIC -Iinclude -Isrc $(wsys_cflags) $(CFLAGS_extra)
     1.5  LDFLAGS = $(wsys_libs)
     1.6  
     1.7 +ifeq ($(shell uname -s), Darwin)
     1.8 +	CFLAGS += -DGL_SILENCE_DEPRECATION
     1.9 +endif
    1.10 +
    1.11  .PHONY: all
    1.12  all: $(lib_so) $(lib_a)
    1.13  
     2.1 --- a/include/sgl.h	Thu Jun 28 03:42:26 2012 +0300
     2.2 +++ b/include/sgl.h	Sat Jan 25 22:26:40 2025 +0200
     2.3 @@ -4,7 +4,7 @@
     2.4  #ifdef __APPLE__
     2.5  #include <TargetConditionals.h>
     2.6  
     2.7 -#if defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR)
     2.8 +#if TARGET_OS_IPHONE != 0 || TARGET_IPHONE_SIMULATOR != 0
     2.9  #include <OpenGLES/ES2/gl.h>
    2.10  #else /* !iphone */
    2.11  #include <OpenGL/gl.h>
    2.12 @@ -162,4 +162,6 @@
    2.13  void sgl_button_callback(sgl_button_callback_t func);
    2.14  void sgl_idle_callback(sgl_idle_callback_t func);
    2.15  
    2.16 +void sgl_log(const char *fmt, ...);
    2.17 +
    2.18  #endif	/* SGL_H_ */
     3.1 --- a/src/wsys_cocoa.m	Thu Jun 28 03:42:26 2012 +0300
     3.2 +++ b/src/wsys_cocoa.m	Sat Jan 25 22:26:40 2025 +0200
     3.3 @@ -77,7 +77,7 @@
     3.4  
     3.5  
     3.6  static int init(void);
     3.7 -static void shutdown(void);
     3.8 +static void shutdown_app(void);
     3.9  
    3.10  /* video mode switching */
    3.11  static int set_vidmode(int xsz, int ysz);
    3.12 @@ -112,7 +112,7 @@
    3.13  static struct wsys_module ws = {
    3.14  	"cocoa", 0,
    3.15  	init,
    3.16 -	shutdown,
    3.17 +	shutdown_app,
    3.18  	set_vidmode,
    3.19  	get_vidmode,
    3.20  	create_window,
    3.21 @@ -303,7 +303,7 @@
    3.22  	return 0;
    3.23  }
    3.24  
    3.25 -static void shutdown(void)
    3.26 +static void shutdown_app(void)
    3.27  {
    3.28  	while(winlist) {
    3.29  		close_window(winlist->wid);
    3.30 @@ -423,7 +423,7 @@
    3.31  
    3.32  	if(!dummy.next) {
    3.33  		winlist = 0;
    3.34 -		shutdown();
    3.35 +		shutdown_app();
    3.36  	}
    3.37  }
    3.38  
     4.1 --- a/tests/simple/simple.c	Thu Jun 28 03:42:26 2012 +0300
     4.2 +++ b/tests/simple/simple.c	Sat Jan 25 22:26:40 2025 +0200
     4.3 @@ -5,7 +5,7 @@
     4.4  void disp(void);
     4.5  void reshape(int x, int y);
     4.6  void keyb(int key, int state);
     4.7 -void mouse(int pidx, int bn, int state, int x, int y)
     4.8 +void mouse(int pidx, int bn, int state, int x, int y);
     4.9  void motion(int pidx, int x, int y);
    4.10  
    4.11  
     5.1 --- a/tests/tests-makefile	Thu Jun 28 03:42:26 2012 +0300
     5.2 +++ b/tests/tests-makefile	Sat Jan 25 22:26:40 2025 +0200
     5.3 @@ -18,6 +18,10 @@
     5.4  CFLAGS = -pedantic -Wall -g -I$(sgldir)/include
     5.5  LDFLAGS = -L. $(rpath) -lsgl $(libgl) -lm
     5.6  
     5.7 +ifeq ($(shell uname -s), Darwin)
     5.8 +	CFLAGS += -DGL_SILENCE_DEPRECATION
     5.9 +endif
    5.10 +
    5.11  $(bin): $(obj) $(libsgl)
    5.12  	$(CC) -o $@ $(obj) $(LDFLAGS)
    5.13