mirror of
https://github.com/bol-van/zapret2.git
synced 2026-03-13 22:03:09 +00:00
nfqws2: compile mask_from_bitcount only for windows
This commit is contained in:
@@ -666,6 +666,15 @@ bool parse_int16(const char *p, int16_t *v)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
time_t boottime(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
return clock_gettime(CLOCK_BOOT_OR_UPTIME, &ts) ? 0 : ts.tv_sec;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
uint32_t mask_from_bitcount(uint32_t zct)
|
||||
{
|
||||
return zct < 32 ? ~((1u << zct) - 1) : 0;
|
||||
@@ -691,9 +700,4 @@ const struct in6_addr *mask_from_bitcount6(uint32_t zct)
|
||||
{
|
||||
return ip6_mask + zct;
|
||||
}
|
||||
|
||||
time_t boottime(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
return clock_gettime(CLOCK_BOOT_OR_UPTIME, &ts) ? 0 : ts.tv_sec;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -109,10 +109,6 @@ bool set_env_exedir(const char *argv0);
|
||||
|
||||
bool parse_int16(const char *p, int16_t *v);
|
||||
|
||||
uint32_t mask_from_bitcount(uint32_t zct);
|
||||
void mask_from_bitcount6_prepare(void);
|
||||
const struct in6_addr *mask_from_bitcount6(uint32_t zct);
|
||||
|
||||
#ifdef CLOCK_BOOTTIME
|
||||
#define CLOCK_BOOT_OR_UPTIME CLOCK_BOOTTIME
|
||||
#elif defined(CLOCK_UPTIME)
|
||||
@@ -122,3 +118,9 @@ const struct in6_addr *mask_from_bitcount6(uint32_t zct);
|
||||
#endif
|
||||
|
||||
time_t boottime(void);
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
uint32_t mask_from_bitcount(uint32_t zct);
|
||||
void mask_from_bitcount6_prepare(void);
|
||||
const struct in6_addr *mask_from_bitcount6(uint32_t zct);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user