mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-13 01:00:19 +00:00
Various fixes for mingw
This commit is contained in:
@@ -59,8 +59,8 @@
|
||||
#include "hexchatc.h"
|
||||
|
||||
/* Setting _FILE_OFFSET_BITS to 64 doesn't change lseek to use off64_t on Windows, so override lseek to the version that does */
|
||||
#ifdef WIN32
|
||||
#define lseek _lseeki64
|
||||
#if defined(WIN32) && (!defined(__MINGW32__) && !defined(__MINGW64__))
|
||||
#define lseek _lseeki64
|
||||
#endif
|
||||
|
||||
/* interval timer to detect timeouts */
|
||||
|
||||
@@ -24,9 +24,11 @@ common_sources = [
|
||||
'util.c'
|
||||
]
|
||||
|
||||
common_sysinfo_deps = []
|
||||
|
||||
common_deps = [
|
||||
libgio_dep,
|
||||
]
|
||||
] + global_deps
|
||||
|
||||
common_includes = [
|
||||
config_h_include,
|
||||
@@ -41,7 +43,10 @@ if host_machine.system() == 'windows'
|
||||
common_deps += [
|
||||
cc.find_library('ws2_32'), # winsock
|
||||
cc.find_library('winmm'), # playsound
|
||||
]
|
||||
common_sysinfo_deps += [
|
||||
cc.find_library('wbemuuid'), # sysinfo
|
||||
cc.find_library('wbemcore'),
|
||||
]
|
||||
|
||||
common_sources += 'sysinfo/win32/backend.c'
|
||||
@@ -98,7 +103,7 @@ endif
|
||||
hexchat_common = static_library('hexchatcommon',
|
||||
sources: [textevents] + marshal + common_sources,
|
||||
include_directories: config_h_include,
|
||||
dependencies: common_deps,
|
||||
dependencies: common_deps + common_sysinfo_deps,
|
||||
c_args: common_cflags,
|
||||
pic: true
|
||||
)
|
||||
@@ -113,4 +118,5 @@ hexchat_common_dep = declare_dependency(
|
||||
hexchat_plugin_dep = declare_dependency(
|
||||
include_directories: common_includes,
|
||||
compile_args: common_cflags,
|
||||
dependencies: global_deps,
|
||||
)
|
||||
|
||||
@@ -200,13 +200,15 @@ plugin_list_add (hexchat_context *ctx, char *filename, const char *name,
|
||||
return pl;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
static void *
|
||||
hexchat_dummy (hexchat_plugin *ph)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#else
|
||||
|
||||
static int
|
||||
hexchat_read_fd (hexchat_plugin *ph, GIOChannel *source, char *buf, int *len)
|
||||
{
|
||||
|
||||
@@ -1471,7 +1471,13 @@ handle_message_tag_time (const char *time, message_tags_data *tags_data)
|
||||
long long int t;
|
||||
|
||||
/* we ignore the milisecond part */
|
||||
if (sscanf (time, "%lld", &t) != 1)
|
||||
if (
|
||||
#if defined(__MINGW64__) || defined(__MINGW32__)
|
||||
__mingw_sscanf
|
||||
#else
|
||||
sscanf
|
||||
#endif
|
||||
(time, "%lld", &t) != 1)
|
||||
return;
|
||||
|
||||
tags_data->timestamp = (time_t) t;
|
||||
|
||||
@@ -174,7 +174,7 @@ static char *query_wmi (QueryWmiType type)
|
||||
goto release_locator;
|
||||
}
|
||||
|
||||
hr = namespace->lpVtbl->QueryInterface (namespace, &IID_IUnknown, &namespaceUnknown);
|
||||
hr = namespace->lpVtbl->QueryInterface (namespace, &IID_IUnknown, (void**)&namespaceUnknown);
|
||||
if (FAILED (hr))
|
||||
{
|
||||
goto release_namespace;
|
||||
|
||||
Reference in New Issue
Block a user