Commits

Ruslan Osmanov committed 7fbd310

Fix: build error due to return (void) from function returning int on Mac OS X

  • Participants
  • Parent commits 8c4c526

Comments (0)

Files changed (3)

     <email>osmanov@php.net</email>
     <active>yes</active>
   </lead>
-  <date>2013-04-17</date>
+  <date>2013-04-22</date>
   <!--{{{ Current version -->
   <version>
-    <release>0.2.4</release>
+    <release>0.2.5</release>
     <api>0.2.0</api>
   </version>
   <stability>
   </stability>
   <license uri="http://www.php.net/license">PHP</license>
   <notes><![CDATA[
-  Fix: build error in Mac OS X: inline php_ev_set_watcher_priority function had been exported as a library symbol
+  Fix: build error due to return (void) from function returning int on Mac OS X
   ]]></notes>
   <!--}}}-->
   <!--{{{ Contents -->
   </extsrcrelease>
   <!--{{{ changelog-->
   <changelog>
-    <!--{{{ Current version -->
+    <!--{{{ 0.2.5 -->
+    <version>
+      <release>0.2.5</release>
+      <api>0.2.0</api>
+    </version>
+    <stability>
+      <release>stable</release>
+      <api>stable</api>
+    </stability>
+    <license uri="http://www.php.net/license">PHP</license>
+    <notes><![CDATA[
+  Fix: build error due to return (void) from function returning int on Mac OS X
+  ]]></notes>
+    <!--}}}-->
+    <!--{{{ 0.2.4 -->
     <release>
       <version>
         <release>0.2.4</release>
 extern zend_module_entry ev_module_entry;
 #define phpext_ev_ptr &ev_module_entry
 
-#define PHP_EV_VERSION "0.2.4"
+#define PHP_EV_VERSION "0.2.5"
 
 #endif /* PHP_EV_H */
 
 #define PHP_EV_WATCHER_FACTORY_NS(type, zloop)                                             \
     php_ev_ ## type ## _object_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, zloop, FALSE, FALSE)
 
-#define php_ev_set_watcher_priority(watcher, priority) \
-    do {                                               \
-        PHP_EV_CHECK_PENDING_WATCHER(watcher);         \
-        ev_set_priority(watcher, priority);            \
-    } while (0);                                       \
+#define php_ev_set_watcher_priority(watcher, priority)   \
+    do {                                                 \
+        if (ev_is_pending(watcher)) {                    \
+            php_error_docref(NULL TSRMLS_CC, E_WARNING,  \
+                    "Failed modifying pending watcher"); \
+            break;                                       \
+        }                                                \
+        ev_set_priority(watcher, priority);              \
+    } while (0);
 
 void php_ev_watcher_callback(EV_P_ ev_watcher *watcher, int revents);
 void php_ev_set_watcher(ev_watcher *w, size_t size, zval *self, php_ev_loop *loop,