From mint-bounce@lists.fishpool.fi Tue Jan 22 17:30:10 2008 X-Original-To: fnaumann@mail.boerde.de Delivered-To: fnaumann@mail.boerde.de Message-ID: <475DAB94.90100@freesbee.fr> Date: Mon, 10 Dec 2007 22:11:48 +0100 From: =?ISO-8859-1?Q?Vincent_Rivi=E8re?= User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: mint@fishpool.com Subject: Re: [MiNT] setjmp.h and csetjmp References: <475C6F22.4060702@freesbee.fr> In-Reply-To: Content-Type: multipart/mixed; boundary="------------000105080407060804090504" X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-To: mint-bounce@lists.fishpool.fi X-original-sender: vincent.riviere@freesbee.fr Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: X-Virus-Scanned: by amavisd-new at relay.boerde.de X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de X-Spam-Status: No, hits=-1.0 tagged_above=-50.5 required=7.0 tests=BAYES_00 X-Spam-Level: Status: X-Status: X-Keywords: This is a multi-part message in MIME format. --------------000105080407060804090504 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > Hello Vincent! Hello Frank ! > You patch looks good. I suggest to surround it for more modern gcc > versions by a #ifdef _GCC_VERSION_ (or however this is called) so the > MiNTLib stays backward compatible with older gcc and other C > compilers. This time, I think it is good ! For C programs, longjmp() will remain a macro. For C++ programs, longjmp() will be an standard inline function. I can't see any compatibility issue with that. Anyone agrees ? Vincent --------------000105080407060804090504 Content-Type: text/plain; name="setjmp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="setjmp.diff" --- mintlib-CVS/include/setjmp.h 2007-12-09 22:29:12.187500000 +0100 +++ mintlib-CVS-patch-20071209/include/setjmp.h 2007-12-10 21:57:12.296875000 +0100 @@ -24,7 +24,18 @@ #define _setjmp(__jb) (sigsetjmp(__jb, 0)) #define _longjmp(__jb,__v) (siglongjmp(__jb, __v)) #define setjmp(__jb) (sigsetjmp(__jb, 1)) + +#ifndef __cplusplus #define longjmp(__jb,__v) (siglongjmp(__jb, __v)) +#else /* __cplusplus */ +// needs a real function instead of a macro. +static inline void +longjmp (sigjmp_buf env, int val) +{ + siglongjmp(env, val); +} +#endif /* __cplusplus */ + #endif /* __USE_BSD */ #endif /* __STRICT_ANSI__ */ --------------000105080407060804090504--