Here is a patch to add consistent multiple inclusion guards to all
header files in libmpeg2. I have also used a LIBMPEG2_ prefix to avoid
possible namespace pollution issues. Please apply.
Diego
Index: include/mpeg2.h
===================================================================
--- include/mpeg2.h (revision 1156)
+++ include/mpeg2.h (working copy)
@@ -21,8 +21,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef MPEG2_H
-#define MPEG2_H
+#ifndef LIBMPEG2_MPEG2_H
+#define LIBMPEG2_MPEG2_H
#define MPEG2_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c))
#define MPEG2_RELEASE MPEG2_VERSION (0, 5, 0) /* 0.5.0 */
@@ -199,4 +199,4 @@
void mpeg2_malloc_hooks (void * malloc (unsigned, mpeg2_alloc_t),
int free (void *));
-#endif /* MPEG2_H */
+#endif /* LIBMPEG2_MPEG2_H */
Index: include/sse.h
===================================================================
--- include/sse.h (revision 1156)
+++ include/sse.h (working copy)
@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef LIBMPEG2_SSE_H
+#define LIBMPEG2_SSE_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 +257,4 @@
: /* nothing */ \
: "X" (mem))
+#endif /* LIBMPEG2_SSE_H */
Index: include/mpeg2convert.h
===================================================================
--- include/mpeg2convert.h (revision 1156)
+++ include/mpeg2convert.h (working copy)
@@ -21,8 +21,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef MPEG2CONVERT_H
-#define MPEG2CONVERT_H
+#ifndef LIBMPEG2_MPEG2CONVERT_H
+#define LIBMPEG2_MPEG2CONVERT_H
mpeg2_convert_t mpeg2convert_rgb32;
mpeg2_convert_t mpeg2convert_rgb24;
@@ -45,4 +45,4 @@
mpeg2_convert_t mpeg2convert_uyvy;
-#endif /* MPEG2CONVERT_H */
+#endif /* LIBMPEG2_MPEG2CONVERT_H */
Index: include/tendra.h
===================================================================
--- include/tendra.h (revision 1156)
+++ include/tendra.h (working copy)
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef LIBMPEG2_TENDRA_H
+#define LIBMPEG2_TENDRA_H
+
#pragma TenDRA begin
#pragma TenDRA longlong type warning
@@ -33,3 +36,5 @@
int TenDRA;
#endif /* TenDRA_check */
+
+#endif /* LIBMPEG2_TENDRA_H */
Index: include/video_out.h
===================================================================
--- include/video_out.h (revision 1156)
+++ include/video_out.h (working copy)
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef LIBMPEG2_VIDEO_OUT_H
+#define LIBMPEG2_VIDEO_OUT_H
+
struct mpeg2_sequence_s;
struct mpeg2_convert_init_s;
typedef struct {
@@ -56,3 +59,5 @@
/* return NULL terminated array of all drivers */
vo_driver_t const * vo_drivers (void);
+
+#endif /* LIBMPEG2_VIDEO_OUT_H */
Index: include/mmx.h
===================================================================
--- include/mmx.h (revision 1156)
+++ include/mmx.h (working copy)
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef LIBMPEG2_MMX_H
+#define LIBMPEG2_MMX_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 +264,5 @@
#define pshufw_r2r(regs,regd,imm) mmx_r2ri(pshufw, regs, regd, imm)
#define sfence() __asm__ __volatile__ ("sfence\n\t")
+
+#endif /* LIBMPEG2_MMX_H */
Index: include/vis.h
===================================================================
--- include/vis.h (revision 1156)
+++ include/vis.h (working copy)
@@ -41,6 +41,9 @@
* the assembler to keep the binary from becoming tainted.
*/
+#ifndef LIBMPEG2_VIS_H
+#define LIBMPEG2_VIS_H
+
#define vis_opc_base ((0x1 << 31) | (0x36 << 19))
#define vis_opf(X) ((X) << 5)
#define vis_sreg(X) (X)
@@ -326,3 +329,5 @@
/* Pixel component distance. */
#define vis_pdist(rs1,rs2,rd) vis_dd2d(0x3e, rs1, rs2, rd)
+
+#endif /* LIBMPEG2_VIS_H */
Index: include/alpha_asm.h
===================================================================
--- include/alpha_asm.h (revision 1156)
+++ include/alpha_asm.h (working copy)
@@ -20,8 +20,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef ALPHA_ASM_H
-#define ALPHA_ASM_H
+#ifndef LIBMPEG2_ALPHA_ASM_H
+#define LIBMPEG2_ALPHA_ASM_H
#include <inttypes.h>
@@ -178,4 +178,4 @@
#error "Unknown compiler!"
#endif
-#endif /* ALPHA_ASM_H */
+#endif /* LIBMPEG2_ALPHA_ASM_H */
Index: include/attributes.h
===================================================================
--- include/attributes.h (revision 1156)
+++ include/attributes.h (working copy)
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef LIBMPEG2_ATTRIBUTES_H
+#define LIBMPEG2_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)))
@@ -35,3 +38,5 @@
#define likely(x) (x)
#define unlikely(x) (x)
#endif
+
+#endif /* LIBMPEG2_ATTRIBUTES_H */
Index: src/gettimeofday.h
===================================================================
--- src/gettimeofday.h (revision 1156)
+++ src/gettimeofday.h (working copy)
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef LIBMPEG2_GETTIMEOFDAY_H
+#define LIBMPEG2_GETTIMEOFDAY_H
+
#if defined(HAVE_STRUCT_TIMEVAL) && defined(HAVE_GETTIMEOFDAY)
#if defined(TIME_WITH_SYS_TIME)
#include <sys/time.h>
@@ -45,3 +48,5 @@
#else
#undef HAVE_GETTIMEOFDAY
#endif
+
+#endif /* LIBMPEG2_GETTIMEOFDAY_H */
Index: libmpeg2/mpeg2_internal.h
===================================================================
--- libmpeg2/mpeg2_internal.h (revision 1156)
+++ libmpeg2/mpeg2_internal.h (working copy)
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef LIBMPEG2_MPEG2_INTERNAL_H
+#define LIBMPEG2_MPEG2_INTERNAL_H
+
#define STATE_INTERNAL_NORETURN ((mpeg2_state_t)-1)
/* macroblock modes */
@@ -304,3 +307,5 @@
extern mpeg2_mc_t mpeg2_mc_altivec;
extern mpeg2_mc_t mpeg2_mc_alpha;
extern mpeg2_mc_t mpeg2_mc_vis;
+
+#endif /* LIBMPEG2_MPEG2_INTERNAL_H */
Index: libmpeg2/vlc.h
===================================================================
--- libmpeg2/vlc.h (revision 1156)
+++ libmpeg2/vlc.h (working copy)
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef LIBMPEG2_VLC_H
+#define LIBMPEG2_VLC_H
+
#define GETWORD(bit_buf,shift,bit_ptr) \
do { \
bit_buf |= ((bit_ptr[0] << 8) | bit_ptr[1]) << (shift); \
@@ -427,3 +430,5 @@
{ 7, 7}, { 7, 7}, { 7, 7}, { 7, 7},
{ 7, 7}, { 7, 7}, { 7, 7}, { 7, 7}
};
+
+#endif /* LIBMPEG2_VLC_H */
Index: libvo/hw_bes.h
===================================================================
--- libvo/hw_bes.h (revision 1156)
+++ libvo/hw_bes.h (working copy)
@@ -21,8 +21,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef __LINUX_HW_BES_H
-#define __LINUX_HW_BES_H
+#ifndef LIBMPEG2_HW_BES_H
+#define LIBMPEG2_HW_BES_H
typedef struct {
uint32_t card_type;
@@ -47,4 +47,4 @@
#define MGA_G200 0x1234
#define MGA_G400 0x5678
-#endif
+#endif /* LIBMPEG2_HW_BES_H */
-------------------------------------------------------------------------
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