darwin: fix 10.6 build error in fsevents.c
Work around an 'initializer element is not constant' build error in src/unix/fsevents.c by turning the const int flags into #defines. Only an issue on OS X 10.6 due to the old compiler it uses. Fixes #908.
This commit is contained in:
parent
d48168afd0
commit
82f2472b9f
@ -48,6 +48,27 @@ void uv__fsevents_loop_delete(uv_loop_t* loop) {
|
|||||||
#include <CoreFoundation/CFRunLoop.h>
|
#include <CoreFoundation/CFRunLoop.h>
|
||||||
#include <CoreServices/CoreServices.h>
|
#include <CoreServices/CoreServices.h>
|
||||||
|
|
||||||
|
/* These are macros to avoid "initializer element is not constant" errors
|
||||||
|
* with old versions of gcc.
|
||||||
|
*/
|
||||||
|
#define kFSEventsModified (kFSEventStreamEventFlagItemFinderInfoMod | \
|
||||||
|
kFSEventStreamEventFlagItemModified | \
|
||||||
|
kFSEventStreamEventFlagItemInodeMetaMod | \
|
||||||
|
kFSEventStreamEventFlagItemChangeOwner | \
|
||||||
|
kFSEventStreamEventFlagItemXattrMod)
|
||||||
|
|
||||||
|
#define kFSEventsRenamed (kFSEventStreamEventFlagItemCreated | \
|
||||||
|
kFSEventStreamEventFlagItemRemoved | \
|
||||||
|
kFSEventStreamEventFlagItemRenamed)
|
||||||
|
|
||||||
|
#define kFSEventsSystem (kFSEventStreamEventFlagUserDropped | \
|
||||||
|
kFSEventStreamEventFlagKernelDropped | \
|
||||||
|
kFSEventStreamEventFlagEventIdsWrapped | \
|
||||||
|
kFSEventStreamEventFlagHistoryDone | \
|
||||||
|
kFSEventStreamEventFlagMount | \
|
||||||
|
kFSEventStreamEventFlagUnmount | \
|
||||||
|
kFSEventStreamEventFlagRootChanged)
|
||||||
|
|
||||||
typedef struct uv__fsevents_event_s uv__fsevents_event_t;
|
typedef struct uv__fsevents_event_s uv__fsevents_event_t;
|
||||||
typedef struct uv__cf_loop_signal_s uv__cf_loop_signal_t;
|
typedef struct uv__cf_loop_signal_s uv__cf_loop_signal_t;
|
||||||
typedef struct uv__cf_loop_state_s uv__cf_loop_state_t;
|
typedef struct uv__cf_loop_state_s uv__cf_loop_state_t;
|
||||||
@ -74,22 +95,6 @@ struct uv__fsevents_event_s {
|
|||||||
char path[1];
|
char path[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int kFSEventsModified = kFSEventStreamEventFlagItemFinderInfoMod |
|
|
||||||
kFSEventStreamEventFlagItemModified |
|
|
||||||
kFSEventStreamEventFlagItemInodeMetaMod |
|
|
||||||
kFSEventStreamEventFlagItemChangeOwner |
|
|
||||||
kFSEventStreamEventFlagItemXattrMod;
|
|
||||||
static const int kFSEventsRenamed = kFSEventStreamEventFlagItemCreated |
|
|
||||||
kFSEventStreamEventFlagItemRemoved |
|
|
||||||
kFSEventStreamEventFlagItemRenamed;
|
|
||||||
static const int kFSEventsSystem = kFSEventStreamEventFlagUserDropped |
|
|
||||||
kFSEventStreamEventFlagKernelDropped |
|
|
||||||
kFSEventStreamEventFlagEventIdsWrapped |
|
|
||||||
kFSEventStreamEventFlagHistoryDone |
|
|
||||||
kFSEventStreamEventFlagMount |
|
|
||||||
kFSEventStreamEventFlagUnmount |
|
|
||||||
kFSEventStreamEventFlagRootChanged;
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
static void uv__cf_loop_cb(void* arg);
|
static void uv__cf_loop_cb(void* arg);
|
||||||
static void* uv__cf_loop_runner(void* arg);
|
static void* uv__cf_loop_runner(void* arg);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user