Line 0
Link Here
|
|
|
1 |
https://github.com/Libvisual/libvisual/commit/89702196c115b2cb27d90b123f8976aca110ade8 |
2 |
|
3 |
--- libvisual/lv_defines.h.orig 2006-01-22 14:23:37.000000000 +0100 |
4 |
+++ libvisual/lv_defines.h 2014-06-19 17:21:12.000000000 +0200 |
5 |
@@ -38,42 +38,39 @@ |
6 |
# define VISUAL_END_DECLS |
7 |
#endif /* __cplusplus */ |
8 |
|
9 |
-#ifdef NULL |
10 |
-#undef NULL |
11 |
-#endif |
12 |
- |
13 |
-/** |
14 |
- * NULL define. |
15 |
- */ |
16 |
-#define NULL ((void *) 0) |
17 |
+#ifndef NULL |
18 |
+# ifndef __cplusplus |
19 |
+# define NULL ((void *) 0) |
20 |
+# else |
21 |
+# define NULL 0 |
22 |
+# endif |
23 |
+#endif /* NULL */ |
24 |
|
25 |
#ifndef FALSE |
26 |
-/** |
27 |
- * FALSE define. |
28 |
- */ |
29 |
#define FALSE (0) |
30 |
#endif |
31 |
|
32 |
#ifndef TRUE |
33 |
-/** |
34 |
- * TRUE define. |
35 |
- */ |
36 |
-#define TRUE (!FALSE) |
37 |
+#define TRUE (1) |
38 |
#endif |
39 |
|
40 |
/* Compiler specific optimalization macros */ |
41 |
#if __GNUC__ >= 3 |
42 |
-# define inline inline __attribute__ ((always_inline)) |
43 |
-# define __malloc __attribute__ ((malloc)) |
44 |
-# define __packed __attribute__ ((packed)) |
45 |
-# define VIS_LIKELY(x) __builtin_expect (!!(x), 1) |
46 |
-# define VIS_UNLIKELY(x) __builtin_expect (!!(x), 0) |
47 |
+# ifndef __cplusplus |
48 |
+# define inline inline __attribute__ ((always_inline)) |
49 |
+# endif |
50 |
+# define VIS_ATTR_MALLOC __attribute__ ((malloc)) |
51 |
+# define VIS_ATTR_PACKED __attribute__ ((packed)) |
52 |
+# define VIS_LIKELY(x) __builtin_expect (!!(x), 1) |
53 |
+# define VIS_UNLIKELY(x) __builtin_expect (!!(x), 0) |
54 |
#else |
55 |
-# define inline /* no inline */ |
56 |
-# define __malloc /* no malloc */ |
57 |
-# define __packed /* no packed */ |
58 |
-# define VIS_LIKELY(x) (x) |
59 |
-# define VIS_UNLIKELY(x) (x) |
60 |
-#endif |
61 |
+# ifndef __cplusplus |
62 |
+# define inline /* no inline */ |
63 |
+# endif |
64 |
+# define VIS_ATTR_MALLOC /* no malloc */ |
65 |
+# define VIS_ATTR_PACKED /* no packed */ |
66 |
+# define VIS_LIKELY(x) (x) |
67 |
+# define VIS_UNLIKELY(x) (x) |
68 |
+#endif /* __GNUC__ >= 3 */ |
69 |
|
70 |
#endif /* _LV_DEFINES_H */ |
71 |
--- libvisual/lv_mem.h.orig 2006-01-22 14:23:37.000000000 +0100 |
72 |
+++ libvisual/lv_mem.h 2014-06-19 17:22:37.000000000 +0200 |
73 |
@@ -76,9 +76,9 @@ typedef void *(*VisMemSet32Func)(void *d |
74 |
|
75 |
/* prototypes */ |
76 |
int visual_mem_initialize (void); |
77 |
-void *visual_mem_malloc (visual_size_t nbytes) __malloc; |
78 |
-void *visual_mem_malloc0 (visual_size_t nbytes) __malloc; |
79 |
-void *visual_mem_realloc (void *ptr, visual_size_t nbytes) __malloc; |
80 |
+void *visual_mem_malloc (visual_size_t nbytes) VIS_ATTR_MALLOC; |
81 |
+void *visual_mem_malloc0 (visual_size_t nbytes) VIS_ATTR_MALLOC; |
82 |
+void *visual_mem_realloc (void *ptr, visual_size_t nbytes) VIS_ATTR_MALLOC; |
83 |
int visual_mem_free (void *ptr); |
84 |
|
85 |
/* Optimal performance functions set by visual_mem_initialize(). */ |