]> Dogcows Code - chaz/yoink/blobdiff - src/moof/resource.cc
moving some non-portable code to stlplus
[chaz/yoink] / src / moof / resource.cc
index ac200f7831e380866665bc490a48ed416340a7e7..5cd75360d85d5c8c5041d76da80987bc830cccf0 100644 (file)
@@ -23,7 +23,7 @@
 #include "../config.h"
 #endif
 
-#if USE_HOTLOADING
+#ifdef USE_HOTLOADING
 #include <sys/inotify.h>
 #include <sys/ioctl.h>
 #endif
@@ -45,7 +45,7 @@ static hash<std::string,resource_weakptr,hash_function> resource_table_;
 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
@@ -54,7 +54,7 @@ int resource::reload_as_needed()
 {
        int num_resources = 0;
 
-#if USE_HOTLOADING
+#ifdef USE_HOTLOADING
        log_info("hotloading?");
        char bytes[BUF_SIZE];
        int num_bytes;
@@ -99,7 +99,7 @@ int resource::reload_as_needed()
 
 resource::~resource()
 {
-#if USE_HOTLOADING
+#ifdef USE_HOTLOADING
        inotify_rm_watch(monitor_fd_, wd_);
 #endif
 }
@@ -128,7 +128,7 @@ resource_ptr resource::load(const std::string& path)
                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);
@@ -172,7 +172,7 @@ void resource::reload()
        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);
This page took 0.018161 seconds and 4 git commands to generate.