And remove all the circular inclusions of avutil.h while at it.
---
Hopefully I hadn't forgot anything, the macros still in avutil.h could be
(re)moved somewhere else, Derek I hope it works for your purposes.
libavutil/Makefile | 1 +
libavutil/avutil.h | 27 +++------------------
libavutil/error.h | 1 -
libavutil/macros.h | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++
libavutil/version.h | 2 +-
5 files changed, 72 insertions(+), 26 deletions(-)
create mode 100644 libavutil/macros.h
diff --git a/libavutil/Makefile b/libavutil/Makefile
index a635725..03223d6 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -28,6 +28,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..3004b4f 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -146,41 +146,19 @@
* @}
*/
-
/**
* @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 +283,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..8bf325a
--- /dev/null
+++ b/libavutil/macros.h
@@ -0,0 +1,67 @@
+/*
+ * 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)
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup 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)
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_AVMACROS_H */
diff --git a/libavutil/version.h b/libavutil/version.h
index dad8e2f..79a8dcb 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -19,7 +19,7 @@
#ifndef AVUTIL_VERSION_H
#define AVUTIL_VERSION_H
-#include "avutil.h"
+#include "macros.h"
/**
* @file
--
1.8.5.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel