[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r22583 - in /trunk/localedef: ChangeLog.eglibc include/programs/ include/programs/xmalloc.h include/sys/cdefs.h



Author: joseph
Date: Thu Mar  7 01:50:40 2013
New Revision: 22583

Log:
	* include/sys/cdefs.h (__attribute_malloc__): Define if not
	already defined.
	(__attribute_alloc_size): Change to __attribute_alloc_size__.
	Define if not already defined.
	* include/programs/xmalloc.h: Copy from glibc.

Added:
    trunk/localedef/include/programs/
    trunk/localedef/include/programs/xmalloc.h
Modified:
    trunk/localedef/ChangeLog.eglibc
    trunk/localedef/include/sys/cdefs.h

Modified: trunk/localedef/ChangeLog.eglibc
==============================================================================
--- trunk/localedef/ChangeLog.eglibc (original)
+++ trunk/localedef/ChangeLog.eglibc Thu Mar  7 01:50:40 2013
@@ -1,3 +1,11 @@
+2013-03-06  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* include/sys/cdefs.h (__attribute_malloc__): Define if not
+	already defined.
+	(__attribute_alloc_size): Change to __attribute_alloc_size__.
+	Define if not already defined.
+	* include/programs/xmalloc.h: Copy from glibc.
+
 2013-01-23  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* configure.ac: Use AC_USE_SYSTEM_EXTENSIONS.

Added: trunk/localedef/include/programs/xmalloc.h
==============================================================================
--- trunk/localedef/include/programs/xmalloc.h (added)
+++ trunk/localedef/include/programs/xmalloc.h Thu Mar  7 01:50:40 2013
@@ -1,0 +1,33 @@
+/* Memory related definitions for program modules.
+   Copyright (C) 1998-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _XMALLOC_H
+#define _XMALLOC_H	1
+
+#include <sys/cdefs.h>
+#include <stddef.h>
+
+/* Prototypes for a few program-wide used functions.  */
+extern void *xmalloc (size_t n)
+  __attribute_malloc__ __attribute_alloc_size__ ((1));
+extern void *xcalloc (size_t n, size_t s)
+  __attribute_malloc__ __attribute_alloc_size__ ((1, 2));
+extern void *xrealloc (void *o, size_t n)
+  __attribute_malloc__ __attribute_alloc_size__ ((2));
+extern char *xstrdup (const char *) __attribute_malloc__;
+
+#endif /* xmalloc.h */

Modified: trunk/localedef/include/sys/cdefs.h
==============================================================================
--- trunk/localedef/include/sys/cdefs.h (original)
+++ trunk/localedef/include/sys/cdefs.h Thu Mar  7 01:50:40 2013
@@ -47,9 +47,20 @@
 # endif
 #endif
 
-#if defined(__GNUC__) \
+#ifndef __attribute_malloc__
+# if defined(__GNUC__) \
+    && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
+#  define __attribute_malloc__ __attribute__ ((__malloc__))
+# else
+#  define __attribute_malloc__ /* Ignore */
+# endif
+#endif
+
+#ifndef __attribute_alloc_size__
+# if defined(__GNUC__) \
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
-# define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__)))
-#else
-# define __attribute_alloc_size(...)
+#  define __attribute_alloc_size__(...) __attribute__ ((alloc_size (__VA_ARGS__)))
+# else
+#  define __attribute_alloc_size__(...)
+# endif
 #endif

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits