They are not really header files, so treating them as templates is more
consistent.  This also fixes generation of Doxygen documentation, which
got confused by #including files within function declarations.
---
 doc/Makefile                                       |    2 +-
 doc/print_options.c                                |    4 ++--
 libavcodec/options.c                               |    2 +-
 .../{options_table.h => options_table_template.c}  |   11 -----------
 libavformat/options.c                              |    2 +-
 .../{options_table.h => options_table_template.c}  |   10 ----------
 6 files changed, 5 insertions(+), 26 deletions(-)
 rename libavcodec/{options_table.h => options_table_template.c} (99%)
 rename libavformat/{options_table.h => options_table_template.c} (96%)

diff --git a/doc/Makefile b/doc/Makefile
index 15e7323..a5ca2a6 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -17,7 +17,7 @@ documentation: $(DOCS)
 
 TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
 
-doc/print_options.o: libavformat/options_table.h libavcodec/options_table.h
+doc/print_options.o: libavformat/options_table_template.c 
libavcodec/options_table_template.c
 
 GENTEXI  = format codec
 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
diff --git a/doc/print_options.c b/doc/print_options.c
index 4283e6a..6804719 100644
--- a/doc/print_options.c
+++ b/doc/print_options.c
@@ -93,7 +93,7 @@ static void show_opts(const AVOption *opts, int per_stream)
 
 static void show_format_opts(void)
 {
-#include "libavformat/options_table.h"
+#include "libavformat/options_table_template.c"
 
     printf("@section Format AVOptions\n");
     show_opts(options, 0);
@@ -101,7 +101,7 @@ static void show_format_opts(void)
 
 static void show_codec_opts(void)
 {
-#include "libavcodec/options_table.h"
+#include "libavcodec/options_table_template.c"
 
     printf("@section Codec AVOptions\n");
     show_opts(options, 1);
diff --git a/libavcodec/options.c b/libavcodec/options.c
index abbca0b..b79a76c 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -30,7 +30,7 @@
 #include "libavutil/opt.h"
 #include <float.h>              /* FLT_MIN, FLT_MAX */
 
-#include "options_table.h"
+#include "options_table_template.c"
 
 static const char* context_to_name(void* ptr) {
     AVCodecContext *avc= ptr;
diff --git a/libavcodec/options_table.h b/libavcodec/options_table_template.c
similarity index 99%
rename from libavcodec/options_table.h
rename to libavcodec/options_table_template.c
index f4a6ba7..c8e439f 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table_template.c
@@ -17,15 +17,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVCODEC_OPTIONS_TABLE
-#define AVCODEC_OPTIONS_TABLE
-
-#include <float.h>
-#include <limits.h>
-
-#include "libavutil/opt.h"
-#include "avcodec.h"
-
 #define OFFSET(x) offsetof(AVCodecContext,x)
 #define DEFAULT 0 //should be NAN but it does not work as it is not a constant 
in glibc as required by ANSI/ISO C
 //these names are too long to be readable
@@ -404,5 +395,3 @@ static const AVOption options[]={
 #undef D
 #undef DEFAULT
 #undef OFFSET
-
-#endif // AVCODEC_OPTIONS_TABLE
diff --git a/libavformat/options.c b/libavformat/options.c
index 3399dd4..163c1c5 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -26,7 +26,7 @@
  * Options definition for AVFormatContext.
  */
 
-#include "options_table.h"
+#include "options_table_template.c"
 
 static const char* format_to_name(void* ptr)
 {
diff --git a/libavformat/options_table.h b/libavformat/options_table_template.c
similarity index 96%
rename from libavformat/options_table.h
rename to libavformat/options_table_template.c
index 58f3dcf..c5f7e51 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table_template.c
@@ -16,14 +16,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVFORMAT_OPTIONS_TABLE
-#define AVFORMAT_OPTIONS_TABLE
-
-#include <limits.h>
-
-#include "libavutil/opt.h"
-#include "avformat.h"
-
 #define OFFSET(x) offsetof(AVFormatContext,x)
 #define DEFAULT 0 //should be NAN but it does not work as it is not a constant 
in glibc as required by ANSI/ISO C
 //these names are too long to be readable
@@ -63,5 +55,3 @@ static const AVOption options[]={
 #undef D
 #undef DEFAULT
 #undef OFFSET
-
-#endif // AVFORMAT_OPTIONS_TABLE
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to