#include "Pooling.hpp"
 
 #if defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__))
+#include <unistd.h>
+
 #include <sys/fcntl.h>
 #include <sys/mman.h>
 
     off_t offset;
     _assert(csops(pid, CS_OPS_PIDOFFSET, &offset, sizeof(offset)) != -1);
 
-    char path[PATH_MAX];
+    // XXX: implement a safe version of this
+    char path[4096];
     int writ(proc_pidpath(pid, path, sizeof(path)));
     _assert(writ != 0);
 
 
 AM_CPPFLAGS = -DYYDEBUG=1
 AM_CPPFLAGS += -include config.h -include $(srcdir)/unconfig.h
 
+AM_OBJCXXFLAGS = -fobjc-exceptions
+
 CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
 
 lib_LTLIBRARIES = 
 
 ACLOCAL_AMFLAGS = -I m4
 AM_CPPFLAGS = -DYYDEBUG=1 -include config.h -include \
        $(srcdir)/unconfig.h $(am__append_3) $(am__append_14)
+AM_OBJCXXFLAGS = -fobjc-exceptions
 CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
 lib_LTLIBRARIES = libcycript.la
 libcycript_la_LDFLAGS = $(CY_LDFLAGS)
 
     return string;
 }
 
-#ifdef __APPLE__
+#ifdef __clang__
 JSStringRef CYCopyJSString(JSContextRef context, NSString *value) {
     return JSStringCreateWithCFString(reinterpret_cast<CFStringRef>(value));
 }
         return NULL;
     // XXX: this definition scares me; is anyone using this?!
     NSString *string([value description]);
-#ifdef __APPLE__
+#ifdef __clang__
     return CYCopyJSString(context, string);
 #else
     CYPool pool;
     [json appendString:@"@["];
 
     bool comma(false);
-#ifdef __APPLE__
+#ifdef __clang__
     for (id object in self) {
 #else
     for (size_t index(0), count([self count]); index != count; ++index) {
     [json appendString:@"@{"];
 
     bool comma(false);
-#ifdef __APPLE__
+#ifdef __clang__
     for (NSObject *key in self) {
 #else
     NSEnumerator *keys([self keyEnumerator]);
 - (void) cy$getPropertyNames:(JSPropertyNameAccumulatorRef)names inContext:(JSContextRef)context {
     [super cy$getPropertyNames:names inContext:context];
 
-#ifdef __APPLE__
+#ifdef __clang__
     for (NSObject *key in self) {
 #else
     NSEnumerator *keys([self keyEnumerator]);
     CYGarbageCollect(context);
 
     CYPool pool;
-    Class _class(CYCastNSObject(&pool, context, arguments[0]));
+    id _class(CYCastNSObject(&pool, context, arguments[0]));
 
     vm_address_t *zones(NULL);
     unsigned size(0);