~ubuntu-branches/ubuntu/wily/libsereal-encoder-perl/wily

« back to all changes in this revision

Viewing changes to srl_common.h

  • Committer: Package Import Robot
  • Author(s): Alexandre Mestiashvili
  • Date: 2013-02-20 08:29:14 UTC
  • Revision ID: package-import@ubuntu.com-20130220082914-dljb6eixvtj2m1v2
Tags: upstream-0.31
ImportĀ upstreamĀ versionĀ 0.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SRL_COMMON_H_
 
2
#define SRL_COMMON_H_
 
3
 
 
4
#include "srl_inline.h"
 
5
 
 
6
/* inspired by JSON::XS code */
 
7
#if __GNUC__ >= 3
 
8
# define expect(expr,value) __builtin_expect((expr), (value))
 
9
#else
 
10
# define expect(expr,value) (expr)
 
11
#endif
 
12
 
 
13
#define expect_false(expr) expect((expr) != 0, 0)
 
14
#define expect_true(expr)  expect((expr) != 0, 1)
 
15
 
 
16
#endif