Browse Source

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  lavu: avoid clashing definition of E
  doc: developer: Add a note about reserved system name space

Conflicts:
	libavutil/internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.2
Michael Niedermayer 12 years ago
parent
commit
a63dc846b5
2 changed files with 12 additions and 4 deletions
  1. +8
    -0
      doc/developer.texi
  2. +4
    -4
      libavutil/internal.h

+ 8
- 0
doc/developer.texi View File

@@ -169,6 +169,14 @@ For externally visible symbols, each library has its own prefix. Check
the existing code and choose names accordingly. the existing code and choose names accordingly.
@end itemize @end itemize


Furthermore, name space reserved for the system should not be invaded.
Identifiers ending in @code{_t} are reserved by
@url{http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html#tag_02_02_02, POSIX}.
Also avoid names starting with @code{__} or @code{_} followed by an uppercase
letter as they are reserved by the C standard. Names starting with @code{_}
are reserved at the file level and may not be used for externally visible
symbols. If in doubt, just avoid names starting with @code{_} altogether.

@subsection Miscellaneous conventions @subsection Miscellaneous conventions
@itemize @bullet @itemize @bullet
@item @item


+ 4
- 4
libavutil/internal.h View File

@@ -60,7 +60,7 @@


// Some broken preprocessors need a second expansion // Some broken preprocessors need a second expansion
// to be forced to tokenize __VA_ARGS__ // to be forced to tokenize __VA_ARGS__
#define EXPAND(x) x
#define E1(x) x


#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \ #define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
uint8_t la_##v[sizeof(t s o) + (a)]; \ uint8_t la_##v[sizeof(t s o) + (a)]; \
@@ -70,16 +70,16 @@
DECLARE_ALIGNED(a, t, la_##v) s o; \ DECLARE_ALIGNED(a, t, la_##v) s o; \
t (*v) o = la_##v t (*v) o = la_##v


#define LOCAL_ALIGNED(a, t, v, ...) EXPAND(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,))
#define LOCAL_ALIGNED(a, t, v, ...) E1(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,))


#if HAVE_LOCAL_ALIGNED_8 #if HAVE_LOCAL_ALIGNED_8
# define LOCAL_ALIGNED_8(t, v, ...) EXPAND(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
# define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
#else #else
# define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__) # define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__)
#endif #endif


#if HAVE_LOCAL_ALIGNED_16 #if HAVE_LOCAL_ALIGNED_16
# define LOCAL_ALIGNED_16(t, v, ...) EXPAND(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
# define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
#else #else
# define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__) # define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
#endif #endif


Loading…
Cancel
Save