From f5749334efaa842d82aab70a112d7b49e6a9b6a7 Mon Sep 17 00:00:00 2001 From: SHIRAKATA Kentaro Date: Fri, 14 Jun 2019 16:34:36 +0900 Subject: [PATCH] patch for building on mac with gcc-8 --- .travis.yml | 4 +++- include/tradstdc.h | 2 ++ japanese/set_mac.sh | 2 +- sys/unix/hints/macosx10.10 | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 378f858..4729f39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ os: compiler: - gcc +osx_image: xcode10.2 + addons: apt: packages: @@ -14,7 +16,7 @@ addons: homebrew: packages: - nkf - - gcc@5 + - gcc@8 before_script: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sh japanese/set_mac.sh ; fi diff --git a/include/tradstdc.h b/include/tradstdc.h index 12a0d4a..979c7d3 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -432,9 +432,11 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ /* disable gcc's __attribute__((__warn_unused_result__)) since explicitly discarding the result by casting to (void) is not accepted as a 'use' */ #define __warn_unused_result__ /*empty*/ +#ifndef MACOSX /*JP*//*Å‹ß‚ÌXCode‚Å‚Í‚±‚ꂪ‹ó‚É‚È‚é‚ƃGƒ‰[‚É‚È‚é*/ #define warn_unused_result /*empty*/ #endif #endif +#endif #ifndef PRINTF_F #define PRINTF_F(f, v) diff --git a/japanese/set_mac.sh b/japanese/set_mac.sh index 51c44ce..435b908 100644 --- a/japanese/set_mac.sh +++ b/japanese/set_mac.sh @@ -1,3 +1,3 @@ -brew link --overwrite gcc@5 +brew link --overwrite gcc@8 find . -type f -name '*.c' -or -name '*.h'|xargs -n1 nkf -Sw --cp932 --overwrite sh sys/unix/setup.sh sys/unix/hints/macosx10.10 diff --git a/sys/unix/hints/macosx10.10 b/sys/unix/hints/macosx10.10 index fcb68df..38e1317 100644 --- a/sys/unix/hints/macosx10.10 +++ b/sys/unix/hints/macosx10.10 @@ -58,8 +58,8 @@ GAMEGRP = games # build to run in the source tree - primarily for development. Build with "make all" #WANT_SOURCE_INSTALL=1 -CC=gcc-5 -CFLAGS+=-fexec-charset=cp932 -Wno-comment -Wno-unused-parameter -Wno-overlength-strings +CC=gcc-8 +CFLAGS+=-fexec-charset=cp932 -Wno-comment -Wno-unused-parameter -Wno-overlength-strings -Wno-format-overflow # At the moment this is just for debugging, but in the future it could be # useful for other things. Requires SYSCF and an ANSI compiler. -- 2.11.0