Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Most of these changes were made many months ago and never committed. …

…I honestly have no idea what I was in the middle of doing at the time.
  • Loading branch information...
commit 6334971ec735bb03a03ebf140f208239ffe9178f 1 parent a80be21
@ttilley ttilley authored
View
BIN  bin/fsevent_watch
Binary file not shown
View
71 ext/fsevent_watch/Info.plist
@@ -1,38 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+#include "fsevent_watch/defines.h"
+-->
<plist version="1.0">
-<dict>
- <key>CFBundleIdentifier</key>
- <string>com.teaspoonofinsanity.fsevent_watch</string>
- <key>CFBundleExecutable</key>
- <string>fsevent_watch</string>
- <key>CFBundleName</key>
- <string>fsevent_watch</string>
- <key>LSMinimumSystemVersion</key>
- <string>MACOSX_DEPLOYMENT_TARGET</string>
- <key>CFBundleVersion</key>
- <string>CURRENT_PROJECT_VERSION</string>
- <key>FSEWOptimizationLevel</key>
- <string>OPTIMIZATION_LEVEL</string>
- <key>FSEWVersionInfoBuilder</key>
- <string>VERSION_INFO_BUILDER</string>
- <key>FSEWVersionInfoString</key>
- <string>VERSION_INFO_STRING</string>
- <key>BuildMachineOSBuild</key>
- <string>MAC_OS_X_PRODUCT_BUILD_VERSION</string>
- <key>BuildMachineOSVersion</key>
- <string>MAC_OS_X_VERSION_ACTUAL</string>
- <key>DTCompiler</key>
- <string>GCC_VERSION</string>
- <key>DTPlatformBuild</key>
- <string>PLATFORM_PRODUCT_BUILD_VERSION</string>
- <key>DTSDKBuild</key>
- <string>SDK_PRODUCT_BUILD_VERSION</string>
- <key>DTSDKName</key>
- <string>SDK_NAME</string>
- <key>DTXcode</key>
- <string>XCODE_VERSION_ACTUAL</string>
- <key>DTXcodeBuild</key>
- <string>XCODE_PRODUCT_BUILD_VERSION</string>
-</dict>
+ <dict>
+ <key>CFBundleExecutable</key>
+ <string>fsevent_watch</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.teaspoonofinsanity.fsevent_watch</string>
+ <key>CFBundleName</key>
+ <string>fsevent_watch</string>
+ <key>CFBundleVersion</key>
+ <string>PROJECT_VERSION</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>MACOSX_DEPLOYMENT_TARGET</string>
+ <key>DTSDKBuild</key>
+ <string>SDK_PRODUCT_BUILD_VERSION</string>
+ <key>DTSDKName</key>
+ <string>SDK_NAME</string>
+ <key>BuildMachineOSBuild</key>
+ <string>MAC_OS_X_PRODUCT_BUILD_VERSION</string>
+ <key>BuildMachineOSVersion</key>
+ <string>MAC_OS_X_VERSION_ACTUAL</string>
+ <key>FSEWCompiledAt</key>
+ <string>COMPILED_AT</string>
+ <key>FSEWCompiler</key>
+ <string>COMPILER</string>
+ <key>FSEWCompilerVersion</key>
+ <string>__VERSION__</string>
+ <key>FSEWCompilerTargetCPU</key>
+ <string>TARGET_CPU</string>
+ <key>FSEWOptimizationLevel</key>
+ <string>OPTIMIZATION_LEVEL</string>
+ <key>FSEWVersionInfoBuilder</key>
+ <string>VERSION_INFO_BUILDER</string>
+ <key>SystemVersionMaxAllowed</key>
+ <string>__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__</string>
+ </dict>
</plist>
View
12 ext/fsevent_watch/fsevent_watch.xcodeproj/project.pbxproj
@@ -45,6 +45,7 @@
6A8F495514AC05470094EE00 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
6A8F495614AC05470094EE00 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
6A8F495714AC05470094EE00 /* fsevent_watch.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = fsevent_watch.xcconfig; sourceTree = "<group>"; };
+ 6AD26B45153CD58900823871 /* defines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = defines.h; sourceTree = "<group>"; };
6AD3022F13F8D758007F24E8 /* compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compat.h; sourceTree = "<group>"; };
EDF2B90C143584E800C6EF62 /* compat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = compat.c; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -103,6 +104,7 @@
6A57F70613F5E614000BE6A9 /* main.c */,
6AD3022F13F8D758007F24E8 /* compat.h */,
EDF2B90C143584E800C6EF62 /* compat.c */,
+ 6AD26B45153CD58900823871 /* defines.h */,
);
path = fsevent_watch;
sourceTree = "<group>";
@@ -145,7 +147,7 @@
6A57F6F613F5E614000BE6A9 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0420;
+ LastUpgradeCheck = 0460;
ORGANIZATIONNAME = TeaspoonOfInsanity;
};
buildConfigurationList = 6A57F6F913F5E614000BE6A9 /* Build configuration list for PBXProject "fsevent_watch" */;
@@ -180,7 +182,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "${CC:-cc} -E -P -x c -Wno-trigraphs -traditional -CC \\\n-DCURRENT_PROJECT_VERSION=\"${CURRENT_PROJECT_VERSION}\" \\\n-DGCC_VERSION=\"${GCC_VERSION}\" \\\n-DMACOSX_DEPLOYMENT_TARGET=\"${MACOSX_DEPLOYMENT_TARGET}\" \\\n-DMAC_OS_X_PRODUCT_BUILD_VERSION=\"${MAC_OS_X_PRODUCT_BUILD_VERSION}\" \\\n-DMAC_OS_X_VERSION_ACTUAL=\"${MAC_OS_X_VERSION_ACTUAL}\" \\\n-DOPTIMIZATION_LEVEL=\"${OPTIMIZATION_LEVEL}\" \\\n-DPLATFORM_PRODUCT_BUILD_VERSION=\"${PLATFORM_PRODUCT_BUILD_VERSION}\" \\\n-DSDK_NAME=\"${SDK_NAME}\" \\\n-DSDK_PRODUCT_BUILD_VERSION=\"${SDK_PRODUCT_BUILD_VERSION}\" \\\n-DVERSION_INFO_BUILDER=\"${VERSION_INFO_BUILDER}\" \\\n-DVERSION_INFO_STRING=\"${VERSION_INFO_STRING}\" \\\n-DXCODE_PRODUCT_BUILD_VERSION=\"${XCODE_PRODUCT_BUILD_VERSION}\" \\\n-DXCODE_VERSION_ACTUAL=\"${XCODE_VERSION_ACTUAL}\" \\\n\"${SRCROOT}/Info.plist\" \\\n-o \"${DERIVED_FILE_DIR}/Info.plist\"\n";
+ shellScript = "${CC:-cc} -E -P -x c -Wno-trigraphs -traditional -CC \\\n-DPROJECT_VERSION=\"${CURRENT_PROJECT_VERSION}\" \\\n-DGCC_VERSION=\"${GCC_VERSION}\" \\\n-DMACOSX_DEPLOYMENT_TARGET=\"${MACOSX_DEPLOYMENT_TARGET}\" \\\n-DMAC_OS_X_PRODUCT_BUILD_VERSION=\"${MAC_OS_X_PRODUCT_BUILD_VERSION}\" \\\n-DMAC_OS_X_VERSION_ACTUAL=\"${MAC_OS_X_VERSION_ACTUAL}\" \\\n-DOPTIMIZATION_LEVEL=\"${OPTIMIZATION_LEVEL}\" \\\n-DPLATFORM_PRODUCT_BUILD_VERSION=\"${PLATFORM_PRODUCT_BUILD_VERSION}\" \\\n-DSDK_NAME=\"${SDK_NAME}\" \\\n-DSDK_PRODUCT_BUILD_VERSION=\"${SDK_PRODUCT_BUILD_VERSION}\" \\\n-DVERSION_INFO_BUILDER=\"${VERSION_INFO_BUILDER}\" \\\n-DVERSION_INFO_STRING=\"${VERSION_INFO_STRING}\" \\\n-DXCODE_PRODUCT_BUILD_VERSION=\"${XCODE_PRODUCT_BUILD_VERSION}\" \\\n-DXCODE_VERSION_ACTUAL=\"${XCODE_VERSION_ACTUAL}\" \\\n\"${SRCROOT}/Info.plist\" \\\n-o \"${DERIVED_FILE_DIR}/Info.plist\"\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -203,6 +205,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 6A8F495514AC05470094EE00 /* Debug.xcconfig */;
buildSettings = {
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
};
name = Debug;
};
@@ -210,6 +213,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 6A8F495614AC05470094EE00 /* Release.xcconfig */;
buildSettings = {
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
};
name = Release;
};
@@ -237,7 +241,7 @@
6A57F70B13F5E614000BE6A9 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
+ defaultConfigurationName = Debug;
};
6A57F70C13F5E614000BE6A9 /* Build configuration list for PBXNativeTarget "fsevent_watch" */ = {
isa = XCConfigurationList;
@@ -246,7 +250,7 @@
6A57F70E13F5E614000BE6A9 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
+ defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
};
View
78 ext/fsevent_watch/fsevent_watch/TSICTString.c
@@ -65,13 +65,13 @@ static inline TStringIRep* TSICTStringCreateWithDataOfTypeAndFormat(CFDataRef da
if (format == kTSITStringFormatDefault) {
format = TSICTStringGetDefaultFormat();
}
-
+
TStringIRep* rep = calloc(1, sizeof(TStringIRep));
rep->data = CFDataCreateCopy(kCFAllocatorDefault, data);
rep->type = type;
rep->format = format;
rep->length = calloc(10, sizeof(char));
-
+
CFIndex len = CFDataGetLength(rep->data);
if (snprintf(rep->length, 10, "%lu", len)) {
return rep;
@@ -86,10 +86,10 @@ static inline CFDataRef TSICTStringCreateDataFromIntermediateRepresentation(TStr
CFIndex len = CFDataGetLength(rep->data);
CFMutableDataRef buffer = CFDataCreateMutableCopy(kCFAllocatorDefault, (len + 12), rep->data);
UInt8* bufferBytes = CFDataGetMutableBytePtr(buffer);
-
+
size_t prefixLength = strlen(rep->length) + 1;
CFDataReplaceBytes(buffer, BeginningRange, (const UInt8*)rep->length, (CFIndex)prefixLength);
-
+
if (rep->format == kTSITStringFormatTNetstring) {
const UInt8 ftag = (UInt8)TNetstringTypes[rep->type];
CFDataAppendBytes(buffer, &ftag, 1);
@@ -98,10 +98,10 @@ static inline CFDataRef TSICTStringCreateDataFromIntermediateRepresentation(TStr
const UInt8 ftag = (UInt8)OTNetstringTypes[rep->type];
bufferBytes[(prefixLength - 1)] = ftag;
}
-
+
CFDataRef dataRep = CFDataCreateCopy(kCFAllocatorDefault, buffer);
CFRelease(buffer);
-
+
return dataRep;
}
@@ -116,21 +116,21 @@ static inline CFStringRef TSICTStringCreateStringFromIntermediateRepresentation(
static inline CFDataRef TSICTStringCreateDataWithDataOfTypeAndFormat(CFDataRef data, TSITStringTag type, TSITStringFormat format)
{
CFRetain(data);
-
+
if (format == kTSITStringFormatDefault) {
format = TSICTStringGetDefaultFormat();
}
-
+
TStringIRep* rep = TSICTStringCreateWithDataOfTypeAndFormat(data, type, format);
if (rep == NULL) {
return NULL;
}
-
+
CFDataRef result = TSICTStringCreateDataFromIntermediateRepresentation(rep);
-
+
TSICTStringDestroy(rep);
CFRelease(data);
-
+
return result;
}
@@ -139,15 +139,15 @@ static inline void TSICTStringAppendObjectToMutableDataWithFormat(CFTypeRef obje
if (object == NULL) {
object = kCFNull;
}
-
+
CFRetain(object);
-
+
TStringIRep* objRep = TSICTStringCreateWithObjectAndFormat(object, format);
CFDataRef objData = TSICTStringCreateDataFromIntermediateRepresentation(objRep);
CFDataAppendBytes(buffer, (CFDataGetBytePtr(objData)), CFDataGetLength(objData));
CFRelease(objData);
TSICTStringDestroy(objRep);
-
+
CFRelease(object);
}
@@ -156,7 +156,7 @@ static void ArrayBufferAppendCallback(const void* item, void* context)
TStringCollectionCallbackContext* cx = (TStringCollectionCallbackContext*)context;
CFMutableDataRef buffer = cx->buffer;
TSITStringFormat format = cx->format;
-
+
TSICTStringAppendObjectToMutableDataWithFormat(item, buffer, format);
}
@@ -165,7 +165,7 @@ static void DictionaryBufferAppendCallback(const void* key, const void* value, v
TStringCollectionCallbackContext* cx = (TStringCollectionCallbackContext*)context;
CFMutableDataRef buffer = cx->buffer;
TSITStringFormat format = cx->format;
-
+
TSICTStringAppendObjectToMutableDataWithFormat(key, buffer, format);
TSICTStringAppendObjectToMutableDataWithFormat(value, buffer, format);
}
@@ -181,15 +181,15 @@ CFDataRef TSICTStringCreateRenderedDataFromObjectWithFormat(CFTypeRef object, TS
if (object == NULL) {
object = kCFNull;
}
-
+
CFRetain(object);
-
+
TStringIRep* rep = TSICTStringCreateWithObjectAndFormat(object, format);
CFDataRef data = TSICTStringCreateDataFromIntermediateRepresentation(rep);
-
+
TSICTStringDestroy(rep);
CFRelease(object);
-
+
return data;
}
@@ -203,15 +203,15 @@ CFStringRef TSICTStringCreateRenderedStringFromObjectWithFormat(CFTypeRef object
if (object == NULL) {
object = kCFNull;
}
-
+
CFRetain(object);
-
+
TStringIRep* rep = TSICTStringCreateWithObjectAndFormat(object, format);
CFStringRef string = TSICTStringCreateStringFromIntermediateRepresentation(rep);
-
+
TSICTStringDestroy(rep);
CFRelease(object);
-
+
return string;
}
@@ -222,10 +222,10 @@ TStringIRep* TSICTStringCreateWithObjectAndFormat(CFTypeRef object, TSITStringFo
return TSICTStringCreateNullWithFormat(format);
}
CFRetain(object);
-
+
CFTypeID cfType = CFGetTypeID(object);
TStringIRep* rep = NULL;
-
+
if (cfType == kCFDataTypeID) {
rep = TSICTStringCreateWithDataOfTypeAndFormat(object, kTSITStringTagString, format);
} else if (cfType == kCFStringTypeID) {
@@ -247,7 +247,7 @@ TStringIRep* TSICTStringCreateWithObjectAndFormat(CFTypeRef object, TSITStringFo
} else {
rep = TSICTStringCreateInvalidWithFormat(format);
}
-
+
CFRelease(object);
return rep;
}
@@ -268,7 +268,7 @@ TStringIRep* TSICTStringCreateWithNumberAndFormat(CFNumberRef number, TSITString
TSITStringTag tag = kTSITStringTagNumber;
CFDataRef data;
CFNumberType numType = CFNumberGetType(number);
-
+
switch(numType) {
case kCFNumberCharType:
{
@@ -291,7 +291,7 @@ TStringIRep* TSICTStringCreateWithNumberAndFormat(CFNumberRef number, TSITString
break;
}
}
-
+
if (tag == kTSITStringTagBool) {
bool value;
CFNumberGetValue(number, kCFNumberIntType, &value);
@@ -304,17 +304,17 @@ TStringIRep* TSICTStringCreateWithNumberAndFormat(CFNumberRef number, TSITString
char buf[32];
char *p, *e;
double value;
-
+
CFNumberGetValue(number, numType, &value);
sprintf(buf, "%#.15g", value);
-
+
e = buf + strlen(buf);
p = e;
while (p[-1]=='0' && ('0' <= p[-2] && p[-2] <= '9')) {
p--;
}
memmove(p, e, strlen(e)+1);
-
+
data = CFDataCreate(kCFAllocatorDefault, (UInt8*)buf, (CFIndex)strlen(buf));
} else {
char buf[32];
@@ -323,7 +323,7 @@ TStringIRep* TSICTStringCreateWithNumberAndFormat(CFNumberRef number, TSITString
sprintf(buf, "%lli", value);
data = CFDataCreate(kCFAllocatorDefault, (UInt8*)buf, (CFIndex)strlen(buf));
}
-
+
TStringIRep* rep = TSICTStringCreateWithDataOfTypeAndFormat(data, tag, format);
CFRelease(data);
CFRelease(number);
@@ -365,13 +365,13 @@ TStringIRep* TSICTStringCreateInvalidWithFormat(TSITStringFormat format)
TStringIRep* TSICTStringCreateWithArrayAndFormat(CFArrayRef array, TSITStringFormat format)
{
CFRetain(array);
-
+
CFMutableDataRef buffer = CFDataCreateMutable(kCFAllocatorDefault, 0);
-
+
CFRange all = CFRangeMake(0, CFArrayGetCount(array));
TStringCollectionCallbackContext cx = {buffer, format};
CFArrayApplyFunction(array, all, ArrayBufferAppendCallback, &cx);
-
+
TStringIRep* rep = TSICTStringCreateWithDataOfTypeAndFormat(buffer, kTSITStringTagList, format);
CFRelease(buffer);
CFRelease(array);
@@ -381,12 +381,12 @@ TStringIRep* TSICTStringCreateWithArrayAndFormat(CFArrayRef array, TSITStringFor
TStringIRep* TSICTStringCreateWithDictionaryAndFormat(CFDictionaryRef dictionary, TSITStringFormat format)
{
CFRetain(dictionary);
-
+
CFMutableDataRef buffer = CFDataCreateMutable(kCFAllocatorDefault, 0);
-
+
TStringCollectionCallbackContext cx = {buffer, format};
CFDictionaryApplyFunction(dictionary, DictionaryBufferAppendCallback, &cx);
-
+
TStringIRep* rep = TSICTStringCreateWithDataOfTypeAndFormat(buffer, kTSITStringTagDict, format);
CFRelease(buffer);
CFRelease(dictionary);
View
2  ext/fsevent_watch/fsevent_watch/cli.c
@@ -134,13 +134,11 @@ int cli_parser (int argc, const char** argv, struct cli_info* args_info)
case 'V': // version
cli_print_version();
exit(EXIT_SUCCESS);
- break;
case 'h': // help
case '?': // invalid option
case ':': // missing argument
cli_print_help();
exit((c == 'h') ? EXIT_SUCCESS : EXIT_FAILURE);
- break;
}
}
View
5 ext/fsevent_watch/fsevent_watch/cli.h
@@ -1,6 +1,8 @@
#ifndef CLI_H
#define CLI_H
+#include "common.h"
+
#ifndef CLI_NAME
#define CLI_NAME "fsevent_watch"
#endif /* CLI_NAME */
@@ -10,12 +12,9 @@
#endif /* PROJECT_VERSION */
#ifndef CLI_VERSION
-#define _str(s) #s
-#define _xstr(s) _str(s)
#define CLI_VERSION _xstr(PROJECT_VERSION)
#endif /* CLI_VERSION */
-#include "common.h"
struct cli_info {
UInt64 since_when_arg;
View
14 ext/fsevent_watch/fsevent_watch/common.h
@@ -9,21 +9,9 @@
#include <CoreServices/CoreServices.h>
#include <unistd.h>
#include "compat.h"
+#include "defines.h"
#include "TSICTString.h"
-#define COMPILED_AT __DATE__ " " __TIME__
-
-#define FLAG_CHECK(flags, flag) ((flags) & (flag))
-
-#define FPRINTF_FLAG_CHECK(flags, flag, msg, fd) \
- do { \
- if (FLAG_CHECK(flags, flag)) { \
- fprintf(fd, "%s", msg "\n"); } } \
- while (0)
-
-#define FLAG_CHECK_STDERR(flags, flag, msg) \
- FPRINTF_FLAG_CHECK(flags, flag, msg, stderr)
-
enum FSEventWatchOutputFormat {
kFSEventWatchOutputFormatClassic,
kFSEventWatchOutputFormatNIW,
View
40 ext/fsevent_watch/fsevent_watch/defines.h
@@ -0,0 +1,40 @@
+#ifndef fsevent_watch_defines_h
+#define fsevent_watch_defines_h
+
+#define _str(s) #s
+#define _xstr(s) _str(s)
+
+#define COMPILED_AT __DATE__ " " __TIME__
+
+#if defined (__clang__)
+#define COMPILER "clang " __clang_version__
+#elif defined (__GNUC__)
+#define COMPILER "gcc " __VERSION__
+#else
+#define COMPILER "unknown"
+#endif
+
+#if defined(__ppc__)
+#define TARGET_CPU "ppc"
+#elif defined(__ppc64__)
+#define TARGET_CPU "ppc64"
+#elif defined(__i386__)
+#define TARGET_CPU "i386"
+#elif defined(__x86_64__)
+#define TARGET_CPU "x86_64"
+#else
+#define TARGET_CPU "unknown"
+#endif
+
+#define FLAG_CHECK(flags, flag) ((flags) & (flag))
+
+#define FPRINTF_FLAG_CHECK(flags, flag, msg, fd) \
+ do { \
+ if (FLAG_CHECK(flags, flag)) { \
+ fprintf(fd, "%s", msg "\n"); } } \
+ while (0)
+
+#define FLAG_CHECK_STDERR(flags, flag, msg) \
+ FPRINTF_FLAG_CHECK(flags, flag, msg, stderr)
+
+#endif /* fsevent_watch_defines_h */
View
50 ext/fsevent_watch/fsevent_watch/main.c
@@ -47,48 +47,48 @@ static void append_path(const char* path)
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
-
+
#ifdef DEBUG
fprintf(stderr, "compiled against 10.6+, using CFURLCreateFileReferenceURL\n");
#endif
-
+
CFURLRef url = CFURLCreateFromFileSystemRepresentation(NULL, (const UInt8*)path, (CFIndex)strlen(path), false);
CFURLRef placeholder = CFURLCopyAbsoluteURL(url);
CFRelease(url);
-
+
CFMutableArrayRef imaginary = NULL;
-
+
// if we don't have an existing url, spin until we get to a parent that
// does exist, saving any imaginary components for appending back later
while(!CFURLResourceIsReachable(placeholder, NULL)) {
#ifdef DEBUG
fprintf(stderr, "path does not exist\n");
#endif
-
+
CFStringRef child;
-
+
if (imaginary == NULL) {
imaginary = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
}
-
+
child = CFURLCopyLastPathComponent(placeholder);
CFArrayInsertValueAtIndex(imaginary, 0, child);
CFRelease(child);
-
+
url = CFURLCreateCopyDeletingLastPathComponent(NULL, placeholder);
CFRelease(placeholder);
placeholder = url;
-
+
#ifdef DEBUG
fprintf(stderr, "parent: ");
CFShow(placeholder);
#endif
}
-
+
#ifdef DEBUG
fprintf(stderr, "path exists\n");
#endif
-
+
// realpath() doesn't always return the correct case for a path, so this
// is a funky workaround that converts a path into a (volId/inodeId) pair
// and asks what the path should be for that. since it looks at the actual
@@ -98,12 +98,12 @@ static void append_path(const char* path)
CFRelease(placeholder);
placeholder = CFURLCreateFilePathURL(NULL, url, NULL);
CFRelease(url);
-
+
#ifdef DEBUG
fprintf(stderr, "path resolved to: ");
CFShow(placeholder);
#endif
-
+
// if we stripped off any imaginary path components, append them back on
if (imaginary != NULL) {
CFIndex count = CFArrayGetCount(imaginary);
@@ -119,30 +119,30 @@ static void append_path(const char* path)
}
CFRelease(imaginary);
}
-
+
#ifdef DEBUG
fprintf(stderr, "result: ");
CFShow(placeholder);
#endif
-
+
CFStringRef cfPath = CFURLCopyFileSystemPath(placeholder, kCFURLPOSIXPathStyle);
CFArrayAppendValue(config.paths, cfPath);
CFRelease(cfPath);
CFRelease(placeholder);
-
+
#else
-
+
#ifdef DEBUG
fprintf(stderr, "compiled against 10.5, using realpath()\n");
#endif
-
+
char fullPath[PATH_MAX + 1];
-
+
if (realpath(path, fullPath) == NULL) {
#ifdef DEBUG
fprintf(stderr, " realpath not directly resolvable from path\n");
#endif
-
+
if (path[0] != '/') {
#ifdef DEBUG
fprintf(stderr, " passed path is not absolute\n");
@@ -162,18 +162,18 @@ static void append_path(const char* path)
strlcpy(fullPath, path, sizeof(fullPath));
}
}
-
+
#ifdef DEBUG
fprintf(stderr, " resolved path to: %s\n", fullPath);
fprintf(stderr, "\n");
#endif
-
+
CFStringRef pathRef = CFStringCreateWithCString(kCFAllocatorDefault,
fullPath,
kCFStringEncodingUTF8);
CFArrayAppendValue(config.paths, pathRef);
CFRelease(pathRef);
-
+
#endif
}
@@ -249,7 +249,7 @@ static inline void parse_cli_settings(int argc, const char* argv[])
fprintf(stderr, "config.latency %f\n", config.latency);
// STFU clang
-#if __LP64__
+#if defined(__LP64__)
fprintf(stderr, "config.flags %#.8x\n", config.flags);
#else
fprintf(stderr, "config.flags %#.8lx\n", config.flags);
@@ -382,7 +382,7 @@ static void callback(__attribute__((unused)) FSEventStreamRef streamRef,
fprintf(stderr, " event ID: %llu\n", eventIds[i]);
// STFU clang
-#if __LP64__
+#if defined(__LP64__)
fprintf(stderr, " event flags: %#.8x\n", eventFlags[i]);
#else
fprintf(stderr, " event flags: %#.8lx\n", eventFlags[i]);
View
60 ext/fsevent_watch/xcconfig/Common.xcconfig
@@ -1,29 +1,38 @@
// local defines
-COMMON_CFLAGS = -pipe
-COMMON_GCC_PREPROCESSOR_DEFINITIONS = NS_BUILD_32_LIKE_64 NS_BLOCK_ASSERTIONS
+COMMON_CFLAGS = -fconstant-cfstrings
+COMMON_GCC_PREPROCESSOR_DEFINITIONS = NS_BUILD_32_LIKE_64 NS_BLOCK_ASSERTIONS OS_OBJECT_USE_OBJC=0
// architectures
ARCHS = $(ARCHS_STANDARD_32_64_BIT)
-VALID_ARCHS = i386 x86_64
-SDKROOT = macosx
-SUPPORTED_PLATFORMS = macosx
ONLY_ACTIVE_ARCH = NO
+SDKROOT =
+SUPPORTED_PLATFORMS = macosx
+VALID_ARCHS = i386 x86_64
// build options
DEBUG_INFORMATION_FORMAT = dwarf
GCC_VERSION = com.apple.compilers.llvm.clang.1_0
+GENERATE_PROFILING_CODE = NO
+PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO
RUN_CLANG_STATIC_ANALYZER = YES
+SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = NO
+VALIDATE_PRODUCT = YES
// deployment
+COPY_PHASE_STRIP = NO
+INSTALL_PATH = /usr/local/bin
MACOSX_DEPLOYMENT_TARGET = 10.6
+SEPARATE_STRIP = NO
+STRIP_INSTALLED_PRODUCT = NO
+STRIP_STYLE = non-global
// linking
-DEAD_CODE_STRIPPING = YES
-PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES
+DEAD_CODE_STRIPPING = NO
+GENERATE_MASTER_OBJECT_FILE = NO
LINK_WITH_STANDARD_LIBRARIES = YES
@@ -32,15 +41,22 @@ FRAMEWORK_SEARCH_PATHS = $(value) $(SYSTEM_LIBRARY_DIR)/Frameworks $(LOCAL_LIBRA
// code generation
+CLANG_X86_VECTOR_INSTRUCTIONS = default
GCC_DYNAMIC_NO_PIC = NO
GCC_FAST_OBJC_DISPATCH = YES
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
+GCC_INLINES_ARE_PRIVATE_EXTERN = NO
GCC_STRICT_ALIASING = YES
-LLVM_LTO = YES
+GCC_SYMBOLS_PRIVATE_EXTERN = NO
+GCC_UNROLL_LOOPS = NO
+LLVM_LTO = NO
// language
-GCC_C_LANGUAGE_STANDARD = gnu99
+CLANG_ENABLE_OBJC_ARC = NO
+GCC_C_LANGUAGE_STANDARD = gnu11
+GCC_ENABLE_OBJC_EXCEPTIONS = YES
+GCC_ENABLE_OBJC_GC = unsupported
OTHER_CFLAGS = $(COMMON_CFLAGS)
@@ -49,10 +65,14 @@ GCC_PREPROCESSOR_DEFINITIONS = $(COMMON_GCC_PREPROCESSOR_DEFINITIONS)
// warnings
+CLANG_WARN_CONSTANT_CONVERSION = YES
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES
+CLANG_WARN_EMPTY_BODY = YES
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES
+CLANG_WARN_INT_CONVERSION = YES
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES
+GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES
GCC_TREAT_WARNINGS_AS_ERRORS = NO
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
@@ -60,15 +80,17 @@ GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES
GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
GCC_WARN_ABOUT_MISSING_NEWLINE = YES
-GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO
+GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO
+GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
GCC_WARN_MISSING_PARENTHESES = YES
GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO
+GCC_WARN_PEDANTIC = YES
GCC_WARN_SHADOW = YES
GCC_WARN_SIGN_COMPARE = YES
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES
@@ -79,4 +101,20 @@ GCC_WARN_UNUSED_LABEL = YES
GCC_WARN_UNUSED_PARAMETER = NO
GCC_WARN_UNUSED_VALUE = YES
GCC_WARN_UNUSED_VARIABLE = YES
-WARNING_CFLAGS = -Wall -Wextra -Wpointer-arith -Wformat=2 -Wfloat-equal -Wstrict-overflow=4 -Wbad-function-cast -Winline -Wconversion -Wstrict-aliasing -Wno-unused-parameter -Wno-arc-performSelector-leaks
+WARNING_CFLAGS = -Weverything -Wall -Wextra
+
+
+// static analyzer
+CLANG_ANALYZER_DEADCODE_DEADSTORES = YES
+CLANG_ANALYZER_DEADCODE_IDEMPOTENT_OPERATIONS = YES
+CLANG_ANALYZER_MALLOC = YES
+CLANG_ANALYZER_OBJC_SELF_INIT = YES
+CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
+CLANG_ANALYZER_SECURITY_INSECUREAPI_GETPW_GETS = YES
+CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP = YES
+CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
+CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
+CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN = YES
+CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK = YES
+CLANG_ANALYZER_SECURITY_KEYCHAIN_API = YES
+
View
7 ext/fsevent_watch/xcconfig/Debug.xcconfig
@@ -1,6 +1,10 @@
#include "Common.xcconfig"
+// code signing
+CODE_SIGN_IDENTITY =
+
+
// deployment
COPY_PHASE_STRIP = NO
STRIP_INSTALLED_PRODUCT = NO
@@ -9,10 +13,11 @@ STRIP_INSTALLED_PRODUCT = NO
// code generation
GCC_OPTIMIZATION_LEVEL = 0
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
+GCC_INLINES_ARE_PRIVATE_EXTERN = NO
// language
-OTHER_CFLAGS = $(COMMON_CFLAGS) -fcatch-undefined-behavior -ftrapv -fverbose-asm
+OTHER_CFLAGS = $(COMMON_CFLAGS)
// preprocessing
View
6 ext/fsevent_watch/xcconfig/Release.xcconfig
@@ -6,16 +6,18 @@ VALIDATE_PRODUCT = YES
// code signing
-CODE_SIGN_IDENTITY = 3rd Party Mac Developer Application: Travis Tilley
+CODE_SIGN_IDENTITY = Developer ID Application: Travis Tilley
// deployment
COPY_PHASE_STRIP = YES
STRIP_INSTALLED_PRODUCT = YES
+DEPLOYMENT_POSTPROCESSING = YES
// code generation
-GCC_OPTIMIZATION_LEVEL = 4
+GCC_INLINES_ARE_PRIVATE_EXTERN = YES
+GCC_OPTIMIZATION_LEVEL = 3
GCC_UNROLL_LOOPS = YES
View
2  ext/fsevent_watch/xcconfig/fsevent_watch.xcconfig
@@ -10,7 +10,7 @@ PRODUCT_NAME = $(TARGET_NAME)
// versioning
-CURRENT_PROJECT_VERSION = 0.1.1
+CURRENT_PROJECT_VERSION = 0.1.2
// preprocessing
View
12 ext/rakefile.rb
@@ -6,7 +6,7 @@
namespace :xcode do
$target = 'fsevent_watch'
$configuration = ENV['FWDEBUG'] ? 'Debug' : 'Release'
-
+
def xcb(action, extra='')
command = [
XCODEBUILD,
@@ -16,29 +16,29 @@ def xcb(action, extra='')
"-xcconfig", XCCONFIG,
extra
].join(' ')
-
+
Dir.chdir 'fsevent_watch' do
results = `#{command}`
STDERR.puts results
raise "xcodebuild failure" unless $?.success?
end
end
-
+
desc 'run xcodebuild clean'
task :clean do
xcb 'clean'
end
-
+
desc 'run xcodebuild build'
task :build => :clean do
xcb 'build'
end
-
+
desc 'run xcodebuild install'
task :install => :build do
xcb 'install', "DEPLOYMENT_LOCATION='YES'"
end
-
+
task :remove_turds do
rm_rf File.join('fsevent_watch', 'build')
end
View
8 ext/rb-fsevent.xcconfig
@@ -13,21 +13,15 @@ OBJROOT = $(SYMROOT)
// - architectures -
ARCHS = $(NATIVE_ARCH_ACTUAL)
-SDKROOT =
+SDKROOT =
// - build options -
GCC_VERSION = com.apple.compilers.llvm.clang.1_0
// etc
RUN_CLANG_STATIC_ANALYZER = YES
-DEAD_CODE_STRIPPING = YES
-PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES
-LD_NO_PIE = NO
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
LLVM_LTO = NO
-LLVM_LTO[arch=x86_64] = YES
GCC_C_LANGUAGE_STANDARD = gnu99
-GCC_ENABLE_OBJC_EXCEPTIONS = YES
-GCC_ENABLE_OBJC_GC = unsupported
GCC_ENABLE_EXCEPTIONS = YES
Please sign in to comment.
Something went wrong with that request. Please try again.