10 printf_args = gst_c_args + ['-DSTATIC=G_GNUC_INTERNAL']
12 # Don't have a need for that and it's not portable so just ignore for now
13 printf_args += ['-UHAVE_LONG_DOUBLE']
15 # Just use internal emulation for printing long longs for now
16 printf_args += ['-UHAVE_LONG_LONG_FORMAT']
18 # Don't need any of this widechar stuff, so just disable it for now
19 printf_args += ['-UHAVE_WCHAR_T', '-UHAVE_WCSLEN', '-UHAVE_WINT_T']
21 if cc.has_argument('-Wno-format-nonliteral')
22 printf_args += ['-Wno-format-nonliteral']
25 # Check if 'long long' works and what format can be used to print it
26 # jm_AC_TYPE_LONG_LONG
27 if cc.compiles('''long long ll = 1LL;
29 int some_func (void) {
30 long long llmax = (long long) -1;
31 return ll << i | ll >> i | llmax / ll | llmax % ll;
32 }''', name : 'long long')
33 printf_args += ['-DHAVE_LONG_LONG']
36 have_long_long = false
39 # The following uintmax_t/intmax_t checks are also in glib
40 found_uintmax_t = false
42 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
43 # doesn't clash with <sys/types.h>, and declares uintmax_t.
44 # jm_AC_HEADER_INTTYPES_H
45 if cc.compiles('''#include <sys/types.h>
47 uintmax_t i = (uintmax_t) -1;
48 ''', name : 'uintmax_t in inttypes.h')
49 printf_args += ['-DHAVE_INTTYPES_H_WITH_UINTMAX']
50 found_uintmax_t = true
53 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
54 # doesn't clash with <sys/types.h>, and declares uintmax_t.
55 # jm_AC_HEADER_STDINT_H
56 if cc.compiles('''#include <sys/types.h>
58 uintmax_t i = (uintmax_t) -1;
59 ''', name : 'uintmax_t in stdint.h')
60 printf_args += ['-DHAVE_STDINT_H_WITH_UINTMAX']
61 found_uintmax_t = true
65 # Define intmax_t to 'long' or 'long long'
66 # if it is not already defined in <stdint.h> or <inttypes.h>.
67 # For simplicity, we assume that a header file defines 'intmax_t'
68 # if and only if it defines 'uintmax_t'.
69 printf_args += ['-DHAVE_INTMAX_T']
70 if not found_uintmax_t
72 printf_args += ['-Dintmax_t=long long']
74 printf_args += ['-Dintmax_t=long']
78 printf_lib = static_library('gstprintf',
80 include_directories : [configinc],
84 dependencies : [glib_dep])