From ff41dd1b88fdfa95018d056163396dd269997857 Mon Sep 17 00:00:00 2001 From: pabs3 Date: Wed, 6 May 2009 05:03:23 +0000 Subject: [PATCH] Prefer prototypes from glibc headers, since defining them ourselves works around glibc security mechanisms. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2373 1f10aa63-cdf2-0310-b900-c93c546f37ac --- ETL/trunk/ETL/_stringf.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/ETL/trunk/ETL/_stringf.h b/ETL/trunk/ETL/_stringf.h index 120c326..3d0c020 100644 --- a/ETL/trunk/ETL/_stringf.h +++ b/ETL/trunk/ETL/_stringf.h @@ -30,9 +30,14 @@ /* === H E A D E R S ======================================================= */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + #include #include #include +#include /* === M A C R O S ========================================================= */ @@ -58,22 +63,33 @@ _ETL_BEGIN_CDECLS #define ETL_NO_THROW throw() #endif +// Prefer prototypes from glibc headers, since defining them ourselves +// works around glibc security mechanisms + #ifdef HAVE_VASPRINTF // This is the preferred method - extern int vasprintf(char **,const char *,va_list)ETL_NO_THROW; + #ifndef __GLIBC__ + extern int vasprintf(char **,const char *,va_list)ETL_NO_THROW; + #endif #else # ifdef HAVE_VSNPRINTF // This is the secondary method - extern int vsnprintf(char *,size_t,const char*,va_list)ETL_NO_THROW; + #ifndef __GLIBC__ + extern int vsnprintf(char *,size_t,const char*,va_list)ETL_NO_THROW; + #endif # endif #endif #ifdef HAVE_VSSCANF -extern int vsscanf(const char *,const char *,va_list)ETL_NO_THROW; + #ifndef __GLIBC__ + extern int vsscanf(const char *,const char *,va_list)ETL_NO_THROW; + #endif #else #define ETL_NO_VSTRSCANF #ifdef HAVE_SSCANF -extern int sscanf(const char *buf, const char *format, ...)ETL_NO_THROW; + #ifndef __GLIBC__ + extern int sscanf(const char *buf, const char *format, ...)ETL_NO_THROW; + #endif #endif #endif -- 2.7.4