Kaynağa Gözat

fix build under Windows/MSVC

ambrop7 13 yıl önce
ebeveyn
işleme
b7c2bab1e0
2 değiştirilmiş dosya ile 6 ekleme ve 6 silme
  1. 2 2
      system/BReactor_badvpn.c
  2. 4 4
      system/BReactor_badvpn.h

+ 2 - 2
system/BReactor_badvpn.c

@@ -562,7 +562,7 @@ void BFileDescriptor_Init (BFileDescriptor *bs, int fd, BFileDescriptor_handler
 
 void BSmallTimer_Init (BSmallTimer *bt, BSmallTimer_handler handler)
 {
-    bt->handler.small = handler;
+    bt->handler.smalll = handler;
     bt->state = TIMER_STATE_INACTIVE;
     bt->is_small = 1;
 }
@@ -789,7 +789,7 @@ int BReactor_Exec (BReactor *bsys)
             // call handler
             BLog(BLOG_DEBUG, "Dispatching timer");
             if (timer->is_small) {
-                timer->handler.small(timer);
+                timer->handler.smalll(timer);
             } else {
                 BTimer *btimer = UPPER_OBJECT(timer, BTimer, base);
                 timer->handler.heavy(btimer->user);

+ 4 - 4
system/BReactor_badvpn.h

@@ -73,6 +73,9 @@ typedef struct BSmallTimer_t *BReactor_timerstree_link;
 #include "BReactor_badvpn_timerstree.h"
 #include <structure/CAvl_decl.h>
 
+#define BTIMER_SET_ABSOLUTE 1
+#define BTIMER_SET_RELATIVE 2
+
 /**
  * Handler function invoked when the timer expires.
  * The timer was in running state.
@@ -101,7 +104,7 @@ typedef void (*BTimer_handler) (void *user);
  */
 typedef struct BSmallTimer_t {
     union {
-        BSmallTimer_handler small;
+        BSmallTimer_handler smalll; // MSVC doesn't like "small"
         BTimer_handler heavy;
     } handler;
     union {
@@ -169,9 +172,6 @@ struct BFileDescriptor_t;
 #define BREACTOR_WRITE (1 << 1)
 #define BREACTOR_ERROR (1 << 2)
 
-#define BTIMER_SET_ABSOLUTE 1
-#define BTIMER_SET_RELATIVE 2
-
 /**
  * Handler function invoked by the reactor when one or more events are detected.
  * The events argument will contain a subset of the monitored events (BREACTOR_READ, BREACTOR_WRITE),