On Wed, 23 Apr 2014, Christophe Gisquet wrote:

2014-04-23 14:00 GMT+02:00 Janne Grunau <[email protected]>:
+/* struct ResampleContext */
+#define FILTER_BANK                     0x10
+#define FILTER_LENGTH                   0x18
+#define PHASE_SHIFT                     0x34
+#define PHASE_MASK                      (PHASE_SHIFT + 0x04) // loaded as pair

You plan to add a macro AV_CHECK_OFFSET, using offsetof as could be expected.

Naive question: why not do it directly? This may require creating an
intermediate header, but the benefit of never having to update the
above offsets seems worthwhile.

I guess there's a good reason not to do so, and I am wondering what it
is. ARM preprocessor ?

Not specific to arm itself, but the assemblers (whether it's nasm or gas or armasm or whatever) can't parse a C struct and give you the offsets, so we need a hardcoded define for the offset, which we then can check in C that it matched the current ABI layout.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to