Skip to content

Commit

Permalink
may fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Mar 28, 2024
1 parent 14853ae commit 7e47ea3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ jobs:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
- os: windows-latest
c_compiler: gcc
cpp_compiler: g++
- os: windows-latest
c_compiler: clang
cpp_compiler: clang++
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions tunnels/adapters/tcp_listener/tcp_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ tunnel_t *newTcpListener(node_instance_context_t *instance_info)

dynamic_value_t dy_mb = parseDynamicStrValueFromJsonObject(settings, "multiport-backend", 2, "iptables", "socket");
if (dy_mb.status == 2)
multiport_backend == multiport_backend_iptables;
multiport_backend = multiport_backend_iptables;
if (dy_mb.status == 3)
multiport_backend == multiport_backend_sockets;
multiport_backend = multiport_backend_sockets;
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions tunnels/client/reverse/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ typedef struct reverse_client_con_state_s

typedef struct reverse_client_state_s
{
_Atomic unsigned int reverse_cons;
_Atomic unsigned int unused_cons;
_Atomic unsigned int round_index;
atomic_uint reverse_cons;
atomic_uint unused_cons;
atomic_uint round_index;

size_t chain_index_pi;
size_t connection_per_thread;
Expand Down
4 changes: 2 additions & 2 deletions tunnels/server/reverse/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ typedef struct thread_box_s

typedef struct reverse_server_state_s
{
_Atomic size_t u_available;
_Atomic size_t d_available;
atomic_size_t u_available;
atomic_size_t d_available;

size_t chain_index_u;
size_t chain_index_d;
Expand Down
26 changes: 13 additions & 13 deletions ww/basic_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,42 @@ typedef uint64_t hash_t;

typedef struct ud_s
{
_Atomic uint64_t u;
_Atomic uint64_t d;
atomic_ullong u;
atomic_ullong d;
} ud_t;

typedef union
{
ud_t max;
_Atomic uint64_t max_total;
atomic_ullong max_total;
} traffic_limit_t;

typedef struct user_limit_s
{
traffic_limit_t traffic;
ud_t bandwidth;
_Atomic uint64_t ip;
_Atomic uint64_t devices;
_Atomic uint64_t cons_in;
_Atomic uint64_t cons_out;
atomic_ullong ip;
atomic_ullong devices;
atomic_ullong cons_in;
atomic_ullong cons_out;
} user_limit_t;

typedef struct user_time_info_s
{
datetime_t create_date;
datetime_t first_usage_date;
datetime_t expire_date;
_Atomic bool since_first_use;
atomic_bool since_first_use;
} user_time_info_t;

typedef struct user_stat_s
{
ud_t speed;
ud_t traffic;
_Atomic uint64_t ips;
_Atomic uint64_t devices;
_Atomic uint64_t cons_in;
_Atomic uint64_t cons_out;
atomic_ullong ips;
atomic_ullong devices;
atomic_ullong cons_in;
atomic_ullong cons_out;

} user_stat_t;

Expand All @@ -61,7 +61,7 @@ typedef struct user_s
int gid; // group id
hash_t hash_uid;

_Atomic bool enable;
atomic_bool enable;
user_limit_t limit;
user_time_info_t timeinfo;
user_stat_t stats;
Expand Down
2 changes: 1 addition & 1 deletion ww/buffer_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typedef struct buffer_pool_s
shift_buffer_t **available;
size_t len;
#ifdef DEBUG
_Atomic size_t in_use;
atomic_size_t in_use;
#endif
} buffer_pool_t;

Expand Down

0 comments on commit 7e47ea3

Please sign in to comment.