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>2018-03-20 18:55:16 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-03-20 18:55:16 +0300
commite0388bc61a8825b68d584f799a2b03dec5f36d96 (patch)
tree5a66d4d3c2749e32b8f4e8fef1534856755499f2 /source/blender
parentebbb55dd80531f1932b089d39f7350f265db7323 (diff)
parent69e35429bf879fcfe893b7824479274c2ae8d051 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/cachefile.c1
-rw-r--r--source/blender/blenlib/BLI_assert.h47
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_types.h1
-rw-r--r--source/blender/depsgraph/util/deg_util_function.h2
5 files changed, 23 insertions, 30 deletions
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c
index f8215668034..aebec3dfeed 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -181,7 +181,6 @@ void BKE_cachefile_update_frame(Main *bmain, Scene *scene, const float ctime, co
ABC_free_handle(cache_file->handle);
cache_file->handle = ABC_create_handle(filename, NULL);
#endif
- break;
}
}
}
diff --git a/source/blender/blenlib/BLI_assert.h b/source/blender/blenlib/BLI_assert.h
index 9fb0954e77f..b66b95b21fe 100644
--- a/source/blender/blenlib/BLI_assert.h
+++ b/source/blender/blenlib/BLI_assert.h
@@ -46,33 +46,28 @@ extern "C" {
#ifndef NDEBUG
# include "BLI_system.h"
-# ifdef WITH_ASSERT_ABORT
-# define _BLI_DUMMY_ABORT abort
+ /* _BLI_ASSERT_PRINT_POS */
+# if defined(__GNUC__)
+# define _BLI_ASSERT_PRINT_POS(a) \
+ fprintf(stderr, "BLI_assert failed: %s:%d, %s(), at \'%s\'\n", __FILE__, __LINE__, __func__, #a)
+# elif defined(_MSC_VER)
+# define _BLI_ASSERT_PRINT_POS(a) \
+ fprintf(stderr, "BLI_assert failed: %s:%d, %s(), at \'%s\'\n", __FILE__, __LINE__, __FUNCTION__, #a)
# else
-# define _BLI_DUMMY_ABORT() (void)0
+# define _BLI_ASSERT_PRINT_POS(a) \
+ fprintf(stderr, "BLI_assert failed: %s:%d, at \'%s\'\n", __FILE__, __LINE__, #a)
# endif
-# if defined(__GNUC__) || defined(_MSC_VER) /* check __func__ is available */
-# define BLI_assert(a) \
- (void)((!(a)) ? ( \
- ( \
- BLI_system_backtrace(stderr), \
- fprintf(stderr, \
- "BLI_assert failed: %s:%d, %s(), at \'%s\'\n", \
- __FILE__, __LINE__, __func__, "" #a), \
- _BLI_DUMMY_ABORT(), \
- NULL)) : NULL)
+ /* _BLI_ASSERT_ABORT */
+# ifdef WITH_ASSERT_ABORT
+# define _BLI_ASSERT_ABORT abort
# else
-# define BLI_assert(a) \
- (void)((!(a)) ? ( \
- ( \
- fprintf(stderr, \
- "BLI_assert failed: %s:%d, at \'%s\'\n", \
- __FILE__, __LINE__, "" #a), \
- _BLI_DUMMY_ABORT(), \
- NULL)) : NULL)
+# define _BLI_ASSERT_ABORT() (void)0
# endif
+ /* BLI_assert */
+# define BLI_assert(a) \
+ (void)((!(a)) ? ((BLI_system_backtrace(stderr), _BLI_ASSERT_PRINT_POS(a), _BLI_ASSERT_ABORT(), NULL)) : NULL)
#else
-# define BLI_assert(a) (void)0
+# define BLI_assert(a) ((void)0)
#endif
/* C++ can't use _Static_assert, expects static_assert() but c++0x only,
@@ -85,19 +80,19 @@ extern "C" {
/* Code adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html */
/* Note we need the two concats below because arguments to ## are not expanded, so we need to
* expand __LINE__ with one indirection before doing the actual concatenation. */
-# define ASSERT_CONCAT_(a, b) a##b
-# define ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b)
+# define _BLI_ASSERT_CONCAT_(a, b) a##b
+# define _BLI_ASSERT_CONCAT(a, b) _BLI_ASSERT_CONCAT_(a, b)
/* These can't be used after statements in c89. */
# if defined(__COUNTER__) /* MSVC */
# define BLI_STATIC_ASSERT(a, msg) \
- ; enum { ASSERT_CONCAT(static_assert_, __COUNTER__) = 1 / (int)(!!(a)) };
+ ; enum { _BLI_ASSERT_CONCAT(static_assert_, __COUNTER__) = 1 / (int)(!!(a)) };
# else /* older gcc, clang... */
/* This can't be used twice on the same line so ensure if using in headers
* that the headers are not included twice (by wrapping in #ifndef...#endif)
* Note it doesn't cause an issue when used on same line of separate modules
* compiled with gcc -combine -fwhole-program. */
# define BLI_STATIC_ASSERT(a, msg) \
- ; enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1 / (int)(!!(a)) };
+ ; enum { _BLI_ASSERT_CONCAT(assert_line_, __LINE__) = 1 / (int)(!!(a)) };
# endif
#endif
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index 1f517471407..eed06c7841b 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -368,10 +368,8 @@ MINLINE int compare_ff_relative(float a, float b, const float max_diff, const in
{
union {float f; int i;} ua, ub;
-#if 0 /* No BLI_assert in INLINE :/ */
BLI_assert(sizeof(float) == sizeof(int));
BLI_assert(max_ulps < (1 << 22));
-#endif
if (fabsf(a - b) <= max_diff) {
return 1;
diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h
index f8699186866..b4a0dde1f35 100644
--- a/source/blender/depsgraph/intern/depsgraph_types.h
+++ b/source/blender/depsgraph/intern/depsgraph_types.h
@@ -43,6 +43,7 @@
*/
#include <string>
#include <vector>
+#include <algorithm>
struct bAction;
struct ChannelDriver;
diff --git a/source/blender/depsgraph/util/deg_util_function.h b/source/blender/depsgraph/util/deg_util_function.h
index da31bb037f9..96f52147fe7 100644
--- a/source/blender/depsgraph/util/deg_util_function.h
+++ b/source/blender/depsgraph/util/deg_util_function.h
@@ -30,7 +30,7 @@
#pragma once
-#if (__cplusplus > 199711L)
+#if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
#include <functional>