[FFmpeg-cvslog] atomic: Add include guards to the implementation headers
Martin Storsjö
git at videolan.org
Tue Mar 12 16:41:55 CET 2013
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Mar 8 11:16:14 2013 +0200| [2240e92f052960693de55cf4924e80426dfaa965] | committer: Martin Storsjö
atomic: Add include guards to the implementation headers
This makes them pass standalone compilation tests. Previously,
they included atomic.h which included themselves again, leading to
double definitions.
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2240e92f052960693de55cf4924e80426dfaa965
---
libavutil/atomic_gcc.h | 5 +++++
libavutil/atomic_suncc.h | 4 ++++
libavutil/atomic_win32.h | 5 +++++
3 files changed, 14 insertions(+)
diff --git a/libavutil/atomic_gcc.h b/libavutil/atomic_gcc.h
index e2f3fe1..13713c8 100644
--- a/libavutil/atomic_gcc.h
+++ b/libavutil/atomic_gcc.h
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifndef AVUTIL_ATOMIC_GCC_H
+#define AVUTIL_ATOMIC_GCC_H
+
#include "atomic.h"
#define avpriv_atomic_int_get atomic_int_get_gcc
@@ -46,3 +49,5 @@ static inline void *atomic_ptr_cas_gcc(void * volatile *ptr,
{
return __sync_val_compare_and_swap(ptr, oldval, newval);
}
+
+#endif /* AVUTIL_ATOMIC_GCC_H */
diff --git a/libavutil/atomic_suncc.h b/libavutil/atomic_suncc.h
index 85373f5..5c11b57 100644
--- a/libavutil/atomic_suncc.h
+++ b/libavutil/atomic_suncc.h
@@ -17,6 +17,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifndef AVUTIL_ATOMIC_SUNCC_H
+#define AVUTIL_ATOMIC_SUNCC_H
+
#include <atomic.h>
#include <mbarrier.h>
@@ -49,3 +52,4 @@ static inline void *atomic_ptr_cas_suncc(void * volatile *ptr,
return atomic_cas_ptr(ptr, oldval, newval);
}
+#endif /* AVUTIL_ATOMIC_SUNCC_H */
diff --git a/libavutil/atomic_win32.h b/libavutil/atomic_win32.h
index 6ae61f6..84e8b7f 100644
--- a/libavutil/atomic_win32.h
+++ b/libavutil/atomic_win32.h
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifndef AVUTIL_ATOMIC_WIN32_H
+#define AVUTIL_ATOMIC_WIN32_H
+
#include <windows.h>
#include "atomic.h"
@@ -48,3 +51,5 @@ static inline void *atomic_ptr_cas_win32(void * volatile *ptr,
{
return InterlockedCompareExchangePointer(ptr, newval, oldval);
}
+
+#endif /* AVUTIL_ATOMIC_WIN32_H */
More information about the ffmpeg-cvslog
mailing list