Here is a patch to protect headers against multiple inclusion.
Please apply.
Lionel Debroux.
>From e5bd3f4dde6ed0ba9e7119f94cfaf7f90e1da91b Mon Sep 17 00:00:00 2001
From: Lionel Debroux <[EMAIL PROTECTED]>
Date: Sat, 16 Feb 2008 16:49:13 +0100
Subject: Protect several headers against multiple inclusion.
---
trunk/include/attributes.h | 6 ++++++
trunk/include/mmx.h | 7 +++++++
trunk/include/sse.h | 6 ++++++
trunk/include/video_out.h | 7 ++++++-
trunk/include/vis.h | 5 +++++
trunk/libmpeg2/convert/convert_internal.h | 5 +++++
trunk/libmpeg2/mpeg2_internal.h | 5 +++++
7 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/trunk/include/attributes.h b/trunk/include/attributes.h
index eefbc0d..f670837 100644
--- a/trunk/include/attributes.h
+++ b/trunk/include/attributes.h
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef __ATTRIBUTES_H__
+#define __ATTRIBUTES_H__
+
/* use gcc attribs to align critical data structures */
#ifdef ATTRIBUTE_ALIGNED_MAX
#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
@@ -28,6 +31,7 @@
#define ATTR_ALIGN(align)
#endif
+/* use gcc builtins to help branch prediction */
#ifdef HAVE_BUILTIN_EXPECT
#define likely(x) __builtin_expect ((x) != 0, 1)
#define unlikely(x) __builtin_expect ((x) != 0, 0)
@@ -35,3 +39,5 @@
#define likely(x) (x)
#define unlikely(x) (x)
#endif
+
+#endif
diff --git a/trunk/include/mmx.h b/trunk/include/mmx.h
index 08b4d47..79b40a4 100644
--- a/trunk/include/mmx.h
+++ b/trunk/include/mmx.h
@@ -21,6 +21,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef MMX_ASM_H
+#define MMX_ASM_H
+
+#include "attributes.h"
+
/*
* The type of an value that fits in an MMX register (note that long
* long constant values MUST be suffixed by LL and unsigned long long
@@ -261,3 +266,5 @@ typedef union {
#define pshufw_r2r(regs,regd,imm) mmx_r2ri(pshufw, regs, regd, imm)
#define sfence() __asm__ __volatile__ ("sfence\n\t")
+
+#endif
diff --git a/trunk/include/sse.h b/trunk/include/sse.h
index 4bd853f..6062964 100644
--- a/trunk/include/sse.h
+++ b/trunk/include/sse.h
@@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef SSE_ASM_H
+#define SSE_ASM_H
+
+#include "attributes.h"
+
typedef union {
float sf[4]; /* Single-precision (32-bit) value */
} ATTR_ALIGN(16) sse_t; /* On a 16 byte (128-bit) boundary */
@@ -254,3 +259,4 @@ typedef union {
: /* nothing */ \
: "X" (mem))
+#endif
diff --git a/trunk/include/video_out.h b/trunk/include/video_out.h
index 342c551..21199a0 100644
--- a/trunk/include/video_out.h
+++ b/trunk/include/video_out.h
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef VIDEO_OUT_H
+#define VIDEO_OUT_H
+
struct mpeg2_sequence_s;
struct mpeg2_convert_init_s;
typedef struct {
@@ -54,5 +57,7 @@ typedef struct {
void vo_accel (uint32_t accel);
-/* return NULL terminated array of all drivers */
+/** This function returns the NULL-terminated array of all drivers */
vo_driver_t const * vo_drivers (void);
+
+#endif
diff --git a/trunk/include/vis.h b/trunk/include/vis.h
index 69dd490..a4f05e7 100644
--- a/trunk/include/vis.h
+++ b/trunk/include/vis.h
@@ -41,6 +41,9 @@
* the assembler to keep the binary from becoming tainted.
*/
+#ifndef VIS_ASM_H
+#define VIS_ASM_H
+
#define vis_opc_base ((0x1 << 31) | (0x36 << 19))
#define vis_opf(X) ((X) << 5)
#define vis_sreg(X) (X)
@@ -326,3 +329,5 @@ static inline void vis_alignaddrl_g0(void *_ptr)
/* Pixel component distance. */
#define vis_pdist(rs1,rs2,rd) vis_dd2d(0x3e, rs1, rs2, rd)
+
+#endif
diff --git a/trunk/libmpeg2/convert/convert_internal.h b/trunk/libmpeg2/convert/convert_internal.h
index d1e63d5..c1dea93 100644
--- a/trunk/libmpeg2/convert/convert_internal.h
+++ b/trunk/libmpeg2/convert/convert_internal.h
@@ -20,6 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
+ #ifndef CONVERT_INTERNAL_H
+ #define CONVERT_INTERNAL_H
typedef struct {
uint8_t * rgb_ptr;
@@ -40,3 +43,5 @@ mpeg2convert_copy_t * mpeg2convert_rgb_mmx (int bpp, int mode,
const mpeg2_sequence_t * seq);
mpeg2convert_copy_t * mpeg2convert_rgb_vis (int bpp, int mode,
const mpeg2_sequence_t * seq);
+
+#endif
diff --git a/trunk/libmpeg2/mpeg2_internal.h b/trunk/libmpeg2/mpeg2_internal.h
index 719bab1..ad891ae 100644
--- a/trunk/libmpeg2/mpeg2_internal.h
+++ b/trunk/libmpeg2/mpeg2_internal.h
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef MPEG2_INTERNAL_H
+#define MPEG2_INTERNAL_H
+
#define STATE_INTERNAL_NORETURN ((mpeg2_state_t)-1)
/* macroblock modes */
@@ -304,3 +307,5 @@ extern mpeg2_mc_t mpeg2_mc_3dnow;
extern mpeg2_mc_t mpeg2_mc_altivec;
extern mpeg2_mc_t mpeg2_mc_alpha;
extern mpeg2_mc_t mpeg2_mc_vis;
+
+#endif
--
1.5.3.7
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Libmpeg2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmpeg2-devel