#include "../config.h"
#endif
-#if USE_HOTLOADING
+#ifdef USE_HOTLOADING
#include <sys/inotify.h>
#include <sys/ioctl.h>
#endif
resource::type_lookup_ptr resource::type_lookup_;
-#if USE_HOTLOADING
+#ifdef USE_HOTLOADING
static hash<int,std::string,hash_function> monitor_lookup_;
static int monitor_fd_ = inotify_init1(IN_NONBLOCK);
#endif
{
int num_resources = 0;
-#if USE_HOTLOADING
+#ifdef USE_HOTLOADING
log_info("hotloading?");
char bytes[BUF_SIZE];
int num_bytes;
resource::~resource()
{
-#if USE_HOTLOADING
+#ifdef USE_HOTLOADING
inotify_rm_watch(monitor_fd_, wd_);
#endif
}
rsrc->set_loader(path, (*jt).second);
resource_table_[path] = rsrc;
-#if USE_HOTLOADING
+#ifdef USE_HOTLOADING
int wd = inotify_add_watch(monitor_fd_,
path.c_str(), IN_MODIFY);
rsrc->set_watch_descriptor(wd);
typeinfo_ = resource->typeinfo_;
unloader_ = resource->unloader_;
-#if USE_HOTLOADING
+#ifdef USE_HOTLOADING
int wd = inotify_add_watch(monitor_fd_,
path_.c_str(), IN_MODIFY);
set_watch_descriptor(wd);