Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-07-31 19:05:09 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-07-31 19:05:09 +0400
commitaac3f0eaebd155eca29b62cad322687bfd30dc1f (patch)
treef24cc46bb42aea6dc19a1117a167e96a453124ba /source/blender/blenlib
parentc42d0189e586419269e9004868bec365e1b8396f (diff)
Fix warnings on old apple GCC compiler due to no support for alloc_size attribute.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_memarena.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_memarena.h b/source/blender/blenlib/BLI_memarena.h
index 2a2dd31b26f..092bb639b91 100644
--- a/source/blender/blenlib/BLI_memarena.h
+++ b/source/blender/blenlib/BLI_memarena.h
@@ -47,41 +47,44 @@ extern "C" {
*/
#define BLI_MEMARENA_STD_BUFSIZE (1 << 14)
+/* some GNU attributes are only available from GCC 4.3 */
+#define MEM_GNU_ATTRIBUTES (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403))
+
struct MemArena;
typedef struct MemArena MemArena;
struct MemArena *BLI_memarena_new(const int bufsize, const char *name)
-#ifdef __GNUC__
+#if MEM_GNU_ATTRIBUTES
__attribute__((warn_unused_result))
__attribute__((nonnull(2)))
#endif
;
void BLI_memarena_free(struct MemArena *ma)
-#ifdef __GNUC__
+#if MEM_GNU_ATTRIBUTES
__attribute__((nonnull(1)))
#endif
;
void BLI_memarena_use_malloc(struct MemArena *ma)
-#ifdef __GNUC__
+#if MEM_GNU_ATTRIBUTES
__attribute__((nonnull(1)))
#endif
;
void BLI_memarena_use_calloc(struct MemArena *ma)
-#ifdef __GNUC__
+#if MEM_GNU_ATTRIBUTES
__attribute__((nonnull(1)))
#endif
;
void BLI_memarena_use_align(struct MemArena *ma, const int align)
-#ifdef __GNUC__
+#if MEM_GNU_ATTRIBUTES
__attribute__((nonnull(1)))
#endif
;
void *BLI_memarena_alloc(struct MemArena *ma, int size)
-#ifdef __GNUC__
+#if MEM_GNU_ATTRIBUTES
__attribute__((warn_unused_result))
__attribute__((nonnull(1)))
__attribute__((alloc_size(2)))