#include <stdlib.h>
#include <string.h>
+#ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
#include <mach/mach_host.h>
#include <sys/mman.h>
#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
#include <ImageIO/ImageIO.h>
#endif
+#endif
#include <gvc/gvplugin_device.h>
#include <gvc/gvplugin_render.h>
{
CGContextRef context = (CGContextRef) job->context;
+#ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
void* context_data;
size_t context_datalen;
context_datalen = CGBitmapContextGetBytesPerRow(context) * CGBitmapContextGetHeight(context);
break;
}
+#endif
#endif
switch (job->device.id) {
*((CGImageRef *) job->window) = CGBitmapContextCreateImage(context);
break;
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
+#if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000)
default: /* bitmap formats */
{
/* create an image destination */
CGContextRelease(context);
+#ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
if (context_data && context_datalen)
munmap(context_data, context_datalen);
#endif
+#endif
}
static void quartzgen_begin_page(GVJ_t * job)
void *buffer = NULL;
+#ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
/* iPhoneOS has no swap files for memory, so if we're short of memory we need to make our own temp scratch file to back it */
buffer_size,
PROT_READ | PROT_WRITE,
MAP_ANON | MAP_SHARED, -1, 0);
+#endif
#endif
/* create a true color bitmap for drawing into */
RGBA_DOUBLE /* color_type */
};
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
+#if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000)
static gvdevice_features_t device_features_quartz = {
GVDEVICE_BINARY_FORMAT | GVDEVICE_DOES_TRUECOLOR, /* flags */
{0., 0.}, /* default margin - points */
gvplugin_installed_t gvdevice_quartz_types[] = {
{FORMAT_PDF, "pdf:quartz", 8, NULL, &device_features_quartz_paged},
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
+#if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000)
{FORMAT_CGIMAGE, "cgimage:quartz", 8, NULL, &device_features_quartz},
#endif
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
+#if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000)
{FORMAT_BMP, "bmp:quartz", 8, NULL, &device_features_quartz},
{FORMAT_GIF, "gif:quartz", 8, NULL, &device_features_quartz},
{FORMAT_ICO, "ico:quartz", 8, NULL, &device_features_quartz},
{FORMAT_TIFF, "tiff:quartz", 8, NULL, &device_features_quartz},
{FORMAT_TGA, "tga:quartz", 8, NULL, &device_features_quartz},
#endif
+#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040
{FORMAT_EXR, "exr:quartz", 8, NULL, &device_features_quartz},
{FORMAT_ICNS, "icns:quartz", 8, NULL, &device_features_quartz},
{FORMAT_PICT, "pict:quartz", 8, NULL, &device_features_quartz},
{FORMAT_PSD, "psd:quartz", 8, NULL, &device_features_quartz},
{FORMAT_SGI, "sgi:quartz", 8, NULL, &device_features_quartz},
+#endif
#endif
{0, NULL, 0, NULL, NULL}
};