FS-10167: Some fixes to get the windows release build working, and fixed a mistake with asserting on executed statements which would get compiled out for release builds

This commit is contained in:
Shane Bryldt 2017-04-21 16:27:39 -06:00
parent a8a935d64f
commit 6515bc729c
12 changed files with 27 additions and 24 deletions

View File

@ -114,7 +114,7 @@ KS_DECLARE(ks_status_t) blade_connection_create(blade_connection_t **bcP, blade_
ks_q_create(&bc->sending, pool, 0);
ks_assert(bc->sending);
ks_assert(ks_pool_set_cleanup(pool, bc, NULL, blade_connection_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bc, NULL, blade_connection_cleanup);
ks_log(KS_LOG_DEBUG, "Created\n");

View File

@ -75,7 +75,7 @@ KS_DECLARE(ks_status_t) blade_identity_create(blade_identity_t **biP, ks_pool_t
bi = ks_pool_alloc(pool, sizeof(blade_identity_t));
bi->pool = pool;
ks_assert(ks_pool_set_cleanup(pool, bi, NULL, blade_identity_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bi, NULL, blade_identity_cleanup);
*biP = bi;

View File

@ -84,7 +84,7 @@ KS_DECLARE(ks_status_t) blade_method_create(blade_method_t **bmP, blade_space_t
bm->name = ks_pstrdup(pool, name);
bm->callback = callback;
ks_assert(ks_pool_set_cleanup(pool, bm, NULL, blade_method_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bm, NULL, blade_method_cleanup);
*bmP = bm;

View File

@ -44,9 +44,9 @@ struct blade_module_s {
static void blade_module_cleanup(ks_pool_t *pool, void *ptr, void *arg, ks_pool_cleanup_action_t action, ks_pool_cleanup_type_t type)
{
blade_module_t *bm = (blade_module_t *)ptr;
//blade_module_t *bm = (blade_module_t *)ptr;
ks_assert(bm);
//ks_assert(bm);
switch (action) {
case KS_MPCL_ANNOUNCE:
@ -78,7 +78,7 @@ KS_DECLARE(ks_status_t) blade_module_create(blade_module_t **bmP, blade_handle_t
bm->module_data = module_data;
bm->module_callbacks = module_callbacks;
ks_assert(ks_pool_set_cleanup(pool, bm, NULL, blade_module_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bm, NULL, blade_module_cleanup);
ks_log(KS_LOG_DEBUG, "Created\n");

View File

@ -125,9 +125,9 @@ static blade_transport_callbacks_t g_transport_wss_callbacks =
static void blade_module_wss_cleanup(ks_pool_t *pool, void *ptr, void *arg, ks_pool_cleanup_action_t action, ks_pool_cleanup_type_t type)
{
blade_module_wss_t *bm_wss = (blade_module_wss_t *)ptr;
//blade_module_wss_t *bm_wss = (blade_module_wss_t *)ptr;
ks_assert(bm_wss);
//ks_assert(bm_wss);
switch (action) {
case KS_MPCL_ANNOUNCE:
@ -158,7 +158,7 @@ KS_DECLARE(ks_status_t) blade_module_wss_create(blade_module_t **bmP, blade_hand
bm_wss->module_callbacks = &g_module_wss_callbacks;
bm_wss->transport_callbacks = &g_transport_wss_callbacks;
ks_assert(ks_pool_set_cleanup(pool, bm_wss, NULL, blade_module_wss_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bm_wss, NULL, blade_module_wss_cleanup);
ks_log(KS_LOG_DEBUG, "Created\n");
@ -499,7 +499,7 @@ ks_status_t blade_transport_wss_create(blade_transport_wss_t **bt_wssP, ks_pool_
bt_wss->sock = sock;
if (session_id) bt_wss->session_id = ks_pstrdup(pool, session_id);
ks_assert(ks_pool_set_cleanup(pool, bt_wss, NULL, blade_transport_wss_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bt_wss, NULL, blade_transport_wss_cleanup);
ks_log(KS_LOG_DEBUG, "Created\n");

View File

@ -74,7 +74,7 @@ KS_DECLARE(ks_status_t) blade_request_create(blade_request_t **breqP,
breq->message_id = cJSON_GetObjectCstr(breq->message, "id");
breq->callback = callback;
ks_assert(ks_pool_set_cleanup(pool, breq, NULL, blade_request_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, breq, NULL, blade_request_cleanup);
*breqP = breq;
@ -137,7 +137,7 @@ KS_DECLARE(ks_status_t) blade_response_create(blade_response_t **bresP,
bres->request = breq;
bres->message = cJSON_Duplicate(json, 1);
ks_assert(ks_pool_set_cleanup(pool, bres, NULL, blade_response_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bres, NULL, blade_response_cleanup);
*bresP = bres;
@ -196,7 +196,7 @@ KS_DECLARE(ks_status_t) blade_event_create(blade_event_t **bevP,
bev->session_id = ks_pstrdup(pool, session_id);
bev->message = cJSON_Duplicate(json, 1);
ks_assert(ks_pool_set_cleanup(pool, bev, NULL, blade_event_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bev, NULL, blade_event_cleanup);
*bevP = bev;

View File

@ -136,7 +136,7 @@ KS_DECLARE(ks_status_t) blade_session_create(blade_session_t **bsP, blade_handle
ks_rwl_create(&bs->properties_lock, pool);
ks_assert(bs->properties_lock);
ks_assert(ks_pool_set_cleanup(pool, bs, NULL, blade_session_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bs, NULL, blade_session_cleanup);
ks_log(KS_LOG_DEBUG, "Created\n");

View File

@ -80,7 +80,7 @@ KS_DECLARE(ks_status_t) blade_space_create(blade_space_t **bsP, blade_handle_t *
ks_hash_create(&bs->methods, KS_HASH_MODE_CASE_INSENSITIVE, KS_HASH_FLAG_RWLOCK | KS_HASH_FLAG_DUP_CHECK | KS_HASH_FLAG_FREE_VALUE, bs->pool);
ks_assert(bs);
ks_assert(ks_pool_set_cleanup(pool, bs, NULL, blade_space_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bs, NULL, blade_space_cleanup);
*bsP = bs;

View File

@ -74,9 +74,9 @@ struct blade_handle_transport_registration_s {
static void blade_handle_transport_registration_cleanup(ks_pool_t *pool, void *ptr, void *arg, ks_pool_cleanup_action_t action, ks_pool_cleanup_type_t type)
{
blade_handle_transport_registration_t *bhtr = (blade_handle_transport_registration_t *)ptr;
//blade_handle_transport_registration_t *bhtr = (blade_handle_transport_registration_t *)ptr;
ks_assert(bhtr);
//ks_assert(bhtr);
switch (action) {
case KS_MPCL_ANNOUNCE:
@ -105,7 +105,7 @@ KS_DECLARE(ks_status_t) blade_handle_transport_registration_create(blade_handle_
bhtr->module = module;
bhtr->callbacks = callbacks;
ks_assert(ks_pool_set_cleanup(pool, bhtr, NULL, blade_handle_transport_registration_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bhtr, NULL, blade_handle_transport_registration_cleanup);
*bhtrP = bhtr;
@ -159,7 +159,7 @@ ks_status_t blade_handle_session_state_callback_registration_create(blade_handle
bhsscr->data = data;
bhsscr->callback = callback;
ks_assert(ks_pool_set_cleanup(pool, bhsscr, NULL, blade_handle_session_state_callback_registration_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bhsscr, NULL, blade_handle_session_state_callback_registration_cleanup);
*bhsscrP = bhsscr;
@ -236,7 +236,7 @@ KS_DECLARE(ks_status_t) blade_handle_create(blade_handle_t **bhP)
ks_hash_create(&bh->requests, KS_HASH_MODE_CASE_INSENSITIVE, KS_HASH_FLAG_RWLOCK | KS_HASH_FLAG_DUP_CHECK, bh->pool);
ks_assert(bh->requests);
ks_assert(ks_pool_set_cleanup(pool, bh, NULL, blade_handle_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bh, NULL, blade_handle_cleanup);
*bhP = bh;

View File

@ -215,8 +215,9 @@ ks_status_t blade_module_chat_create(blade_module_t **bmP, blade_handle_t *bh)
ks_assert(bm_chat->participants);
blade_module_create(&bm_chat->module, bh, pool, bm_chat, &g_module_chat_callbacks);
ks_assert(bm_chat->module);
ks_assert(ks_pool_set_cleanup(pool, bm_chat, NULL, blade_module_chat_cleanup) == KS_STATUS_SUCCESS);
ks_pool_set_cleanup(pool, bm_chat, NULL, blade_module_chat_cleanup);
ks_log(KS_LOG_DEBUG, "Created\n");

View File

@ -80,8 +80,9 @@ KS_DECLARE(ks_status_t) ks_init(void)
#ifdef __WINDOWS__
WSADATA wsaData;
WORD wVersionRequested = MAKEWORD(2, 2);
ks_assert(!WSAStartup(wVersionRequested, &wsaData));
if (WSAStartup(wVersionRequested, &wsaData)) {
abort();
}
#endif
return KS_STATUS_SUCCESS;

View File

@ -39,6 +39,7 @@
<ProjectGuid>{A185B162-6CB6-4502-B03F-B56F7699A8D9}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>libsodium</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -93,7 +94,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>