1 /*
2     Copyright (c) 2009-2012 250bpm s.r.o.
3     Copyright (c) 2009-2011 Other contributors as noted in the AUTHORS file
4 
5     This file is part of Crossroads I/O project.
6 
7     Crossroads I/O is free software; you can redistribute it and/or modify it
8     under the terms of the GNU Lesser General Public License as published by
9     the Free Software Foundation; either version 3 of the License, or
10     (at your option) any later version.
11 
12     Crossroads is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU Lesser General Public License for more details.
16 
17     You should have received a copy of the GNU Lesser General Public License
18     along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef __XS_LIKELY_HPP_INCLUDED__
22 #define __XS_LIKELY_HPP_INCLUDED__
23 
24 #if defined __GNUC__
25 #define likely(x) __builtin_expect ((x), 1)
26 #define unlikely(x) __builtin_expect ((x), 0)
27 #else
28 #define likely(x) (x)
29 #define unlikely(x) (x)
30 #endif
31 
32 
33 #endif
34