[gegl] configure: use autoconf to define restrict



commit 4cc599c529323a07b7f9d54b03e5c1c8c860ceb0
Author: Danny Robson <danny blubinc net>
Date:   Mon Aug 2 21:11:29 2010 +1000

    configure: use autoconf to define restrict
    
    Instead of checking for restrict in each source file, use autoconf to
    define it globally.

 configure.ac                            |    1 +
 gegl/buffer/gegl-sampler-downsize.c     |   16 ----------------
 gegl/buffer/gegl-sampler-downsizefast.c |   15 ---------------
 gegl/buffer/gegl-sampler-linear.c       |   12 ------------
 gegl/buffer/gegl-sampler-upsharp.c      |   16 ----------------
 gegl/buffer/gegl-sampler-upsize.c       |   15 ---------------
 gegl/buffer/gegl-sampler-upsmooth.c     |   16 ----------------
 7 files changed, 1 insertions(+), 90 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c38db67..1729b4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -189,6 +189,7 @@ else
   AC_MSG_RESULT([no])
 fi
 
+AC_C_RESTRICT
 
 dnl disable docs generation.
 AC_ARG_ENABLE([docs],
diff --git a/gegl/buffer/gegl-sampler-downsize.c b/gegl/buffer/gegl-sampler-downsize.c
index 4c54ff1..17d033d 100644
--- a/gegl/buffer/gegl-sampler-downsize.c
+++ b/gegl/buffer/gegl-sampler-downsize.c
@@ -129,22 +129,6 @@ fast_minmod( const gfloat first, const gfloat second, const gfloat third )
  */
 #define FAST_PSEUDO_FLOOR(x) ( (int)(x) - ( (x) < 0. ) )
 
-/*
- * Hack to get the restrict C99 keyword going at least some of the
- * time:
- */
-#ifndef restrict
-#ifdef __restrict
-#define restrict __restrict
-#else
-#ifdef __restrict__
-#define restrict __restrict__
-#else
-#define restrict
-#endif
-#endif
-#endif
-
 enum
 {
   PROP_0,
diff --git a/gegl/buffer/gegl-sampler-downsizefast.c b/gegl/buffer/gegl-sampler-downsizefast.c
index f7a2470..7c57b93 100644
--- a/gegl/buffer/gegl-sampler-downsizefast.c
+++ b/gegl/buffer/gegl-sampler-downsizefast.c
@@ -87,21 +87,6 @@
  */
 #define FAST_PSEUDO_FLOOR(x) ( (int)(x) - ( (x) < 0. ) )
 
-/*
- * Hack to get the restrict C99 keyword going at least some of the
- * time:
- */
-#ifndef restrict
-#ifdef __restrict
-#define restrict __restrict
-#else
-#ifdef __restrict__
-#define restrict __restrict__
-#else
-#define restrict
-#endif
-#endif
-#endif
 
 enum
 {
diff --git a/gegl/buffer/gegl-sampler-linear.c b/gegl/buffer/gegl-sampler-linear.c
index 5f80a47..c5dfd1c 100644
--- a/gegl/buffer/gegl-sampler-linear.c
+++ b/gegl/buffer/gegl-sampler-linear.c
@@ -46,18 +46,6 @@
  * #define FAST_PSEUDO_FLOOR(x) ( (x)>=0 ? (int)(x) : (int)(x)-1 )
  */
 
-#ifndef restrict
-#ifdef __restrict
-#define restrict __restrict
-#else
-#ifdef __restrict__
-#define restrict __restrict__
-#else
-#define restrict
-#endif
-#endif
-#endif
-
 #include "config.h"
 #include <glib-object.h>
 #include <glib/gstdio.h>
diff --git a/gegl/buffer/gegl-sampler-upsharp.c b/gegl/buffer/gegl-sampler-upsharp.c
index cacbf89..242cfe5 100644
--- a/gegl/buffer/gegl-sampler-upsharp.c
+++ b/gegl/buffer/gegl-sampler-upsharp.c
@@ -224,22 +224,6 @@
  */
 #define FAST_PSEUDO_FLOOR(x) ( (gint)(x) - ( (x) < 0. ) )
 
-/*
- * Hack to get the restrict C99 keyword going at least some of the
- * time:
- */
-#ifndef restrict
-#ifdef __restrict
-#define restrict __restrict
-#else
-#ifdef __restrict__
-#define restrict __restrict__
-#else
-#define restrict
-#endif
-#endif
-#endif
-
 enum
 {
   PROP_0,
diff --git a/gegl/buffer/gegl-sampler-upsize.c b/gegl/buffer/gegl-sampler-upsize.c
index acf1913..06b0308 100644
--- a/gegl/buffer/gegl-sampler-upsize.c
+++ b/gegl/buffer/gegl-sampler-upsize.c
@@ -110,21 +110,6 @@
  */
 #define FAST_PSEUDO_FLOOR(x) ( (gint)(x) - ( (x) < 0. ) )
 
-/*
- * Hack to get the restrict C99 keyword going at least some of the
- * time:
- */
-#ifndef restrict
-#ifdef __restrict
-#define restrict __restrict
-#else
-#ifdef __restrict__
-#define restrict __restrict__
-#else
-#define restrict
-#endif
-#endif
-#endif
 
 enum
 {
diff --git a/gegl/buffer/gegl-sampler-upsmooth.c b/gegl/buffer/gegl-sampler-upsmooth.c
index 7a9958c..6224089 100644
--- a/gegl/buffer/gegl-sampler-upsmooth.c
+++ b/gegl/buffer/gegl-sampler-upsmooth.c
@@ -114,22 +114,6 @@
  */
 #define FAST_PSEUDO_FLOOR(x) ( (gint)(x) - ( (x) < 0. ) )
 
-/*
- * Hack to get the restrict C99 keyword going at least some of the
- * time:
- */
-#ifndef restrict
-#ifdef __restrict
-#define restrict __restrict
-#else
-#ifdef __restrict__
-#define restrict __restrict__
-#else
-#define restrict
-#endif
-#endif
-#endif
-
 enum
 {
   PROP_0,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]