added missing likely.h

This commit is contained in:
Matej Sekoranja
2011-10-20 15:46:16 +02:00
parent 8464aacbef
commit 2c5b322a8c

View File

@@ -0,0 +1,18 @@
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* pvAccessCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef LIKELY_H_
#define LIKELY_H_
#if defined(__GNUC__)
#define likely(x) __builtin_expect (x, 1)
#define unlikely(x) __builtin_expect (x, 0)
#else
#define likely(x) (x)
#define unlikely(x) (x)
#endif
#endif /* LIKELY_H_ */