Commit 28e23ced authored by Seungha Yang's avatar Seungha Yang 🐑
Browse files

meson: Do hard build error for some MSVC warnings

... and handle C4013 warning (default warning level is 3) for
"implicit function decl." warnings to be caught.
parent 9270f072
Pipeline #414071 waiting for manual action with stages
in 21 seconds
......@@ -110,9 +110,12 @@ if cc.get_id() == 'msvc'
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
# Enable some warnings on MSVC to match GCC/Clang behaviour
'/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/w14101', # 'identifier' : unreferenced local variable
# XXX: false positive warning in some cases
'/w14189', # 'identifier' : local variable is initialized but not referenced
# warning as error cases
'/we4062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/we4101', # 'identifier' : unreferenced local variable
'/we4013', # 'function' undefined; assuming extern returning int
]
add_project_arguments(msvc_args, language: ['c', 'cpp'])
endif
......
......@@ -67,6 +67,9 @@ static gboolean gst_vulkan_window_win32_open (GstVulkanWindow * window,
static void gst_vulkan_window_win32_close (GstVulkanWindow * window);
static void release_parent_win_id (GstVulkanWindowWin32 * window_win32);
static void gst_vulkan_window_win32_show (GstVulkanWindowWin32 * window);
static gboolean
gst_vulkan_window_win32_create_window (GstVulkanWindowWin32 * window_win32,
GError ** error);
static void
gst_vulkan_window_win32_class_init (GstVulkanWindowWin32Class * klass)
......
......@@ -95,6 +95,8 @@
#ifdef G_OS_WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
/* dup, read, close */
#include <io.h>
#else
#include <sys/socket.h>
#include <netdb.h>
......
......@@ -58,9 +58,12 @@ if cc.get_id() == 'msvc'
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
# Enable some warnings on MSVC to match GCC/Clang behaviour
'/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/w14101', # 'identifier' : unreferenced local variable
# XXX: false positive warning in some cases
'/w14189', # 'identifier' : local variable is initialized but not referenced
# warning as error cases
'/we4062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/we4101', # 'identifier' : unreferenced local variable
'/we4013', # 'function' undefined; assuming extern returning int
]
add_project_arguments(msvc_args, language: ['c', 'cpp'])
# Disable SAFESEH with MSVC for plugins and libs that use external deps that
......
......@@ -30,6 +30,8 @@
#ifdef _MSC_VER
/* ssize_t is not available, so match return value of read()/write() on MSVC */
#define ssize_t int
/* read, write */
#include <io.h>
#endif
#include <errno.h>
#include <string.h>
......
......@@ -23,6 +23,7 @@
#include <gst/gst.h>
#include <gst/video/video.h>
#include <stdlib.h>
#include "nvcodec.h"
......@@ -53,6 +54,7 @@ restore_terminal (void)
static void
print_keyboard_help (void)
{
/* *INDENT-OFF* */
static struct
{
const gchar *key_desc;
......@@ -68,6 +70,8 @@ print_keyboard_help (void)
"<", "Decrease encoding bitrate by 100 kbit/sec"}, {
"k", "show keyboard shortcuts"}
};
/* *INDENT-ON* */
guint i, chars_to_pad, desc_len, max_desc_len = 0;
g_print ("\n\n%s\n\n", "Keyboard controls:");
......
......@@ -56,9 +56,12 @@ if cc.get_id() == 'msvc'
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
# Enable some warnings on MSVC to match GCC/Clang behaviour
'/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/w14101', # 'identifier' : unreferenced local variable
# XXX: false positive warning in some cases
'/w14189', # 'identifier' : local variable is initialized but not referenced
# warning as error cases
'/we4062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/we4101', # 'identifier' : unreferenced local variable
'/we4013', # 'function' undefined; assuming extern returning int
]
add_project_arguments(msvc_args, language: ['c', 'cpp'])
# Disable SAFESEH with MSVC for plugins and libs that use external deps that
......
......@@ -30,8 +30,9 @@
#include <glib-object.h>
#include <glib/gprintf.h>
#include <gst/gst.h>
#include <stdlib.h>
/* There are several supported scenarios
/* There are several supported scenarios
0) Play rate to 1x -> Apply 'instant-rate-change' to 2x -> Apply 'instant-rate-change' to 0.25x (repeat as fast as possible for 2 sec) -> let play for 2s
1) Play rate to 1x -> Apply 'instant-rate-change' to 2x -> run for 10s, then pause -> wait 10s -> play
2) Play rate to 1x -> Apply 'instant-rate-change' to 2x -> run for 10s, then pause -> wait 10s -> Apply 'instant-rate-change' to 1x -> play
......
......@@ -43,9 +43,12 @@ if cc.get_id() == 'msvc'
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
# Enable some warnings on MSVC to match GCC/Clang behaviour
'/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/w14101', # 'identifier' : unreferenced local variable
# XXX: false positive warning in some cases
'/w14189', # 'identifier' : local variable is initialized but not referenced
# warning as error cases
'/we4062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/we4101', # 'identifier' : unreferenced local variable
'/we4013', # 'function' undefined; assuming extern returning int
]
if have_cxx
add_project_arguments(msvc_args, language: ['c', 'cpp'])
......
......@@ -44,9 +44,12 @@ if cc.get_id() == 'msvc'
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
# Enable some warnings on MSVC to match GCC/Clang behaviour
'/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/w14101', # 'identifier' : unreferenced local variable
# XXX: false positive warning in some cases
'/w14189', # 'identifier' : local variable is initialized but not referenced
# warning as error cases
'/we4062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/we4101', # 'identifier' : unreferenced local variable
'/we4013', # 'function' undefined; assuming extern returning int
]
if have_cxx
add_project_arguments(msvc_args, language: ['c', 'cpp'])
......
......@@ -72,6 +72,10 @@
#include <io.h>
#endif
#ifdef HAVE_PROCESS_H
# include <process.h> /* getpid on win32 */
#endif
#include <gst/base/base.h>
GST_DEBUG_CATEGORY_STATIC (ptp_debug);
......
......@@ -49,9 +49,12 @@ if cc.get_id() == 'msvc'
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
# Enable some warnings on MSVC to match GCC/Clang behaviour
'/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/w14101', # 'identifier' : unreferenced local variable
# XXX: false positive warning in some cases
'/w14189', # 'identifier' : local variable is initialized but not referenced
# warning as error cases
'/we4062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
'/we4101', # 'identifier' : unreferenced local variable
'/we4013', # 'function' undefined; assuming extern returning int
]
add_project_arguments(msvc_args, language: 'c')
elif cc.has_link_argument('-Wl,-Bsymbolic-functions')
......@@ -211,7 +214,11 @@ check_headers = [
]
if host_system == 'windows'
check_headers += ['winsock2.h']
check_headers += [
'winsock2.h',
# For getpid()
'process.h',
]
endif
foreach h : check_headers
......
......@@ -28,6 +28,7 @@
#ifdef G_OS_WIN32
#include <winsock2.h>
#include <fcntl.h>
#include <io.h>
#else
#include <unistd.h>
#include <sys/socket.h>
......
......@@ -41,6 +41,10 @@
# include <sys/wait.h>
#endif
#ifdef G_OS_WIN32
/* _isatty() */
#include <io.h>
#endif
/* "R" : support color
* "X" : do not clear the screen when leaving the pager
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment