blob: 906c2fa84afd23c7a68258cef03b531db79a4f08 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
From 5d54dab6fd4f1f4433f26b2763c76218753ee31b Mon Sep 17 00:00:00 2001
From: Nirbheek Chauhan <nirbheek@centricular.com>
Date: Fri, 22 Feb 2019 02:31:47 +0530
Subject: [PATCH] Allow consuming the public API using MSVC
---
libvisual/lv_thread.h | 2 +-
libvisual/lv_time.h | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libvisual/lv_thread.h b/libvisual/lv_thread.h
index da93ab1..f9adc40 100644
--- a/libvisual/lv_thread.h
+++ b/libvisual/lv_thread.h
@@ -63,7 +63,7 @@ struct _VisMutex {
#ifdef VISUAL_THREAD_MODEL_POSIX
pthread_mutex_t mutex; /**< Private used for the pthreads implementation. */
#elif defined(VISUAL_THREAD_MODEL_WIN32) /* !VISUAL_THREAD_MODEL_POSIX */
-
+ int unused; /* MSVC does not allow empty structs */
#elif defined(VISUAL_THREAD_MODEL_GTHREAD) /* !VISUAL_THREAD_MODEL_WIN32 */
GMutex *mutex;
diff --git a/libvisual/lv_time.h b/libvisual/lv_time.h
index 885448a..e15c194 100644
--- a/libvisual/lv_time.h
+++ b/libvisual/lv_time.h
@@ -24,7 +24,9 @@
#ifndef _LV_TIME_H
#define _LV_TIME_H
+#ifndef _MSC_VER
#include <sys/time.h>
+#endif
#include <time.h>
#include <libvisual/lv_common.h>
@@ -103,7 +105,7 @@ int visual_timer_has_passed_by_values (VisTimer *timer, long sec, long usec);
*/
static inline void visual_timer_tsc_get (uint32_t *lo, uint32_t *hi)
{
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
+#if !defined(_MSC_VER) && (defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64))
__asm __volatile
("\n\t cpuid"
"\n\t rdtsc"
--
2.20.1.windows.1
|