diff --git a/pvAccessApp/utils/likely.h b/pvAccessApp/utils/likely.h new file mode 100644 index 0000000..7112be4 --- /dev/null +++ b/pvAccessApp/utils/likely.h @@ -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_ */