bordercode compiles now clean on win32 and fbsd
authorHannes Gredler <hannes@gredler.at>
Thu, 12 Jun 2008 07:16:59 +0000 (09:16 +0200)
committerHannes Gredler <hannes@gredler.at>
Thu, 12 Jun 2008 07:16:59 +0000 (09:16 +0200)
src/tc_set.c

index 50bafae..7a2c287 100644 (file)
@@ -724,7 +724,6 @@ olsr_print_tc_table(void)
 #endif
 }
 
-#ifdef CODE_IS_FIXED_ON_FBSD
 /*
  * calculate the border IPs of a tc edge set according to the border flags
  *
@@ -750,23 +749,12 @@ olsr_calculate_tc_border(olsr_u8_t lower_border,
 
     lower_border--;
     for (i = 0; i < lower_border / 8; i++) {
-#ifdef WIN32
                lower_border_ip->v6.s6_addr[olsr_cnf->ipsize - i - 1] = 0;
-#else
-               lower_border_ip->v6.in6_u.u6_addr8[olsr_cnf->ipsize - i - 1] = 0;
-#endif
     }
-#ifdef WIN32
     lower_border_ip->v6.s6_addr[olsr_cnf->ipsize - lower_border / 8 -
                                       1] &= (0xff << (lower_border & 7));
     lower_border_ip->v6.s6_addr[olsr_cnf->ipsize - lower_border / 8 -
                                       1] |= (1 << (lower_border & 7));
-#else
-    lower_border_ip->v6.in6_u.u6_addr8[olsr_cnf->ipsize - lower_border / 8 -
-                                      1] &= (0xff << (lower_border & 7));
-    lower_border_ip->v6.in6_u.u6_addr8[olsr_cnf->ipsize - lower_border / 8 -
-                                      1] |= (1 << (lower_border & 7));
-#endif
   }
 
   if (upper_border == 0xff) {
@@ -777,27 +765,15 @@ olsr_calculate_tc_border(olsr_u8_t lower_border,
     upper_border--;
 
     for (i = 0; i < upper_border / 8; i++) {
-#ifdef WIN32
                upper_border_ip->v6.s6_addr[olsr_cnf->ipsize - i - 1] = 0;
-#else
-               upper_border_ip->v6.in6_u.u6_addr8[olsr_cnf->ipsize - i - 1] = 0;
-#endif
     }
-#ifdef WIN32
     upper_border_ip->v6.s6_addr[olsr_cnf->ipsize - upper_border / 8 -
                                       1] &= (0xff << (upper_border & 7));
     upper_border_ip->v6.s6_addr[olsr_cnf->ipsize - upper_border / 8 -
                                       1] |= (1 << (upper_border & 7));
-#else
-    upper_border_ip->v6.in6_u.u6_addr8[olsr_cnf->ipsize - upper_border / 8 -
-                                      1] &= (0xff << (upper_border & 7));
-    upper_border_ip->v6.in6_u.u6_addr8[olsr_cnf->ipsize - upper_border / 8 -
-                                      1] |= (1 << (upper_border & 7));
-#endif
   }
   return 1;
 }
-#endif
 
 /*
  * Process an incoming TC or TC_LQ message.
@@ -938,15 +914,12 @@ olsr_input_tc(union olsr_message *msg,
       changes_topology = OLSR_TRUE;
     }
 
-#ifdef CODE_IS_FIXED_ON_FBSD
     if (!borderSet) {
       borderSet = 1;
       memcpy(&lower_border_ip, &upper_border_ip, sizeof(lower_border_ip));
     }
-#endif
   }
 
-#ifdef CODE_IS_FIXED_ON_FBSD
   /*
    * Calculate real border IPs.
    */
@@ -954,7 +927,6 @@ olsr_input_tc(union olsr_message *msg,
     borderSet = olsr_calculate_tc_border(lower_border, &lower_border_ip,
                                         upper_border, &upper_border_ip);
   }
-#endif
 
   /*
    * Set or change the expiration timer accordingly.