And remove all the circular inclusions of avutil.h while at it.

Signed-off-by: Luca Barbato <[email protected]>
---

Now with one empty defgroup less.

 libavutil/Makefile  |  1 +
 libavutil/avutil.h  | 31 +------------------------------
 libavutil/error.h   |  1 -
 libavutil/macros.h  | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 libavutil/version.h | 20 +++++++++++++++++++-
 5 files changed, 72 insertions(+), 32 deletions(-)
 create mode 100644 libavutil/macros.h

diff --git a/libavutil/Makefile b/libavutil/Makefile
index cfe8d84..e0e32b4 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -27,6 +27,7 @@ HEADERS = adler32.h                                           
          \
           intreadwrite.h                                                \
           lfg.h                                                         \
           log.h                                                         \
+          macros.h                                                      \
           mathematics.h                                                 \
           md5.h                                                         \
           mem.h                                                         \
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index 782284d..451cc75 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -146,41 +146,11 @@
  * @}
  */

-
 /**
  * @defgroup preproc_misc Preprocessor String Macros
  *
- * String manipulation macros
- *
  * @{
- */
-
-#define AV_STRINGIFY(s)         AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define AV_GLUE(a, b) a ## b
-#define AV_JOIN(a, b) AV_GLUE(a, b)
-
-#define AV_PRAGMA(s) _Pragma(#s)
-
-/**
- * @}
- */
-
-/**
- * @defgroup version_utils Library Version Macros
  *
- * Useful to check and match library version in order to maintain
- * backward compatibility.
- *
- * @{
- */
-
-#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
-#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
-#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
-
-/**
  * @}
  */

@@ -305,6 +275,7 @@ char av_get_picture_type_char(enum AVPictureType pict_type);

 #include "error.h"
 #include "version.h"
+#include "macros.h"

 /**
  * @}
diff --git a/libavutil/error.h b/libavutil/error.h
index 3dfd880..268a032 100644
--- a/libavutil/error.h
+++ b/libavutil/error.h
@@ -26,7 +26,6 @@

 #include <errno.h>
 #include <stddef.h>
-#include "avutil.h"

 /**
  * @addtogroup lavu_error
diff --git a/libavutil/macros.h b/libavutil/macros.h
new file mode 100644
index 0000000..1cb4c3a
--- /dev/null
+++ b/libavutil/macros.h
@@ -0,0 +1,51 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <[email protected]>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * @ingroup lavu
+ * Utility Preprocessor macros
+ *
+ */
+
+#ifndef AVUTIL_MACROS_H
+#define AVUTIL_MACROS_H
+
+/**
+ * @addtogroup preproc_misc
+ *
+ * String manipulation macros
+ *
+ * @{
+ */
+
+#define AV_STRINGIFY(s)         AV_TOSTRING(s)
+#define AV_TOSTRING(s) #s
+
+#define AV_GLUE(a, b) a ## b
+#define AV_JOIN(a, b) AV_GLUE(a, b)
+
+/**
+ * @}
+ */
+
+#define AV_PRAGMA(s) _Pragma(#s)
+
+#endif /* AVUTIL_AVMACROS_H */
diff --git a/libavutil/version.h b/libavutil/version.h
index 9e1f2d8..293f673 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -19,7 +19,8 @@
 #ifndef AVUTIL_VERSION_H
 #define AVUTIL_VERSION_H

-#include "avutil.h"
+#include "macros.h"
+#include "avversion.h"

 /**
  * @file
@@ -28,6 +29,23 @@
  */

 /**
+ * @defgroup version_utils
+ *
+ * Useful to check and match library version in order to maintain
+ * backward compatibility.
+ *
+ * @{
+ */
+
+#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
+#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
+#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
+
+/**
+ * @}
+ */
+
+/**
  * @defgroup lavu_ver Version and Build diagnostics
  *
  * Macros and function useful to check at compiletime and at runtime
--
1.8.5.1

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

Reply via email to