Gentoo Archives: gentoo-commits

From: "Sergei Trofimovich (slyfox)" <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/squirrel/files: squirrel-2.2.4-gcc47.patch
Date: Thu, 07 Jun 2012 12:20:29
Message-Id: 20120607122001.7D9A02004C@flycatcher.gentoo.org
1 slyfox 12/06/07 12:20:01
2
3 Added: squirrel-2.2.4-gcc47.patch
4 Log:
5 Fix build failure against gcc-4.7 (approved by binki)
6
7 (Portage version: 2.2.0_alpha108_p3/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 dev-lang/squirrel/files/squirrel-2.2.4-gcc47.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/squirrel/files/squirrel-2.2.4-gcc47.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/squirrel/files/squirrel-2.2.4-gcc47.patch?rev=1.1&content-type=text/plain
14
15 Index: squirrel-2.2.4-gcc47.patch
16 ===================================================================
17 From fd2d422f16ca1134f3be8d693290e6b1c536bf71 Mon Sep 17 00:00:00 2001
18 From: Sergei Trofimovich <slyfox@g.o>
19 Date: Thu, 7 Jun 2012 10:10:28 +0300
20 Subject: [squirrel: PATCH] fix build breakage on gcc-4.7 and clang++
21
22 gcc 4.7 got proper support for argument dependent lookup
23 for builtin types:
24 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46075
25
26 It exposed old problem:
27 > gcc -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c sqapi.cpp sqbaselib.cpp sqfuncstate.cpp sqdebug.cpp \
28 sqlexer.cpp sqobject.cpp sqcompiler.cpp sqstate.cpp sqtable.cpp sqmem.cpp sqvm.cpp sqclass.cpp -I../include -I. -Iinclude
29 In file included from sqobject.h:5:0,
30 from sqpcheader.h:16,
31 from sqapi.cpp:4:
32 squtils.h: In instantiation of 'sqvector<T>::~sqvector() [with T = long long int]':
33 sqclosure.h:142:52: required from here
34 squtils.h:46:4: error: 'sq_vm_free' was not declared in this scope, and no declarations were found by argument-dependent
35 lookup at the point of instantiation [-fpermissive]
36 In file included from sqpcheader.h:17:0,
37 from sqapi.cpp:4:
38 sqstate.h:143:6: note: 'void sq_vm_free(void*, SQUnsignedInteger)' declared here, later in the translation unit
39
40 Signed-off-by: Sergei Trofimovich <slyfox@g.o>
41 ---
42 squirrel/sqstate.h | 3 ---
43 squirrel/squtils.h | 4 ++++
44 2 files changed, 4 insertions(+), 3 deletions(-)
45
46 diff --git a/squirrel/sqstate.h b/squirrel/sqstate.h
47 index 3ed3307..e931404 100755
48 --- a/squirrel/sqstate.h
49 +++ b/squirrel/sqstate.h
50 @@ -138,7 +138,4 @@ private:
51
52 bool CompileTypemask(SQIntVec &res,const SQChar *typemask);
53
54 -void *sq_vm_malloc(SQUnsignedInteger size);
55 -void *sq_vm_realloc(void *p,SQUnsignedInteger oldsize,SQUnsignedInteger size);
56 -void sq_vm_free(void *p,SQUnsignedInteger size);
57 #endif //_SQSTATE_H_
58 diff --git a/squirrel/squtils.h b/squirrel/squtils.h
59 index bff7d24..ac3aef9 100755
60 --- a/squirrel/squtils.h
61 +++ b/squirrel/squtils.h
62 @@ -10,6 +10,10 @@
63
64 #define sq_aligning(v) (((size_t)(v) + (SQ_ALIGNMENT-1)) & (~(SQ_ALIGNMENT-1)))
65
66 +
67 +void *sq_vm_malloc(SQUnsignedInteger size);
68 +void *sq_vm_realloc(void *p,SQUnsignedInteger oldsize,SQUnsignedInteger size);
69 +void sq_vm_free(void *p,SQUnsignedInteger size);
70 //sqvector mini vector class, supports objects by value
71 template<typename T> class sqvector
72 {
73 --
74 1.7.8.6