[FFmpeg-devel] Fwd: [PATCH] Support alternative spellings of the inline keyword.

Ronald S. Bultje rsbultje at gmail.com
Sun Jun 17 00:05:03 CEST 2012


Hi,

same here, part of a MSVC port.

Ronald

---------- Forwarded message ----------
From: Ronald S. Bultje <rsbultje at gmail.com>
Date: Fri, Jun 15, 2012 at 7:04 PM
Subject: [PATCH] Support alternative spellings of the inline keyword.
To: libav-devel at libav.org
Cc: "Ronald S. Bultje" <rsbultje at gmail.com>


From: "Ronald S. Bultje" <rsbultje at gmail.com>

This is similar to how we support e.g. __restrict as an alternative for
restrict, and allows us to support compilers that use __inline instead
of inline. The define is placed in avconfig.h instead of config.h since
we use inline in public header files.
---
 configure              |    8 ++++++++
 libavutil/colorspace.h |    2 ++
 libavutil/intfloat.h   |    1 +
 libavutil/lfg.h        |    2 ++
 libavutil/libm.h       |    1 +
 libavutil/rational.h   |    1 +
 libavutil/timer.h      |    1 +
 7 files changed, 16 insertions(+)

diff --git a/configure b/configure
index a24bd52..f87953e 100755
--- a/configure
+++ b/configure
@@ -2627,6 +2627,13 @@ void foo(char * $restrict_keyword p);
 EOF
 done

+_inline=
+for inline_keyword in inline __inline; do
+    check_cc <<EOF && _inline=$inline_keyword && break
+void $inline_keyword foo();
+EOF
+done
+
 check_cc <<EOF && enable attribute_packed
 struct { int x; } __attribute__((packed)) x;
 EOF
@@ -3395,6 +3402,7 @@ cat > $TMPH <<EOF
 /* Generated by ffconf */
 #ifndef AVUTIL_AVCONFIG_H
 #define AVUTIL_AVCONFIG_H
+#define inline $_inline
 EOF

 print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
diff --git a/libavutil/colorspace.h b/libavutil/colorspace.h
index 8757566..4f219ea 100644
--- a/libavutil/colorspace.h
+++ b/libavutil/colorspace.h
@@ -27,6 +27,8 @@
 #ifndef AVUTIL_COLORSPACE_H
 #define AVUTIL_COLORSPACE_H

+#include "libavutil/avconfig.h"
+
 #define SCALEBITS 10
 #define ONE_HALF  (1 << (SCALEBITS - 1))
 #define FIX(x)    ((int) ((x) * (1<<SCALEBITS) + 0.5))
diff --git a/libavutil/intfloat.h b/libavutil/intfloat.h
index 9db624a..0be6904 100644
--- a/libavutil/intfloat.h
+++ b/libavutil/intfloat.h
@@ -22,6 +22,7 @@
 #define AVUTIL_INTFLOAT_H

 #include <stdint.h>
+#include "libavutil/avconfig.h"
 #include "attributes.h"

 union av_intfloat32 {
diff --git a/libavutil/lfg.h b/libavutil/lfg.h
index 904d00a..b621914 100644
--- a/libavutil/lfg.h
+++ b/libavutil/lfg.h
@@ -22,6 +22,8 @@
 #ifndef AVUTIL_LFG_H
 #define AVUTIL_LFG_H

+#include "libavutil/avconfig.h"
+
 typedef struct {
    unsigned int state[64];
    int index;
diff --git a/libavutil/libm.h b/libavutil/libm.h
index 783f3cd..67a2e09 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -25,6 +25,7 @@
 #define AVUTIL_LIBM_H

 #include <math.h>
+#include "libavutil/avconfig.h"
 #include "config.h"
 #include "attributes.h"

diff --git a/libavutil/rational.h b/libavutil/rational.h
index 0ec18ec..cf0ac43 100644
--- a/libavutil/rational.h
+++ b/libavutil/rational.h
@@ -30,6 +30,7 @@

 #include <stdint.h>
 #include <limits.h>
+#include "libavutil/avconfig.h"
 #include "attributes.h"

 /**
diff --git a/libavutil/timer.h b/libavutil/timer.h
index 78d2b5f..5009ec5 100644
--- a/libavutil/timer.h
+++ b/libavutil/timer.h
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <stdint.h>

+#include "libavutil/avconfig.h"
 #include "config.h"

 #if   ARCH_ARM
--
1.7.9.2


More information about the ffmpeg-devel mailing list