From fcc95384110113e4aaa261b3e2564ed95643e2b1 Mon Sep 17 00:00:00 2001 From: kobake Date: Thu, 26 Jul 2018 11:48:23 +0900 Subject: [PATCH 01/20] =?UTF-8?q?=E5=85=A5=E5=8A=9B=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=AE=E3=82=A8=E3=83=B3=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E6=8C=87=E5=AE=9A=E5=A4=89?= =?UTF-8?q?=E6=9B=B4:=20cp932=20->=20utf-8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index 6f0a3d20f6..860680eef0 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -32,7 +32,7 @@ DEFINES= \ -DUNICODE \ -DNDEBUG CFLAGS= -O2 \ - -finput-charset=cp932 -fexec-charset=cp932 \ + -finput-charset=utf-8 -fexec-charset=utf-8 \ -I. \ $(DEFINES) $(MYCFLAGS) CXXFLAGS= $(CFLAGS) $(MYCXXFLAGS) From f92466c2af65e89555c02918969dccef3e38b851 Mon Sep 17 00:00:00 2001 From: kobake Date: Thu, 26 Jul 2018 11:49:22 +0900 Subject: [PATCH 02/20] =?UTF-8?q?svnrev=20=E5=87=BA=E5=8A=9B=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E3=82=92=20githash=20=E5=87=BA=E5=8A=9B=E3=81=AB?= =?UTF-8?q?=E5=B7=AE=E3=81=97=E6=9B=BF=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index 860680eef0..ae094cb5b8 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -421,9 +421,12 @@ RCTOOL=$(RCTOOLDIR)/mrc2grc.exe HEADERMAKETOOLDIR= ../HeaderMake HEADERMAKE= $(HEADERMAKETOOLDIR)/HeaderMake.exe +COMMITID=`git show -s --format=%H` +SHORT_COMMITID=`git show -s --format=%h` + all: $(RCTOOL) $(HEADERMAKE) $(exe) -$(exe): Funccode_define.h Funccode_enum.h svnrev stdafx $(OBJS) +$(exe): Funccode_define.h Funccode_enum.h githash stdafx $(OBJS) $(CXX) -o $@ $(OBJS) $(LIBS) Funccode_define.h: Funccode_x.hsrc @@ -432,9 +435,10 @@ Funccode_define.h: Funccode_x.hsrc Funccode_enum.h: Funccode_x.hsrc $(HEADERMAKE) -in=../sakura_core/Funccode_x.hsrc -out=../sakura_core/Funccode_enum.h -mode=enum -enum=EFunctionCode -svnrev: - cp svnrev_unknown.h svnrev.h - -$(SUBWCREV) ".\\" ".\svnrev_template.h" ".\svnrev.h" +githash: + echo >githash.h "#pragma once" + echo >>githash.h "#define GIT_COMMIT_HASH \"$(COMMITID)\"" + echo >>githash.h "#define GIT_SHORT_COMMIT_HASH \"$(SHORT_COMMITID)\"" stdafx: $(CXX) $(CXXFLAGS) -c StdAfx.h @@ -456,7 +460,7 @@ $(HEADERMAKE): $(HEADERMAKETOOLDIR)/HeaderMake.cpp clean: $(RM) $(exe) $(OBJS) $(RCTOOL) $(HEADERMAKE) StdAfx.h.gch -depend: svnrev +depend: githash $(CXX) -E -MM -w $(DEFINES) $(CXXFLAGS) *.cpp */*.cpp */*/*.cpp > depend.mak .SUFFIXES: .cpp .o .rc From 519bf893a73f6089038303ce530c239d13571805 Mon Sep 17 00:00:00 2001 From: kobake Date: Thu, 26 Jul 2018 13:47:41 +0900 Subject: [PATCH 03/20] =?UTF-8?q?-fexec-charset=20=E3=81=AF=20utf-8=20?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=20cp932=20=E3=81=AB?= =?UTF-8?q?=E6=88=BB=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index ae094cb5b8..6b92f9929c 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -32,7 +32,7 @@ DEFINES= \ -DUNICODE \ -DNDEBUG CFLAGS= -O2 \ - -finput-charset=utf-8 -fexec-charset=utf-8 \ + -finput-charset=utf-8 -fexec-charset=cp932 \ -I. \ $(DEFINES) $(MYCFLAGS) CXXFLAGS= $(CFLAGS) $(MYCXXFLAGS) From 28805ba7aebc25ac12f8d9c72985ba78963161a3 Mon Sep 17 00:00:00 2001 From: kobake Date: Wed, 8 Aug 2018 06:30:40 +0900 Subject: [PATCH 04/20] =?UTF-8?q?sakura=5Frc=20=E3=83=93=E3=83=AB=E3=83=89?= =?UTF-8?q?=E3=82=92=20UTF-8=20=E6=8C=87=E5=AE=9A=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=20(RCTOOL=E3=81=AF=E7=94=A8=E3=81=84=E3=81=AA?= =?UTF-8?q?=E3=81=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index 6b92f9929c..e0775bafae 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -453,9 +453,7 @@ $(HEADERMAKE): $(HEADERMAKETOOLDIR)/HeaderMake.cpp $(CXX) $(CXXFLAGS) $(HEADERMAKETOOLDIR)/HeaderMake.cpp -o $@ -static-libgcc .rc.o: - $(RCTOOL) $< sakura_grc.rc - $(RC) --language=0411 $(DEFINES) sakura_grc.rc -o $@ - $(RM) sakura_grc.rc + $(RC) -c65001 --language=0411 $(DEFINES) sakura_rc.rc -o $@ clean: $(RM) $(exe) $(OBJS) $(RCTOOL) $(HEADERMAKE) StdAfx.h.gch From 6861472e78bde04be328369e51758aac9e8cc435 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 11:27:47 +0900 Subject: [PATCH 05/20] =?UTF-8?q?svnrev=E2=87=92githash=E3=81=AE=E6=A8=AA?= =?UTF-8?q?=E5=B1=95=E9=96=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index e0775bafae..eeca05e3d2 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -20,7 +20,6 @@ endif CC= $(PREFIX)gcc CXX= $(PREFIX)g++ RC= $(RCPREFIX)windres -SUBWCREV= SubWCRev.exe DEFINES= \ -DWIN32 \ @@ -421,9 +420,6 @@ RCTOOL=$(RCTOOLDIR)/mrc2grc.exe HEADERMAKETOOLDIR= ../HeaderMake HEADERMAKE= $(HEADERMAKETOOLDIR)/HeaderMake.exe -COMMITID=`git show -s --format=%H` -SHORT_COMMITID=`git show -s --format=%h` - all: $(RCTOOL) $(HEADERMAKE) $(exe) $(exe): Funccode_define.h Funccode_enum.h githash stdafx $(OBJS) @@ -436,9 +432,7 @@ Funccode_enum.h: Funccode_x.hsrc $(HEADERMAKE) -in=../sakura_core/Funccode_x.hsrc -out=../sakura_core/Funccode_enum.h -mode=enum -enum=EFunctionCode githash: - echo >githash.h "#pragma once" - echo >>githash.h "#define GIT_COMMIT_HASH \"$(COMMITID)\"" - echo >>githash.h "#define GIT_SHORT_COMMIT_HASH \"$(SHORT_COMMITID)\"" + cmd /c $(CURDIR)/../sakura/githash.bat ../sakura_core stdafx: $(CXX) $(CXXFLAGS) -c StdAfx.h From 300bc7c173a11fdbf8f6c1bf834d01a18b78fce2 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 14:03:06 +0900 Subject: [PATCH 06/20] =?UTF-8?q?sakura=5Frc.rc=E3=81=AEutf8=E5=8C=96?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index eeca05e3d2..a551ff81ca 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -420,12 +420,12 @@ RCTOOL=$(RCTOOLDIR)/mrc2grc.exe HEADERMAKETOOLDIR= ../HeaderMake HEADERMAKE= $(HEADERMAKETOOLDIR)/HeaderMake.exe -all: $(RCTOOL) $(HEADERMAKE) $(exe) +all: $(exe) $(exe): Funccode_define.h Funccode_enum.h githash stdafx $(OBJS) $(CXX) -o $@ $(OBJS) $(LIBS) -Funccode_define.h: Funccode_x.hsrc +Funccode_define.h: $(HEADERMAKE) Funccode_x.hsrc $(HEADERMAKE) -in=../sakura_core/Funccode_x.hsrc -out=../sakura_core/Funccode_define.h -mode=define Funccode_enum.h: Funccode_x.hsrc @@ -440,17 +440,14 @@ stdafx: .cpp.o: $(CXX) $(CXXFLAGS) -o $@ -c $< -$(RCTOOL): $(RCTOOLDIR)/mrc2grc.cpp - $(CXX) $(CXXFLAGS) $(RCTOOLDIR)/mrc2grc.cpp -o $@ -static-libgcc - $(HEADERMAKE): $(HEADERMAKETOOLDIR)/HeaderMake.cpp $(CXX) $(CXXFLAGS) $(HEADERMAKETOOLDIR)/HeaderMake.cpp -o $@ -static-libgcc -.rc.o: - $(RC) -c65001 --language=0411 $(DEFINES) sakura_rc.rc -o $@ +sakura_rc.o: Funccode_define.h githash sakura_rc.rc + $(RC) -c utf-8 --language=0411 $(DEFINES) sakura_rc.rc -o $@ clean: - $(RM) $(exe) $(OBJS) $(RCTOOL) $(HEADERMAKE) StdAfx.h.gch + $(RM) $(exe) $(OBJS) $(HEADERMAKE) StdAfx.h.gch depend: githash $(CXX) -E -MM -w $(DEFINES) $(CXXFLAGS) *.cpp */*.cpp */*/*.cpp > depend.mak From 5b8576d403c3c7020c0cab316083d1753b95c65d Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 14:18:16 +0900 Subject: [PATCH 07/20] =?UTF-8?q?=E3=83=97=E3=83=AA=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=91=E3=82=A4=E3=83=AB=E3=83=98=E3=83=83=E3=83=80=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E4=BE=9D=E5=AD=98=E9=96=A2=E4=BF=82=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index a551ff81ca..09f7f2d810 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -428,13 +428,13 @@ $(exe): Funccode_define.h Funccode_enum.h githash stdafx $(OBJS) Funccode_define.h: $(HEADERMAKE) Funccode_x.hsrc $(HEADERMAKE) -in=../sakura_core/Funccode_x.hsrc -out=../sakura_core/Funccode_define.h -mode=define -Funccode_enum.h: Funccode_x.hsrc +Funccode_enum.h: $(HEADERMAKE) Funccode_x.hsrc $(HEADERMAKE) -in=../sakura_core/Funccode_x.hsrc -out=../sakura_core/Funccode_enum.h -mode=enum -enum=EFunctionCode githash: cmd /c $(CURDIR)/../sakura/githash.bat ../sakura_core -stdafx: +stdafx: Funccode_enum.h StdAfx.h $(CXX) $(CXXFLAGS) -c StdAfx.h .cpp.o: From 8b7ba73a27058d5cf5dc4804c7ad96f82c8b498e Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 14:30:49 +0900 Subject: [PATCH 08/20] =?UTF-8?q?exe=E3=81=A8cpp=E3=81=AE=E4=BE=9D?= =?UTF-8?q?=E5=AD=98=E9=96=A2=E4=BF=82=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index 09f7f2d810..a46668b53d 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -422,7 +422,7 @@ HEADERMAKE= $(HEADERMAKETOOLDIR)/HeaderMake.exe all: $(exe) -$(exe): Funccode_define.h Funccode_enum.h githash stdafx $(OBJS) +$(exe): githash $(OBJS) $(CXX) -o $@ $(OBJS) $(LIBS) Funccode_define.h: $(HEADERMAKE) Funccode_x.hsrc @@ -437,7 +437,7 @@ githash: stdafx: Funccode_enum.h StdAfx.h $(CXX) $(CXXFLAGS) -c StdAfx.h -.cpp.o: +.cpp.o: stdafx $(CXX) $(CXXFLAGS) -o $@ -c $< $(HEADERMAKE): $(HEADERMAKETOOLDIR)/HeaderMake.cpp From c9f59d87ede8946d8726480497aa8205fdc0d24d Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 14:40:57 +0900 Subject: [PATCH 09/20] =?UTF-8?q?MinGW=E3=81=A7=E3=82=BB=E3=82=AD=E3=83=A5?= =?UTF-8?q?=E3=83=AA=E3=83=86=E3=82=A3=E5=BC=B7=E5=8C=96=E7=89=88CRT?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=82=92=E4=BD=BF=E3=81=88=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit swprintf_s関数が見つからないという以下エラーの対応 io/CFileLoad.cpp:93:52: error: 'swprintf_s' was not declared in this scope swprintf_s(buf, _countof(buf), L"%I64u", megabytes); --- sakura_core/Makefile | 1 + sakura_core/StdAfx.h | 7 ++++--- sakura_core/util/string_ex.cpp | 4 +++- sakura_core/util/string_ex.h | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index a46668b53d..2d23d28a8e 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -26,6 +26,7 @@ DEFINES= \ -DWINVER=0x500 \ -D_WIN32_WINNT=0x500 \ -D_WIN32_IE=0x501 \ + -DMINGW_HAS_SECURE_API=1 \ -DNOMINMAX \ -D_UNICODE \ -DUNICODE \ diff --git a/sakura_core/StdAfx.h b/sakura_core/StdAfx.h index 22db244345..844821370b 100644 --- a/sakura_core/StdAfx.h +++ b/sakura_core/StdAfx.h @@ -36,9 +36,10 @@ #ifdef __MINGW32__ #include <_mingw.h> -#ifdef MINGW_HAS_SECURE_API -#undef MINGW_HAS_SECURE_API -#endif // MINGW_HAS_SECURE_API +# include +# include +# include +# include #endif // __MINGW32__ //グローバル #include "_main/global.h" diff --git a/sakura_core/util/string_ex.cpp b/sakura_core/util/string_ex.cpp index b05a6ce8f8..03c03afc56 100644 --- a/sakura_core/util/string_ex.cpp +++ b/sakura_core/util/string_ex.cpp @@ -222,7 +222,9 @@ const char* stristr_j( const char* s1, const char* s2 ) // 互換 // // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- // -#if (defined(_MSC_VER) && _MSC_VER<1400) || defined(__MINGW32__) //VS2005より前なら +#if (defined(_MSC_VER) && _MSC_VER<1400) //VS2005より前なら +|| (defined(__MINGW32__) && defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) + errno_t wcscat_s(wchar_t* szDst, size_t nDstCount, const wchar_t* szSrc) { // 本物は _set_invalid_parameter_handler で設定されたハンドラが起動します diff --git a/sakura_core/util/string_ex.h b/sakura_core/util/string_ex.h index b272bd6456..212310c285 100644 --- a/sakura_core/util/string_ex.h +++ b/sakura_core/util/string_ex.h @@ -144,7 +144,8 @@ int my_strnicmp( const char *s1, const char *s2, size_t n ); // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- // // VS2005以降の安全版文字列関数 -#if (defined(_MSC_VER) && _MSC_VER<1400) || defined(__MINGW32__) //VS2005より前なら +#if (defined(_MSC_VER) && _MSC_VER<1400) //VS2005より前なら + || (defined(__MINGW32__) && defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) typedef int errno_t; #define _TRUNCATE ((size_t)-1) errno_t strcpy_s(char *dest, size_t num, const char *src); From 25dd45b877b9eaaa3cfe849f04d287a78c1381bc Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 14:46:08 +0900 Subject: [PATCH 10/20] =?UTF-8?q?=E6=9A=97=E9=BB=99=E3=81=AEnarrow=5Fcast?= =?UTF-8?q?=E3=81=8Cgcc=E3=81=AB=E6=80=92=E3=82=89=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8B=E5=AF=BE?= =?UTF-8?q?=E5=87=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/io/CFileLoad.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sakura_core/io/CFileLoad.cpp b/sakura_core/io/CFileLoad.cpp index 095d9614b5..fb9c51d19b 100644 --- a/sakura_core/io/CFileLoad.cpp +++ b/sakura_core/io/CFileLoad.cpp @@ -656,7 +656,7 @@ const char* CFileLoad::GetNextLineCharCode( if( pData[i] == '\x0d' || pData[i] == '\x25' ){ char szEof[3] = { (pData[i] == '\x25' ? '\x0a' : '\x0d'), - (pData[i+1]== '\x25' ? '\x0a' : + (pData[i+1]== '\x25' ? '\x0a' : (char) (pData[i+1] == '\x0a' ? 0 : // EBCDIC の"\x0aがLFにならないように細工する (i + 1 < nDataLen ? pData[i+1] : 0))), 0 From 23c683db9d01cec131b4b079dca794b2c0079137 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 14:58:55 +0900 Subject: [PATCH 11/20] =?UTF-8?q?#288[auto=20=E3=82=AD=E3=83=BC=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=A6=20iterat?= =?UTF-8?q?or=20=E5=A4=89=E6=95=B0=E3=81=AE=E5=AE=A3=E8=A8=80=E3=82=92?= =?UTF-8?q?=E7=B0=A1=E6=BD=94=E3=81=AB=E3=81=99=E3=82=8B]=E3=81=A7?= =?UTF-8?q?=E5=85=A5=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE=E3=81=A3=E3=81=9F?= =?UTF-8?q?=20gcc=20=E3=81=AB=E6=80=92=E3=82=89=E3=82=8C=E3=82=8B=E8=A8=98?= =?UTF-8?q?=E8=BF=B0=E3=82=92=E8=A8=82=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rvalueの非const参照を宣言してはならないという以下エラーの対応 macro/CMacroFactory.cpp:92:37: error: invalid initialization of non-const reference of type 'std::_List_iterator&' from an rvalue of type 'std::__cxx11::list::iterator {aka std::_List_iterator}' auto& c_it = m_mMacroCreators.begin(); --- sakura_core/macro/CMacroFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sakura_core/macro/CMacroFactory.cpp b/sakura_core/macro/CMacroFactory.cpp index a7643dcaaa..0cfe030240 100644 --- a/sakura_core/macro/CMacroFactory.cpp +++ b/sakura_core/macro/CMacroFactory.cpp @@ -89,7 +89,7 @@ bool CMacroFactory::RegisterCreator( Creator f ) bool CMacroFactory::Unregister( Creator f ) { // Creator Listからの削除 - auto& c_it = m_mMacroCreators.begin(); + auto c_it = m_mMacroCreators.begin(); while( c_it != m_mMacroCreators.end() ){ if( *c_it == f ){ // いきなり削除するとiteratorが無効になるので, From d8837c98d5351f29ccaabdb52b3993fbdaa9b2df Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 15:08:59 +0900 Subject: [PATCH 12/20] =?UTF-8?q?#303=E3=81=A7=E5=85=A5=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=A3=E3=81=9F=20gcc=20=E3=81=AB=E6=80=92?= =?UTF-8?q?=E3=82=89=E3=82=8C=E3=82=8B=E4=BE=8B=E5=A4=96=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=82=92=E3=81=AA=E3=82=93=E3=81=A8=E3=81=8B=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #303 CNativeA/CNativeW に対する AppendString のフォーマット書式対応版メソッドを準備 以下2ファイルのコンパイルエラーの対応 mingw32-make mem/CNativeW.o mingw32-make mem/CNativeA.o --- sakura_core/mem/CNativeA.cpp | 5 ++--- sakura_core/mem/CNativeW.cpp | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sakura_core/mem/CNativeA.cpp b/sakura_core/mem/CNativeA.cpp index f6b7490f1a..eb6a9225f4 100644 --- a/sakura_core/mem/CNativeA.cpp +++ b/sakura_core/mem/CNativeA.cpp @@ -73,9 +73,8 @@ void CNativeA::AppendStringF(const char* pszData, ...) va_end(v); if (len == -1) { - char cbuf[128]; - sprintf_s(cbuf, _countof(cbuf), "AppendStringF error. errno = %d", e); - throw std::exception(cbuf); + DEBUG_TRACE(L"AppendStringF error. errno = %d", e); + throw std::exception(); } // 追加 diff --git a/sakura_core/mem/CNativeW.cpp b/sakura_core/mem/CNativeW.cpp index eb798d4125..651438fb0c 100644 --- a/sakura_core/mem/CNativeW.cpp +++ b/sakura_core/mem/CNativeW.cpp @@ -97,9 +97,8 @@ void CNativeW::AppendStringF(const wchar_t* pszData, ...) va_end(v); if (len == -1) { - char cbuf[128]; - sprintf_s(cbuf, _countof(cbuf), "AppendStringF error. errno = %d", e); - throw std::exception(cbuf); + DEBUG_TRACE(L"AppendStringF error. errno = %d", e); + throw std::exception(); } // 追加 From 11c5ff37b2c9c321e0565c6f04b3d32819b75520 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 15:13:41 +0900 Subject: [PATCH 13/20] =?UTF-8?q?=E5=8F=A4=E3=81=84MinGW=E3=81=AB=E5=90=AB?= =?UTF-8?q?=E3=81=BE=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84COM?= =?UTF-8?q?=E3=81=AEID=E3=82=92=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 古いMinGWのWindowsSDKに含まれていないCOMのIDを独自に定義している。 GNU 6.2.0には既に取り込まれているので、定義があるとビルドエラーになる。 --- sakura_core/io/CZipFile.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sakura_core/io/CZipFile.cpp b/sakura_core/io/CZipFile.cpp index 87084786df..590dbd1a88 100644 --- a/sakura_core/io/CZipFile.cpp +++ b/sakura_core/io/CZipFile.cpp @@ -28,18 +28,6 @@ #include "StdAfx.h" #include #include "CZipFile.h" -#ifdef __MINGW32__ -//uuid(D8F015C0-C278-11CE-A49E-444553540000); -const GUID IID_IShellDispatch = -{ - 0xD8F015C0, 0xc278, 0x11ce, { 0xa4, 0x9e, 0x44, 0x45, 0x53, 0x54 } -}; -// 13709620-C279-11CE-A49E-444553540000 -const GUID CLSID_Shell = -{ - 0x13709620, 0xc279, 0x11ce, { 0xa4, 0x9e, 0x44, 0x45, 0x53, 0x54 } -}; -#endif // コンストラクタ From 98ac13ca8d257fd8f232f20e2f1e7dcb452fa579 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 17:28:20 +0900 Subject: [PATCH 14/20] =?UTF-8?q?=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E6=8C=87=E6=91=98=E5=AF=BE=E5=BF=9C=20(#if=20=E3=83=87?= =?UTF-8?q?=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=86=E3=82=A3=E3=83=96=E3=81=AE?= =?UTF-8?q?=E6=94=B9=E8=A1=8C=E3=81=AB=E3=81=AF=20\=20=E3=82=92=E4=BB=98?= =?UTF-8?q?=E3=81=91=E3=82=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/util/string_ex.cpp | 4 ++-- sakura_core/util/string_ex.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sakura_core/util/string_ex.cpp b/sakura_core/util/string_ex.cpp index 03c03afc56..ac060424b3 100644 --- a/sakura_core/util/string_ex.cpp +++ b/sakura_core/util/string_ex.cpp @@ -222,8 +222,8 @@ const char* stristr_j( const char* s1, const char* s2 ) // 互換 // // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- // -#if (defined(_MSC_VER) && _MSC_VER<1400) //VS2005より前なら -|| (defined(__MINGW32__) && defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) +#if (defined(_MSC_VER) && _MSC_VER<1400) \ +|| (defined(__MINGW32__) && defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) //VS2005より前なら errno_t wcscat_s(wchar_t* szDst, size_t nDstCount, const wchar_t* szSrc) { diff --git a/sakura_core/util/string_ex.h b/sakura_core/util/string_ex.h index 212310c285..f72166af66 100644 --- a/sakura_core/util/string_ex.h +++ b/sakura_core/util/string_ex.h @@ -144,8 +144,8 @@ int my_strnicmp( const char *s1, const char *s2, size_t n ); // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- // // VS2005以降の安全版文字列関数 -#if (defined(_MSC_VER) && _MSC_VER<1400) //VS2005より前なら - || (defined(__MINGW32__) && defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) +#if (defined(_MSC_VER) && _MSC_VER<1400) \ + || (defined(__MINGW32__) && defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) //VS2005より前なら typedef int errno_t; #define _TRUNCATE ((size_t)-1) errno_t strcpy_s(char *dest, size_t num, const char *src); From 878996498bbdfa98de1b1b414ba958268798b214 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 19 Aug 2018 17:29:14 +0900 Subject: [PATCH 15/20] =?UTF-8?q?=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E6=8C=87=E6=91=98=E5=AF=BE=E5=BF=9C=20(=E8=87=AA=E5=8B=95?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=AF=E3=83=AB=E3=83=BC=E3=83=89=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AF?= =?UTF-8?q?=E6=98=8E=E7=A4=BA=E3=81=A7=E3=82=A4=E3=83=B3=E3=82=AF=E3=83=AB?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=97=E3=81=AA=E3=81=8F=E3=81=A6=E3=82=82?= =?UTF-8?q?=E3=81=84=E3=81=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/StdAfx.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sakura_core/StdAfx.h b/sakura_core/StdAfx.h index 844821370b..d31c288e4d 100644 --- a/sakura_core/StdAfx.h +++ b/sakura_core/StdAfx.h @@ -34,13 +34,6 @@ #endif #endif -#ifdef __MINGW32__ -#include <_mingw.h> -# include -# include -# include -# include -#endif // __MINGW32__ //グローバル #include "_main/global.h" From 2d452803e3548a28d3a46f2be1345d300b086ded Mon Sep 17 00:00:00 2001 From: berryplus Date: Thu, 23 Aug 2018 23:25:43 +0900 Subject: [PATCH 16/20] =?UTF-8?q?=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E6=8C=87=E6=91=98=E5=AF=BE=E5=BF=9C=EF=BC=88=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF=E3=81=8C=E6=AD=A3=E3=81=97=E3=81=8F?= =?UTF-8?q?=E3=81=82=E3=82=8A=E3=81=BE=E3=81=9B=E3=82=93=E3=80=82=E3=81=A8?= =?UTF-8?q?=E5=87=BA=E3=81=A6=E3=81=84=E3=82=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index 2d23d28a8e..9920ff68e9 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -433,7 +433,7 @@ Funccode_enum.h: $(HEADERMAKE) Funccode_x.hsrc $(HEADERMAKE) -in=../sakura_core/Funccode_x.hsrc -out=../sakura_core/Funccode_enum.h -mode=enum -enum=EFunctionCode githash: - cmd /c $(CURDIR)/../sakura/githash.bat ../sakura_core + cmd /c $(CURDIR)/../sakura/githash.bat ..\\sakura_core stdafx: Funccode_enum.h StdAfx.h $(CXX) $(CXXFLAGS) -c StdAfx.h From e1ee54640d5d0a5343c00abe70f53044f3ec5422 Mon Sep 17 00:00:00 2001 From: berryplus Date: Fri, 24 Aug 2018 00:46:51 +0900 Subject: [PATCH 17/20] =?UTF-8?q?mingw32-make=20clean=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura/mingw32-del.bat | 10 ++++++++++ sakura_core/Makefile | 1 + 2 files changed, 11 insertions(+) create mode 100644 sakura/mingw32-del.bat diff --git a/sakura/mingw32-del.bat b/sakura/mingw32-del.bat new file mode 100644 index 0000000000..eeab4c97ca --- /dev/null +++ b/sakura/mingw32-del.bat @@ -0,0 +1,10 @@ +@echo off + +SETLOCAL + +:�����œn���ꂽ�t�@�C���Q�̃p�X��؂��u������del�R�}���h�ɓn�� +set OUTFILES=%* +del /F /Q %OUTFILES:/=\% + +ENDLOCAL +exit /b diff --git a/sakura_core/Makefile b/sakura_core/Makefile index 9920ff68e9..fbf010881b 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -20,6 +20,7 @@ endif CC= $(PREFIX)gcc CXX= $(PREFIX)g++ RC= $(RCPREFIX)windres +RM= cmd /c $(CURDIR)/../sakura/mingw32-del.bat DEFINES= \ -DWIN32 \ From b78aec4c335613b126efc579155c88b88d845495 Mon Sep 17 00:00:00 2001 From: berryplus Date: Fri, 24 Aug 2018 01:46:25 +0900 Subject: [PATCH 18/20] =?UTF-8?q?MinGW=E3=83=93=E3=83=AB=E3=83=89=E3=81=AB?= =?UTF-8?q?=E3=81=A4=E3=81=84=E3=81=A6=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/build.md b/build.md index 5642ccc9ce..fb329e422c 100644 --- a/build.md +++ b/build.md @@ -21,6 +21,7 @@ - [開発者向けの情報](#開発者向けの情報) - [githash.h の更新のスキップ](#githashh-の更新のスキップ) - [Powershell によるZIPファイルの圧縮、解凍、内容確認の強制](#powershell-によるzipファイルの圧縮解凍内容確認の強制) + - [MinGW-w64 ビルド](#MinGW-w64-ビルド) @@ -140,3 +141,32 @@ build-sln.bat x64 Release build-sln.bat x64 Debug ``` +### MinGW w64 ビルド + +生成されるバイナリは正しく動作しないが、MinGWでのビルドも可能。 + + +MinGW64のビルド環境 + +* [pleiades 4.6 Neon](http://mergedoc.osdn.jp/) +* [MSYS2+MinGW-w64](https://gist.github.com/Hamayama/eb4b4824ada3ac71beee0c9bb5fa546d) +* [MinGW-w64](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/) + +cpu | thread モデル | 例外モデル | コメント +---- | ---- | ---- | ---- +x86_64 | win32 | seh | windows向け。外部DLL不要 +x86_64 | posix | seh | 標準。pthreadのDLLが必要 +x86_64 | win32 | sjlj | 外部DLL不要 +x86_64 | posix | sjlj | pthreadのDLLが必要 + +標準的なMinGWセットアップでビルドしたバイナリは ```libwinpthread-1.dll``` に依存することに注意。 + + +コマンド実行例 + +``` +path=D:\eclipse4.6\eclipse\mingw\bin;%path% +cd sakura_core +mingw32-make githash stdafx sakura_rc.o +mingw32-make -j4 +``` From 9a3e316ced3fc09ccc7a4d909cd49bd08f3bab9a Mon Sep 17 00:00:00 2001 From: berryplus Date: Fri, 24 Aug 2018 22:54:29 +0900 Subject: [PATCH 19/20] =?UTF-8?q?mingw32-make=20clean=E6=99=82=E3=81=AEcou?= =?UTF-8?q?ld=20not=20found=20file=E3=82=92=E6=8A=91=E5=88=B6=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura/mingw32-del.bat | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sakura/mingw32-del.bat b/sakura/mingw32-del.bat index eeab4c97ca..6119c11a04 100644 --- a/sakura/mingw32-del.bat +++ b/sakura/mingw32-del.bat @@ -2,9 +2,25 @@ SETLOCAL -:�����œn���ꂽ�t�@�C���Q�̃p�X��؂��u������del�R�}���h�ɓn�� +:�����œn���ꂽ�t�@�C���Q���擾 set OUTFILES=%* -del /F /Q %OUTFILES:/=\% +:�p�X��؂��u�� +set OUTFILES=%OUTFILES:/=\% + + +:del_file +:1�t�@�C������del�R�}���h�ɓn���č폜 +for /F "tokens=1,*" %%f in ("%OUTFILES%") DO ( + if exist %%f del /F /Q %%f + set OUTFILES=%%g +) + +:����ԍ폜�ł�����I�� +if "%OUTFILES%" == "" goto :EOF +goto :del_file + + +:END ENDLOCAL exit /b From c737e5d84978c62be2338cd1c8aedd5619d7fb50 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 25 Aug 2018 08:24:04 +0900 Subject: [PATCH 20/20] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=81=A7?= =?UTF-8?q?=E7=94=9F=E6=88=90=E3=81=95=E3=82=8C=E3=82=8B=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=82=92make=20clean=E3=81=AE=E5=AF=BE?= =?UTF-8?q?=E8=B1=A1=E3=81=AB=E5=85=A5=E3=82=8C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sakura_core/Makefile b/sakura_core/Makefile index fbf010881b..a3ba83cfb6 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -417,6 +417,11 @@ _os/CDropTarget.o \ _os/COsVersionInfo.o \ sakura_rc.o \ +GENERATED_FILES= \ +Funccode_define.h \ +Funccode_enum.h \ +githash.h \ + RCTOOLDIR=../btool RCTOOL=$(RCTOOLDIR)/mrc2grc.exe HEADERMAKETOOLDIR= ../HeaderMake @@ -449,7 +454,7 @@ sakura_rc.o: Funccode_define.h githash sakura_rc.rc $(RC) -c utf-8 --language=0411 $(DEFINES) sakura_rc.rc -o $@ clean: - $(RM) $(exe) $(OBJS) $(HEADERMAKE) StdAfx.h.gch + $(RM) $(exe) $(OBJS) $(HEADERMAKE) StdAfx.h.gch $(GENERATED_FILES) depend: githash $(CXX) -E -MM -w $(DEFINES) $(CXXFLAGS) *.cpp */*.cpp */*/*.cpp > depend.mak