[platform] updates macOS filesystem watcher

- unneeded check dropped
- system requirements lifted
- i386 arch no longer supported
This commit is contained in:
Roman Shevchenko
2017-01-12 21:03:30 +01:00
parent 61788839cd
commit 62588db166
3 changed files with 6 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -160,12 +160,6 @@ static void ParseRoots() {
}
int main(const int argc, const char* argv[]) {
// Checking if necessary API is available (need MacOS X 10.5 or later).
if (FSEventStreamCreate == NULL) {
printf("GIVEUP\n");
return 1;
}
CFStringRef path = CFSTR("/");
CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&path, 1, NULL);
CFAbsoluteTime latency = 0.3; // Latency in seconds
@@ -180,13 +174,13 @@ int main(const int argc, const char* argv[]) {
);
if (stream == NULL) {
printf("GIVEUP\n");
return 2;
return 1;
}
pthread_t threadId;
if (pthread_create(&threadId, NULL, EventProcessingThread, stream) != 0) {
printf("GIVEUP\n");
return 3;
return 2;
}
while (TRUE) {
@@ -196,4 +190,4 @@ int main(const int argc, const char* argv[]) {
}
return 0;
}
}

View File

@@ -1,3 +1,3 @@
#!/bin/sh
# Clang can be downloaded from http://llvm.org/releases/download.html or found in XCode 4+
clang -arch i386 -arch x86_64 -mmacosx-version-min=10.5 -framework CoreServices -o fsnotifier fsnotifier.c
clang -arch x86_64 -mmacosx-version-min=10.8 -framework CoreServices -o fsnotifier fsnotifier.c