From 62ffefd4354ff47900238126151b0ca2d05f581e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 20 Oct 2007 13:39:41 +0000 Subject: [PATCH] Protects internal headers against incorrect/multiple inclusions --- src/audio_output/aout_internal.h | 8 ++++++++ src/input/input_internal.h | 8 ++++---- src/input/vlm_internal.h | 4 ++++ src/interface/interface.h | 8 ++++++++ src/misc/variables.h | 8 +++++++- src/modules/configuration.h | 4 ++++ src/modules/modules.h | 10 ++++++++++ src/playlist/playlist_internal.h | 4 ++++ src/stream_output/stream_output.h | 4 ++++ 9 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h index 2f5244e487..a730b92f47 100644 --- a/src/audio_output/aout_internal.h +++ b/src/audio_output/aout_internal.h @@ -21,6 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) +# error This header file can only be included from LibVLC. +#endif + +#ifndef __LIBVLC_AOUT_INTERNAL_H +# define __LIBVLC_AOUT_INTERNAL_H 1 + #if defined( __APPLE__ ) || defined( SYS_BSD ) #undef HAVE_ALLOCA #endif @@ -131,3 +138,4 @@ aout_buffer_t * aout_DecNewBuffer( aout_instance_t *, aout_input_t *, size_t ); void aout_DecDeleteBuffer( aout_instance_t *, aout_input_t *, aout_buffer_t * ); int aout_DecPlay( aout_instance_t *, aout_input_t *, aout_buffer_t *, int i_input_rate ); +#endif /* !__LIBVLC_AOUT_INTERNAL_H */ diff --git a/src/input/input_internal.h b/src/input/input_internal.h index 06ee78cc0c..d2a64131f5 100644 --- a/src/input/input_internal.h +++ b/src/input/input_internal.h @@ -21,6 +21,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) +# error This header file can only be included from LibVLC. +#endif + #ifndef _INPUT_INTERNAL_H #define _INPUT_INTERNAL_H 1 @@ -357,9 +361,6 @@ static inline int demux2_Control( demux_t *p_demux, int i_query, ... ) return i_result; } -#if defined(__PLUGIN__) || defined(__BUILTIN__) -# warning This is an internal header, something is wrong if you see this message. -#else /* Stream */ /** * stream_t definition @@ -389,6 +390,5 @@ static inline stream_t *vlc_stream_create( vlc_object_t *obj ) return (stream_t *)vlc_custom_create( obj, sizeof(stream_t), VLC_OBJECT_STREAM, "stream" ); } -#endif #endif diff --git a/src/input/vlm_internal.h b/src/input/vlm_internal.h index 4896e52c79..8609215d0a 100644 --- a/src/input/vlm_internal.h +++ b/src/input/vlm_internal.h @@ -21,6 +21,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) +# error This header file can only be included from LibVLC. +#endif + #ifndef _VLM_INTERNAL_H #define _VLM_INTERNAL_H 1 diff --git a/src/interface/interface.h b/src/interface/interface.h index cbad578d04..7f9268cbca 100644 --- a/src/interface/interface.h +++ b/src/interface/interface.h @@ -23,9 +23,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) +# error This header file can only be included from LibVLC. +#endif + +#ifndef __LIBVLC_INTERFACE_H +# define __LIBVLC_INTERFACE_H 1 + /********************************************************************** * Interaction **********************************************************************/ void intf_InteractionManage( playlist_t *); void intf_InteractionDestroy( interaction_t *); +#endif diff --git a/src/misc/variables.h b/src/misc/variables.h index 267985c6d4..2565edb88e 100644 --- a/src/misc/variables.h +++ b/src/misc/variables.h @@ -21,6 +21,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) +# error This header file can only be included from LibVLC. +#endif + +#ifndef __LIBVLC_VARIABLES_H +# define __LIBVLC_VARIABLES_H 1 typedef struct callback_entry_t callback_entry_t; @@ -69,4 +75,4 @@ struct variable_t /** Array of registered callbacks */ callback_entry_t * p_entries; }; - +#endif diff --git a/src/modules/configuration.h b/src/modules/configuration.h index 077d49c3f5..038d65f70b 100644 --- a/src/modules/configuration.h +++ b/src/modules/configuration.h @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) +# error This header file can only be included from LibVLC. +#endif + #ifndef LIBVLC_CONFIGURATION_H # define LIBVLC_CONFIGURATION_H 1 diff --git a/src/modules/modules.h b/src/modules/modules.h index c28fccb588..0af3ef231e 100644 --- a/src/modules/modules.h +++ b/src/modules/modules.h @@ -21,6 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) +# error This header file can only be included from LibVLC. +#endif + +#ifndef __LIBVLC_MODULES_H +# define __LIBVLC_MODULES_H 1 + + /* Number of tries before we unload an unused module */ #define MODULE_HIDE_DELAY 50 @@ -152,3 +160,5 @@ void __module_LoadPlugins ( vlc_object_t * ); void __module_EndBank ( vlc_object_t * ); #define module_ResetBank(a) __module_ResetBank(VLC_OBJECT(a)) void __module_ResetBank ( vlc_object_t * ); + +#endif /* !__LIBVLC_MODULES_H */ diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h index e82b677ee5..40e1ea3643 100644 --- a/src/playlist/playlist_internal.h +++ b/src/playlist/playlist_internal.h @@ -22,6 +22,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#ifndef __LIBVLC_PLAYLIST_INTERNAL_H +# define __LIBVLC_PLAYLIST_INTERNAL_H 1 + /** * \file * This file contain internal structures and function prototypes related @@ -130,3 +133,4 @@ int playlist_ItemDelete ( playlist_item_t * ); #endif #define PLI_NAME( p ) p && p->p_input ? p->p_input->psz_name : "null" +#endif /* !__LIBVLC_PLAYLIST_INTERNAL_H */ diff --git a/src/stream_output/stream_output.h b/src/stream_output/stream_output.h index d91db30f47..e153cea494 100644 --- a/src/stream_output/stream_output.h +++ b/src/stream_output/stream_output.h @@ -24,6 +24,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. ***************************************************************************/ +#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) +# error This header file can only be included from LibVLC. +#endif + #ifndef VLC_SRC_STREAMOUT_H # define VLC_SRC_STREAMOUT_H 1