[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / bullet3 / src / BulletInverseDynamics / IDErrorMessages.hpp
1 ///@file error message utility functions
2 #ifndef IDUTILS_HPP_
3 #define IDUTILS_HPP_
4 #include <cstring>
5 /// name of file being compiled, without leading path components
6 #define __INVDYN_FILE_WO_DIR__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
7
8 #if !defined(BT_ID_WO_BULLET) && !defined(BT_USE_INVERSE_DYNAMICS_WITH_BULLET2)
9 #include "Bullet3Common/b3Logging.h"
10 #define bt_id_error_message(...) b3Error(__VA_ARGS__)
11 #define bt_id_warning_message(...) b3Warning(__VA_ARGS__)
12 #define id_printf(...) b3Printf(__VA_ARGS__)
13 #else  // BT_ID_WO_BULLET
14 #include <cstdio>
15 /// print error message with file/line information
16 #define bt_id_error_message(...)                                             \
17         do                                                                       \
18         {                                                                        \
19                 fprintf(stderr, "[Error:%s:%d] ", __INVDYN_FILE_WO_DIR__, __LINE__); \
20                 fprintf(stderr, __VA_ARGS__);                                        \
21         } while (0)
22 /// print warning message with file/line information
23 #define bt_id_warning_message(...)                                             \
24         do                                                                         \
25         {                                                                          \
26                 fprintf(stderr, "[Warning:%s:%d] ", __INVDYN_FILE_WO_DIR__, __LINE__); \
27                 fprintf(stderr, __VA_ARGS__);                                          \
28         } while (0)
29 #define id_printf(...) printf(__VA_ARGS__)
30 #endif  // BT_ID_WO_BULLET
31 #endif