mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-04-01 11:52:18 +02:00
(likely): Make them work even for non-GCC (or old GCC) compilers.
(unlikely): Ditto. (debug): Print to stderr. (dprintf): Ditto. (Logical change 1.48)
This commit is contained in:
parent
7fd45d122c
commit
a45c88823a
1 changed files with 11 additions and 6 deletions
|
@ -38,12 +38,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
# else
|
# else
|
||||||
# define HIDDEN
|
# define HIDDEN
|
||||||
# endif
|
# endif
|
||||||
# define likely(x) __builtin_expect ((x), 1)
|
# if (__GNUC__ >= 3)
|
||||||
# define unlikely(x) __builtin_expect ((x), 0)
|
# define likely(x) __builtin_expect ((x), 1)
|
||||||
|
# define unlikely(x) __builtin_expect ((x), 0)
|
||||||
|
# else
|
||||||
|
# define likely(x) (x)
|
||||||
|
# define unlikely(x) (x)
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# define HIDDEN
|
# define HIDDEN
|
||||||
# define likely(x)
|
# define likely(x) (x)
|
||||||
# define unlikely(x)
|
# define unlikely(x) (x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -53,9 +58,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
#if UNW_DEBUG
|
#if UNW_DEBUG
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# define debug(level,format...) \
|
# define debug(level,format...) \
|
||||||
do { if (tdep_debug_level > level) printf (format); } while (0)
|
do { if (tdep_debug_level > level) fprintf (stderr, format); } while (0)
|
||||||
# define dprintf(format...) \
|
# define dprintf(format...) \
|
||||||
printf (format)
|
fprintf (stderr, format)
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
# define inline __attribute__ ((unused))
|
# define inline __attribute__ ((unused))
|
||||||
# endif
|
# endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue