Skip to content

Commit

Permalink
Remove usages of C++11 initializer lists so that fswatch builds with …
Browse files Browse the repository at this point in the history
…older compilers.
  • Loading branch information
emcrisostomo committed Jun 24, 2014
1 parent 10e0ea8 commit 57e6fdf
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 25 deletions.
10 changes: 9 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
ChangeLog
*********

2014-06-24 Enrico M. Crisostomo <[email protected]>

* ChangeLog: Update.
* configure.ac:
- Bump v. 1.3.6.
* fsevent_monitor.cpp: Remove usages of C++11 initializer lists so that
fswatch builds with older compilers.

2014-06-13 Enrico M. Crisostomo <[email protected]>

release: stable micro release 1.3.6:
release: stable micro release 1.3.7:

* ChangeLog: Update.
* Makefile.am:
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
NEWS
****

New in 1.3.7:

* Remove usages of C++11 initializer lists so that fswatch builds with older
compiler.

New in 1.3.6:

* fswatch-run scripts are provided for ZSH and Bash.
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# Process this file with autoconf to produce a configure script.
#
AC_PREREQ([2.69])
AC_INIT([fswatch], [1.3.6], [[email protected]], [], [https://github.com/alandipert/fswatch])
AC_INIT([fswatch], [1.3.7], [[email protected]], [], [https://github.com/alandipert/fswatch])
AC_COPYRIGHT([2014 (C) Enrico M. Crisostomo])
AC_REVISION([$Revision: 1.3.6-1 $])
AC_REVISION([$Revision: 1.3.7-1 $])
AC_CONFIG_SRCDIR([fswatch.cpp])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([config.h])
Expand Down
51 changes: 29 additions & 22 deletions fsevent_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,35 @@ typedef struct FSEventFlagType
event_flag type;
} FSEventFlagType;

static const vector<FSEventFlagType> event_flag_type = {
{ kFSEventStreamEventFlagNone, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagMustScanSubDirs, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagUserDropped, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagKernelDropped, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagEventIdsWrapped, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagHistoryDone, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagRootChanged, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagMount, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagUnmount, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagItemCreated, event_flag::Created},
{ kFSEventStreamEventFlagItemRemoved, event_flag::Removed},
{ kFSEventStreamEventFlagItemInodeMetaMod, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagItemRenamed, event_flag::Renamed},
{ kFSEventStreamEventFlagItemModified, event_flag::Updated},
{ kFSEventStreamEventFlagItemFinderInfoMod, event_flag::PlatformSpecific},
{ kFSEventStreamEventFlagItemChangeOwner, event_flag::OwnerModified},
{ kFSEventStreamEventFlagItemXattrMod, event_flag::AttributeModified},
{ kFSEventStreamEventFlagItemIsFile, event_flag::IsFile},
{ kFSEventStreamEventFlagItemIsDir, event_flag::IsDir},
{ kFSEventStreamEventFlagItemIsSymlink, event_flag::IsSymLink}
};
static vector<FSEventFlagType> create_flag_type_vector();
static const vector<FSEventFlagType> event_flag_type = create_flag_type_vector();

vector<FSEventFlagType> create_flag_type_vector()
{
vector<FSEventFlagType> flags;
flags.push_back({ kFSEventStreamEventFlagNone, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagMustScanSubDirs, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagUserDropped, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagKernelDropped, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagEventIdsWrapped, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagHistoryDone, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagRootChanged, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagMount, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagUnmount, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagItemCreated, event_flag::Created});
flags.push_back({ kFSEventStreamEventFlagItemRemoved, event_flag::Removed});
flags.push_back({ kFSEventStreamEventFlagItemInodeMetaMod, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagItemRenamed, event_flag::Renamed});
flags.push_back({ kFSEventStreamEventFlagItemModified, event_flag::Updated});
flags.push_back({ kFSEventStreamEventFlagItemFinderInfoMod, event_flag::PlatformSpecific});
flags.push_back({ kFSEventStreamEventFlagItemChangeOwner, event_flag::OwnerModified});
flags.push_back({ kFSEventStreamEventFlagItemXattrMod, event_flag::AttributeModified});
flags.push_back({ kFSEventStreamEventFlagItemIsFile, event_flag::IsFile});
flags.push_back({ kFSEventStreamEventFlagItemIsDir, event_flag::IsDir});
flags.push_back({ kFSEventStreamEventFlagItemIsSymlink, event_flag::IsSymLink});

return flags;
}

fsevent_monitor::fsevent_monitor(vector<string> paths_to_monitor,
EVENT_CALLBACK callback) :
Expand Down

0 comments on commit 57e6fdf

Please sign in to comment.