From 93b6fefcaf71e176ae0fab7ef515bcf178e0730b Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 29 Oct 2013 23:21:12 -0400 Subject: Fix warnings and errors when compiling for GTK3. --- src/Makefile | 38 +++++++++++++++++--------------------- src/textadept.c | 8 ++++++-- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index d3ed8f02..571ee09d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -49,7 +49,7 @@ ifneq (, $(or $(findstring Linux, $(kernel)), $(findstring BSD, $(kernel)))) CXX = g++ CXXFLAGS = -m32 -arch i386 -mdynamic-no-pic -mmacosx-version-min=10.5 \ -isysroot /usr/lib/apple/SDKs/MacOSX10.5.sdk - LUAFLAGS = -DLUA_USE_MACOSX + LUA_CFLAGS = -DLUA_USE_MACOSX LDFLAGS = -liconv -rdynamic MAKE = make @@ -73,7 +73,7 @@ ifneq (, $(or $(findstring Linux, $(kernel)), $(findstring BSD, $(kernel)))) # Build for Linux/BSD. CC = gcc CXX = g++ - LUAFLAGS = -DLUA_USE_LINUX + LUA_CFLAGS = -DLUA_USE_LINUX LDFLAGS = -rdynamic -Wl,--retain-symbols-file -Wl,lua.sym ifeq (Linux, $(kernel)) LDFLAGS += -ldl @@ -96,10 +96,8 @@ ifneq (, $(or $(findstring Linux, $(kernel)), $(findstring BSD, $(kernel)))) else gtk_version = 3.0 endif - GTK_CFLAGS = $(shell pkg-config --cflags gtk+-$(gtk_version) \ - gmodule-$(gtk_version)) - GTK_LIBS = $(shell pkg-config --libs gtk+-$(gtk_version) \ - gmodule-$(gtk_version)) + GTK_CFLAGS = $(shell pkg-config --cflags gtk+-$(gtk_version) gmodule-2.0) + GTK_LIBS = $(shell pkg-config --libs gtk+-$(gtk_version) gmodule-2.0) install_targets = ../textadept ../textadeptjit else plat_flag = -DCURSES -D_XOPEN_SOURCE_EXTENDED @@ -118,7 +116,7 @@ ifneq (, $(or $(findstring Linux, $(kernel)), $(findstring BSD, $(kernel)))) # CXX = g++ # CXXFLAGS = -arch i386 -mdynamic-no-pic -mmacosx-version-min=10.5 \ # -isysroot /Developer/SDKs/MacOSX10.5.sdk -# LUAFLAGS = -DLUA_USE_MACOSX +# LUA_CFLAGS = -DLUA_USE_MACOSX # LDFLAGS = -liconv -rdynamic # # #ifeq (, $(findstring curses, $(MAKECMDGOALS))) @@ -219,16 +217,16 @@ ScintillaTerm.o: scintilla/term/ScintillaTerm.cxx $(CROSS)$(CXX) -c $(CXXFLAGS) $(sci_flags) -Iscintilla/term $(CURSES_CFLAGS) \ $< -o $@ LexLPeg.o: LexLPeg.cxx - $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUAFLAGS) $(sci_flags) -DLPEG_LEXER \ + $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUA_CFLAGS) $(sci_flags) -DLPEG_LEXER \ -DNO_SCITE -Ilua/src $< -o $@ LexLPegjit.o: LexLPeg.cxx - $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUAFLAGS) $(sci_flags) -DLPEG_LEXER \ + $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUA_CFLAGS) $(sci_flags) -DLPEG_LEXER \ -DNO_SCITE -Iluajit/src $< -o $@ LexLPeg-curses.o: LexLPeg.cxx - $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUAFLAGS) $(sci_flags) -DLPEG_LEXER \ + $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUA_CFLAGS) $(sci_flags) -DLPEG_LEXER \ -DNO_SCITE -DCURSES -Ilua/src $(CURSES_CFLAGS) $< -o $@ LexLPegjit-curses.o: LexLPeg.cxx - $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUAFLAGS) $(sci_flags) -DLPEG_LEXER \ + $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUA_CFLAGS) $(sci_flags) -DLPEG_LEXER \ -DNO_SCITE -DCURSES -Iluajit/src $(CURSES_CFLAGS) $< -o $@ textadept.o: textadept.c $(CROSS)$(CC) -c $(CFLAGS) $(ta_flags) -Ilua/src $(GTK_CFLAGS) $< -o $@ @@ -242,11 +240,11 @@ textadeptjit-curses.o: textadept.c $(CROSS)$(CC) -c $(CFLAGS) $(ta_flags) -DLUAJIT -Iluajit/src \ -Iscintilla/term -Itermkey -Icdk $(CURSES_CFLAGS) $< -o $@ $(lua_objs): %.o: lua/src/%.c - $(CROSS)$(CC) -c $(CFLAGS) $(LUAFLAGS) -Ilua/src $< -o $@ + $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) -Ilua/src $< -o $@ $(lua_lib_objs): %.o: lua/src/lib/%.c - $(CROSS)$(CC) -c $(CFLAGS) $(LUAFLAGS) -Ilua/src $< -o $@ + $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) -Ilua/src $< -o $@ $(luajit_lib_objs): %jit.o: lua/src/lib/%.c - $(CROSS)$(CC) -c $(CFLAGS) $(LUAFLAGS) -Iluajit/src $< -o $@ + $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) -Iluajit/src $< -o $@ luajit/src/libluajit.a: ; $(MAKE) -C luajit CC="$(CC) $(CFLAGS)" luajit/src/lua51.dll: $(MAKE) -C luajit HOST_CC="$(CC) -m32" CROSS=$(CROSS) TARGET_SYS=Windows @@ -361,7 +359,7 @@ release: $(basedir).i386 | $(build_dir) make -C $|/src deps clean doc PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig make -C $|/src -j4 MAKE="make -j4" make -C $|/src -j4 curses - cp -r $|/doc $|/lexers/lexers $|/textadept* $< + cp -r $|/doc $|/lexers $|/textadept* $< tar czf /tmp/$<.tgz $< && rm -rf $< $(basedir).x86_64: | $(build_dir) ; hg archive $@ -X ".hg*" release64: $(basedir).x86_64 | $(build_dir) @@ -371,7 +369,7 @@ release64: $(basedir).x86_64 | $(build_dir) make -C $|/src -j4 CFLAGS=-m64 CXXFLAGS=-m64 \ CURSES_CFLAGS=-I/opt/ncursesw64/include/ncursesw \ CURSES_LIBS="-L/opt/ncursesw64/lib -lncursesw" curses || return 0 - cp -r $|/doc $|/lexers/lexers $|/textadept* $< + cp -r $|/doc $|/lexers $|/textadept* $< tar czf /tmp/$<.tgz $< && rm -rf $< $(basedir).win32: | $(build_dir) ; hg archive $@ -X ".hg*" win32-release: $(basedir).win32 | $(build_dir) @@ -381,7 +379,7 @@ win32-release: $(basedir).win32 | $(build_dir) rm -r $window) & + lua_pushboolean(L, gdk_window_get_state(gtk_widget_get_window(window)) & GDK_WINDOW_STATE_MAXIMIZED); #elif CURSES lua_pushboolean(L, FALSE); -- cgit v1.2.3