blob: f6997e2b8e1e64dac392087a9efc8c2a98b83115 (
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
50
51
52
53
54
|
$NetBSD: patch-include_vlc__fixups.h,v 1.3 2016/06/21 17:58:05 joerg Exp $
on NetBSD-current, just define "uselocale", nothing else
fixes build
static_assert: Assume that a compiler in C11 or C++11 frontend mode
has the _Static_assert keyword, but define the macro if it is missing
from the headers.
--- include/vlc_fixups.h.orig 2015-04-13 19:54:35.000000000 +0000
+++ include/vlc_fixups.h
@@ -218,16 +218,28 @@ int posix_memalign (void **, size_t, siz
/* locale.h */
#ifndef HAVE_USELOCALE
+#ifdef __NetBSD__
+#include <sys/param.h>
+#if __NetBSD_Version__ >= 699002300
+/* NetBSD-current has locale_t but no uselocale */
+#define NetBSD_LOCALE_HACK
+#endif
+#endif
+#ifdef NetBSD_LOCALE_HACK
+#include <locale.h>
+#else
#define LC_ALL_MASK 0
#define LC_NUMERIC_MASK 0
#define LC_MESSAGES_MASK 0
#define LC_GLOBAL_LOCALE ((locale_t)(uintptr_t)1)
typedef void *locale_t;
+#endif
static inline locale_t uselocale(locale_t loc)
{
(void)loc;
return NULL;
}
+#ifndef NetBSD_LOCALE_HACK
static inline void freelocale(locale_t loc)
{
(void)loc;
@@ -238,9 +250,12 @@ static inline locale_t newlocale(int mas
return NULL;
}
#endif
+#endif
-#if !defined (HAVE_STATIC_ASSERT)
+#if !defined (static_assert)
+# if !(__STDC_VERSION__ - 0 >= 201112L || __cplusplus >= 201103L)
# define _Static_assert(x, s) ((void) sizeof (struct { unsigned:-!(x); }))
+# endif
# define static_assert _Static_assert
#endif
|