[cairo-commit] boilerplate/cairo-boilerplate.c boilerplate/cairo-boilerplate-private.h boilerplate/cairo-quartz-boilerplate.c boilerplate/cairo-quartz-boilerplate-private.h boilerplate/Makefile.am

Carl Worth cworth at kemper.freedesktop.org
Fri Apr 13 12:31:36 PDT 2007


 boilerplate/Makefile.am                        |    6 +++++-
 boilerplate/cairo-boilerplate.c                |    5 ++++-
 boilerplate/cairo-quartz-boilerplate-private.h |    8 ++------
 boilerplate/cairo-quartz-boilerplate.c         |    6 +-----
 4 files changed, 12 insertions(+), 13 deletions(-)

New commits:
diff-tree fcf49a56130ede8c6aa9f84a8c59ecef54714b7b (from cea107c9800a4414f57a874dd52924efdff725ec)
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Apr 13 12:02:11 2007 -0700

    boilerplate: Cleanup conditional compilation ofcairo-quartz-boilerplate.c
    
    It's much nicer to use automake to conditionally compile a file,
    instead of always compiling it and conditionally having the compiler
    see an empty file.

diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 40afea4..429fff4 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -2,12 +2,16 @@ EXTRA_LTLIBRARIES = libcairoboilerplate.
 
 libcairoboilerplate_la_SOURCES =\
 cairo-boilerplate.c	\
-cairo-quartz-boilerplate.c	\
 cairo-boilerplate.h	\
 xmalloc.c		\
 xmalloc.h
 libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la $(CAIRO_LDADD)
 
+if CAIRO_HAS_QUARTZ_SURFACE
+libcairoboilerplate_la_SOURCES += cairo-quartz-boilerplate.c
+libcairoboilerplate_la_SOURCES += cairo-quartz-boilerplate-private.h
+endif
+
 if CAIRO_HAS_BEOS_SURFACE
 libcairoboilerplate_la_SOURCES += cairo-test-beos.cpp cairo-test-beos.h
 # BeOS system headers trigger this warning
diff --git a/boilerplate/cairo-boilerplate-private.h b/boilerplate/cairo-boilerplate-private.h
deleted file mode 100644
index a523085..0000000
--- a/boilerplate/cairo-boilerplate-private.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
-/*
- * Copyright © 2004,2007 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of
- * Red Hat, Inc. not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Red Hat, Inc. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as
- * is" without express or implied warranty.
- *
- * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Carl D. Worth <cworth at cworth.org>
- */
-
-#ifndef _CAIRO_BOILERPLATE_PRIVATE_H_
-#define _CAIRO_BOILERPLATE_PRIVATE_H_
-
-#if CAIRO_HAS_QUARTZ_SURFACE
-
-cairo_surface_t *
-_cairo_quartz_boilerplate_create_surface (const char		*name,
-					  cairo_content_t	 content,
-					  int			 width,
-					  int			 height,
-					  cairo_boilerplate_mode_t  mode,
-					  void			**closure);
-
-void
-_cairo_quartz_boilerplate_cleanup (void *closure);
-
-#endif /* CAIRO_HAS_QUARTZ_SURFACE */
-
-#endif
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 109f75b..208f53a 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -25,7 +25,10 @@
  */
 
 #include "cairo-boilerplate.h"
-#include "cairo-boilerplate-private.h"
+
+#if CAIRO_HAS_QUARTZ_SURFACE
+#include "cairo-quartz-boilerplate-private.h"
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/boilerplate/cairo-quartz-boilerplate-private.h b/boilerplate/cairo-quartz-boilerplate-private.h
new file mode 100644
index 0000000..ef5ea2c
--- /dev/null
+++ b/boilerplate/cairo-quartz-boilerplate-private.h
@@ -0,0 +1,41 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2007 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Red Hat, Inc. not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Red Hat, Inc. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Carl D. Worth <cworth at cworth.org>
+ */
+
+#ifndef _CAIRO_QUARTZ_BOILERPLATE_PRIVATE_H_
+#define _CAIRO_QUARTZ_BOILERPLATE_PRIVATE_H_
+
+cairo_surface_t *
+_cairo_quartz_boilerplate_create_surface (const char		*name,
+					  cairo_content_t	 content,
+					  int			 width,
+					  int			 height,
+					  cairo_boilerplate_mode_t  mode,
+					  void			**closure);
+
+void
+_cairo_quartz_boilerplate_cleanup (void *closure);
+
+#endif
diff --git a/boilerplate/cairo-quartz-boilerplate.c b/boilerplate/cairo-quartz-boilerplate.c
index 8cf6a5c..369b2da 100644
--- a/boilerplate/cairo-quartz-boilerplate.c
+++ b/boilerplate/cairo-quartz-boilerplate.c
@@ -25,9 +25,7 @@
  */
 
 #include "cairo-boilerplate.h"
-#include "cairo-boilerplate-private.h"
-
-#if CAIRO_HAS_QUARTZ_SURFACE
+#include "cairo-quartz-boilerplate-private.h"
 
 #include <cairo-quartz.h>
 
@@ -60,5 +58,3 @@ _cairo_quartz_boilerplate_cleanup (void 
 {
     /* nothing */
 }
-#endif
-


More information about the cairo-commit mailing list