Debian Codegraph @

debian/patches/0003-zap_config_h.patch

raw symbols SCIP
1 Author: Daniel Kobras <[email protected]>
2 Description: dv_types.h is part of the libdv API that has to be included
3 in application code. Therefore, it may not reference libdv's private
4 config.h. Of course, config.h was included for a reason, and this patch
5 tries to cover it up, because at least in the scope of the
6 Debian package we can reliably guess at the contents of config.h.
7 ---
8 libdv/dv_types.h | 42 ++++++++++++++++++++++++++++++------------
9 1 file changed, 30 insertions(+), 12 deletions(-)
10
11 --- libdv.orig/libdv/dv_types.h
12 +++ libdv/libdv/dv_types.h
13 @@ -26,10 +26,11 @@
14 #ifndef DV_TYPES_H
15 #define DV_TYPES_H
16
17 -#if HAVE_CONFIG_H
18 -# include <config.h>
19 -#endif
20 -
21 +/* The Debian package is always compiled with popt support, but using it
22 + * in an application is optional. Declare HAVE_LIBPOPT before including
23 + * the libdv headers in order to access popt-specific entries in the
24 + * libdv API.
25 + */
26 #if HAVE_LIBPOPT
27 #include <popt.h>
28 #endif // HAVE_LIBPOPT
29 @@ -38,11 +39,11 @@
30 #include <inttypes.h>
31 #include <stdio.h>
32 #include <time.h>
33 -#if HAVE_ENDIAN_H
34 +/* FIXME Some systems use machine/endian.h instead. We probably ought to
35 + * AC_SUBST the correct value in here. (Or use a namespace-clean dvconfig.h.)
36 + * This quick fix should do for glibc-based systems.
37 + */
38 #include <endian.h>
39 -#elif HAVE_MACHINE_ENDIAN_H
40 -#include <machine/endian.h>
41 -#endif
42
43 /* please tell me these are defined somewhere standard??? */
44 #ifndef FALSE
45 @@ -61,16 +62,33 @@
46 #define CLAMP(a,x,b) (MIN(b,MAX(a,x)))
47 #endif
48
49 +/* FIXME These values indicate whether libdv was built with asm optimizations.
50 + * It had better be AC_SUBSTed, but for the purpose of the Debian package, we
51 + * can easily guess the correct value from standard compiler macros.
52 + */
53 +#if !defined(ARCH_X86) && !defined(ARCH_X86_64)
54 +# if defined (__x86_64)
55 +# define ARCH_X86 0
56 +# define ARCH_X86_64 1
57 +# elif defined(i386)
58 +# define ARCH_X86 1
59 +# define ARCH_X86_64 0
60 +# else
61 +# define ARCH_X86 0
62 +# define ARCH_X86_64 0
63 +# endif
64 +#endif
65 +
66 // For now assume ARCH_X86 means GCC with hints.
67 #ifdef ARCH_X86
68 -#define HAVE_GCC 1
69 +#define LIBDV_HAVE_GCC 1
70 #endif
71 #ifdef ARCH_X86_64
72 -#define HAVE_GCC 1
73 +#define LIBDV_HAVE_GCC 1
74 #endif
75 -//#define HAVE_GCC 0
76 +//#define LIBDV_HAVE_GCC 0
77
78 -#if HAVE_GCC
79 +#if LIBDV_HAVE_GCC
80 #define ALIGN64 __attribute__ ((aligned (64)))
81 #define ALIGN32 __attribute__ ((aligned (32)))
82 #define ALIGN8 __attribute__ ((aligned (8)))