-#ifndef NETWORK_COMMON_H
-#define NETWORK_COMMON_H
-
-#include "vg/vg_stdint.h"
+#pragma once
#include "vg/vg_platform.h"
+#include "vg/vg_string.h"
#define NETWORK_USERNAME_MAX 32
#define NETWORK_MAX_PLAYERS 20
static u32 network_pair_index( u32 _a, u32 _b ){
const u32 N = NETWORK_MAX_PLAYERS;
- assert( (_a != _b) && (_a<N) && (_b<N) );
+
+ if( !((_a != _b) && (_a<N) && (_b<N) ) )
+ {
+ vg_fatal_error( "Programming error\n" );
+ }
u32 a = VG_MIN( _a, _b ),
b = VG_MAX( _a, _b );
return ((N-a)*((N-a)-1))/2 - b + a;
}
-
-#endif /* NETWORK_COMMON_H */