[Gmerlin-general] gavl and C++
Status: Beta
Brought to you by:
gmerlin
From: IOhannes m z. <zmo...@ie...> - 2016-03-10 14:36:11
|
while trying to compile some C++-code with the current SVN head o gavl/gmerlin/gmerlin_avdecoder, i noticed that gavl.h is not C++ compliant (nor ISO C, for that matter). the problem is, that an enum is used as a base type in a typedef, before the enum is actually declared: <gavl.h:103> typedef enum gavl_pixelformat_e gavl_pixelformat_t; /* skip to line:1813...: */ enum gavl_pixelformat_e { /* ... */ </gavl.h> it seems that you can get away with this in gcc, but g++ is more strict and throws an error: /usr/local/include/gavl/gavl.h:103:14: error: use of enum ‘gavl_pixelformat_e’ without previous declaration typedef enum gavl_pixelformat_e gavl_pixelformat_t; according to [1], the forward declaration of enums is forbidden in both "ISO C" and "C++". it would be great if this could be fixed. (attached is a naive fix, reordering two chunks) mgfadsr IOhannes [1] http://stackoverflow.com/questions/20150739/ |