Skip to content

Commit

Permalink
Suppress warnings on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
norihiro committed Jan 5, 2024
1 parent a283014 commit 48b6b34
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ if(OS_WINDOWS)
# Enable Multicore Builds and disable FH4 (to not depend on VCRUNTIME140_1.DLL when building with VS2019)
if (MSVC)
add_definitions(/MP /d2FH4-)
add_definitions("-D_CRT_SECURE_NO_WARNINGS") # for strncpy
add_definitions("-D_USE_MATH_DEFINES") # for M_PI
endif()

Expand Down
24 changes: 12 additions & 12 deletions src/obs-vnc-source-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static void vncsrc_update(void *data, obs_data_t *settings)
src->need_reconnect = true;
}

UPDATE_NOTIFY(src, int, host_port, need_reconnect, obs_data_get_int(settings, "host_port"));
UPDATE_NOTIFY(src, int, host_port, need_reconnect, (int)obs_data_get_int(settings, "host_port"));

const char *plain_passwd = obs_data_get_string(settings, "plain_passwd");
if (plain_passwd && (!src->config.plain_passwd || strcmp(plain_passwd, src->config.plain_passwd))) {
Expand All @@ -92,18 +92,18 @@ static void vncsrc_update(void *data, obs_data_t *settings)
}
#endif // LIBVNCSERVER_HAVE_SASL

UPDATE_NOTIFY(src, int, bpp, need_reconnect, obs_data_get_int(settings, "bpp"));
UPDATE_NOTIFY(src, int, encodings, encoding_updated, obs_data_get_int(settings, "encodings"));
UPDATE_NOTIFY(src, int, compress, encoding_updated, obs_data_get_int(settings, "compress"));
UPDATE_NOTIFY(src, int, bpp, need_reconnect, (int)obs_data_get_int(settings, "bpp"));
UPDATE_NOTIFY(src, int, encodings, encoding_updated, (int)obs_data_get_int(settings, "encodings"));
UPDATE_NOTIFY(src, int, compress, encoding_updated, (int)obs_data_get_int(settings, "compress"));
UPDATE_NOTIFY(src, bool, jpeg, encoding_updated, obs_data_get_bool(settings, "jpeg"));
UPDATE_NOTIFY(src, int, quality, encoding_updated, obs_data_get_int(settings, "quality"));
UPDATE_NOTIFY(src, int, qosdscp, dscp_updated, obs_data_get_int(settings, "qosdscp"));
src->config.connect_opt = obs_data_get_int(settings, "connect_opt");

UPDATE_NOTIFY(src, int, skip_update_l, skip_updated, obs_data_get_int(settings, "skip_update_l"));
UPDATE_NOTIFY(src, int, skip_update_r, skip_updated, obs_data_get_int(settings, "skip_update_r"));
UPDATE_NOTIFY(src, int, skip_update_t, skip_updated, obs_data_get_int(settings, "skip_update_t"));
UPDATE_NOTIFY(src, int, skip_update_b, skip_updated, obs_data_get_int(settings, "skip_update_b"));
UPDATE_NOTIFY(src, int, quality, encoding_updated, (int)obs_data_get_int(settings, "quality"));
UPDATE_NOTIFY(src, int, qosdscp, dscp_updated, (int)obs_data_get_int(settings, "qosdscp"));
src->config.connect_opt = (int)obs_data_get_int(settings, "connect_opt");

UPDATE_NOTIFY(src, int, skip_update_l, skip_updated, (int)obs_data_get_int(settings, "skip_update_l"));
UPDATE_NOTIFY(src, int, skip_update_r, skip_updated, (int)obs_data_get_int(settings, "skip_update_r"));
UPDATE_NOTIFY(src, int, skip_update_t, skip_updated, (int)obs_data_get_int(settings, "skip_update_t"));
UPDATE_NOTIFY(src, int, skip_update_b, skip_updated, (int)obs_data_get_int(settings, "skip_update_b"));

pthread_mutex_unlock(&src->config_mutex);

Expand Down
3 changes: 3 additions & 0 deletions src/obs-vnc-source-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
#endif
#include <errno.h>

#ifndef WIN32
#define WIN32
#endif

#endif // _WIN32

#include <rfb/rfbclient.h>
Expand Down

0 comments on commit 48b6b34

Please sign in to comment.