]> Dogcows Code - chaz/yoink/blobdiff - src/moof/resource.cc
initial runloop implementation
[chaz/yoink] / src / moof / resource.cc
index 35cd663ded7decff86f96321916b8ab5cef71f5b..95b4c698501a05686a02d1789a3f428298939cb1 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <queue>
 
 
 #include <queue>
 
-#ifdef USE_HOTLOADING
+#if ENABLE_HOTLOADING
 #include <sys/inotify.h>
 #include <sys/ioctl.h>
 #endif
 #include <sys/inotify.h>
 #include <sys/ioctl.h>
 #endif
@@ -112,7 +112,7 @@ static struct rsrc_list
 #endif
 } rsrc_list;
 
 #endif
 } rsrc_list;
 
-#ifdef USE_HOTLOADING
+#if ENABLE_HOTLOADING
 static struct watch_list
 {
        // this table associates a watch descriptor with a loaded resource
 static struct watch_list
 {
        // this table associates a watch descriptor with a loaded resource
@@ -179,7 +179,7 @@ resource_ptr resource::load_with_path(const std::string& path,
                rsrc_list.table[path] = rsrc;
                rsrc->path_ = path;
                rsrc->type_ = ext;
                rsrc_list.table[path] = rsrc;
                rsrc->path_ = path;
                rsrc->type_ = ext;
-#ifdef USE_HOTLOADING
+#if ENABLE_HOTLOADING
                rsrc->wd_ = watch_list.add(rsrc);
 #endif
                return rsrc;
                rsrc->wd_ = watch_list.add(rsrc);
 #endif
                return rsrc;
@@ -197,7 +197,7 @@ int resource::reload_as_needed()
 {
        int count = 0;
 
 {
        int count = 0;
 
-#ifdef USE_HOTLOADING
+#if ENABLE_HOTLOADING
        char bytes[BUF_SIZE];
        int num_bytes;
        // an inotify file descriptor lets your read inotify_event structures
        char bytes[BUF_SIZE];
        int num_bytes;
        // an inotify file descriptor lets your read inotify_event structures
@@ -255,7 +255,7 @@ void resource::reload()
 resource::~resource()
 {
        rsrc_list.table.erase(path_);
 resource::~resource()
 {
        rsrc_list.table.erase(path_);
-#ifdef USE_HOTLOADING
+#if ENABLE_HOTLOADING
        watch_list.remove(wd_);
 #endif
 }
        watch_list.remove(wd_);
 #endif
 }
This page took 0.018136 seconds and 4 git commands to generate.