Commit 38bf54bb authored by Albert Astals Cid's avatar Albert Astals Cid

move the declaration of likely/unlikely to an own file in goo/

parent 9838edf8
//========================================================================
//
// GooLikely.h
//
// This file is licensed under the GPLv2 or later
//
// Copyright (C) 2008 Kees Cook <kees@outflux.net>
//
//========================================================================
#ifndef GOOLIKELY_H
#define GOOLIKELY_H
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
# 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
......@@ -17,6 +17,7 @@ poppler_goo_include_HEADERS = \
PNGWriter.h \
JpegWriter.h \
ImgWriter.h \
GooLikely.h \
gstrtod.h
endif
......
......@@ -35,16 +35,9 @@
#include "goo/gtypes.h"
#include "goo/gmem.h"
#include "goo/GooString.h"
#include "goo/GooLikely.h"
#include "Error.h"
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
# define likely(x) __builtin_expect((x), 1)
# define unlikely(x) __builtin_expect((x), 0)
#else
# define likely(x) (x)
# define unlikely(x) (x)
#endif
#define OBJECT_TYPE_CHECK(wanted_type) \
if (unlikely(type != wanted_type)) { \
error(0, (char *) "Call to Object where the object was type %d, " \
......
......@@ -29,6 +29,7 @@
#include <string.h>
#include <limits.h>
#include "goo/gmem.h"
#include "goo/GooLikely.h"
#include "SplashErrorCodes.h"
#include "SplashMath.h"
#include "SplashBitmap.h"
......@@ -42,9 +43,6 @@
#include "SplashGlyphBitmap.h"
#include "Splash.h"
// to get the unlikely definition
#include "Object.h"
//------------------------------------------------------------------------
// distance of Bezier control point from center for circle approximation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment