[Ffmpeg-devel] [RFC] move stuff in libavutil/common.h out of #ifdef HAVE_AV_CONFIG_H

Reimar Döffinger Reimar.Doeffinger
Sun Jul 9 11:41:08 CEST 2006

I can't see any clear semantics as how HAVE_AV_CONFIG_H is supposed to
be used (see e.g. this comment: "/* only include the following when
compiling package */"), but the attached patch would move some of the
more useful functions out of the #ifdef and make them more easily
available to non-ffmpeg users.
Probably stuff that uses e.g. #ifdef ARCH_X86 should not be moved, but I
don't really know and hope to get some ideas from you.
Though it might be a better idea to make those #define HAVE_AV_CONFIG_H
and provide an appropriate config file (that also defines all the
ARCH_... stuff), and introduce another define that would get rid of all
the stuff most people outside of ffmpeg will not want, like
#define malloc please_use_av_malloc

Reimar D?ffinger
-------------- next part --------------
Index: libavutil/common.h
--- libavutil/common.h	(revision 5688)
+++ libavutil/common.h	(working copy)
@@ -311,6 +311,8 @@
 #    define av_abort()      do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
+#endif /* HAVE_AV_CONFIG_H */
 //rounded divison & shift
 #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
 /* assume b>0 */
@@ -601,6 +603,7 @@
 #define STOP_TIMER(id) {}
 /* avoid usage of various functions */
 #define malloc please_use_av_malloc
 #define free please_use_av_free

More information about the ffmpeg-devel mailing list