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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-09-01 19:01:15 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-09-01 19:01:15 +0400
commit35b61a7512dc1b8b1d8bc562aad2a72d254b8a69 (patch)
tree5050db48823af6cf23eee62b5a013e2f208fdded /source/blender/blenlib/BLI_endian_switch.h
parent901dea87a1266479d3b7aab6cfd2d5fbf6adc393 (diff)
Move GCC attributes into a centraized defines
Instead of having ifdef __GNUC__ all over the headers to use special compiler's hints use a special file where all things like this are concentrated. Makes code easier to follow and allows to manage special attributes in more efficient way. Thanks Campbell for review!
Diffstat (limited to 'source/blender/blenlib/BLI_endian_switch.h')
-rw-r--r--source/blender/blenlib/BLI_endian_switch.h41
1 files changed, 17 insertions, 24 deletions
diff --git a/source/blender/blenlib/BLI_endian_switch.h b/source/blender/blenlib/BLI_endian_switch.h
index f48b1b072c3..35242fecf4a 100644
--- a/source/blender/blenlib/BLI_endian_switch.h
+++ b/source/blender/blenlib/BLI_endian_switch.h
@@ -27,35 +27,28 @@
* \ingroup bli
*/
-#ifdef __GNUC__
-# define ATTR_ENDIAN_SWITCH \
- __attribute__((nonnull(1)))
-#else
-# define ATTR_ENDIAN_SWITCH
-#endif
+#include "BLI_compiler_attrs.h"
/* BLI_endian_switch_inline.h */
-BLI_INLINE void BLI_endian_switch_int16(short *val) ATTR_ENDIAN_SWITCH;
-BLI_INLINE void BLI_endian_switch_uint16(unsigned short *val) ATTR_ENDIAN_SWITCH;
-BLI_INLINE void BLI_endian_switch_int32(int *val) ATTR_ENDIAN_SWITCH;
-BLI_INLINE void BLI_endian_switch_uint32(unsigned int *val) ATTR_ENDIAN_SWITCH;
-BLI_INLINE void BLI_endian_switch_float(float *val) ATTR_ENDIAN_SWITCH;
-BLI_INLINE void BLI_endian_switch_int64(int64_t *val) ATTR_ENDIAN_SWITCH;
-BLI_INLINE void BLI_endian_switch_uint64(uint64_t *val) ATTR_ENDIAN_SWITCH;
-BLI_INLINE void BLI_endian_switch_double(double *val) ATTR_ENDIAN_SWITCH;
+BLI_INLINE void BLI_endian_switch_int16(short *val) ATTR_NONNULL(1);
+BLI_INLINE void BLI_endian_switch_uint16(unsigned short *val) ATTR_NONNULL(1);
+BLI_INLINE void BLI_endian_switch_int32(int *val) ATTR_NONNULL(1);
+BLI_INLINE void BLI_endian_switch_uint32(unsigned int *val) ATTR_NONNULL(1);
+BLI_INLINE void BLI_endian_switch_float(float *val) ATTR_NONNULL(1);
+BLI_INLINE void BLI_endian_switch_int64(int64_t *val) ATTR_NONNULL(1);
+BLI_INLINE void BLI_endian_switch_uint64(uint64_t *val) ATTR_NONNULL(1);
+BLI_INLINE void BLI_endian_switch_double(double *val) ATTR_NONNULL(1);
/* endian_switch.c */
-void BLI_endian_switch_int16_array(short *val, const int size) ATTR_ENDIAN_SWITCH;
-void BLI_endian_switch_uint16_array(unsigned short *val, const int size) ATTR_ENDIAN_SWITCH;
-void BLI_endian_switch_int32_array(int *val, const int size) ATTR_ENDIAN_SWITCH;
-void BLI_endian_switch_uint32_array(unsigned int *val, const int size) ATTR_ENDIAN_SWITCH;
-void BLI_endian_switch_float_array(float *val, const int size) ATTR_ENDIAN_SWITCH;
-void BLI_endian_switch_int64_array(int64_t *val, const int size) ATTR_ENDIAN_SWITCH;
-void BLI_endian_switch_uint64_array(uint64_t *val, const int size) ATTR_ENDIAN_SWITCH;
-void BLI_endian_switch_double_array(double *val, const int size) ATTR_ENDIAN_SWITCH;
+void BLI_endian_switch_int16_array(short *val, const int size) ATTR_NONNULL(1);
+void BLI_endian_switch_uint16_array(unsigned short *val, const int size) ATTR_NONNULL(1);
+void BLI_endian_switch_int32_array(int *val, const int size) ATTR_NONNULL(1);
+void BLI_endian_switch_uint32_array(unsigned int *val, const int size) ATTR_NONNULL(1);
+void BLI_endian_switch_float_array(float *val, const int size) ATTR_NONNULL(1);
+void BLI_endian_switch_int64_array(int64_t *val, const int size) ATTR_NONNULL(1);
+void BLI_endian_switch_uint64_array(uint64_t *val, const int size) ATTR_NONNULL(1);
+void BLI_endian_switch_double_array(double *val, const int size) ATTR_NONNULL(1);
#include "BLI_endian_switch_inline.h"
-#undef ATTR_ENDIAN_SWITCH
-
#endif /* __BLI_ENDIAN_SWITCH_H__ */