While I'm certainly no C++ expert, I believe this is the case. If I
understand it correctly (i.e., googling ;-)), anonymous structs aren't
standard in C until C11 either.

// Simon

On 2015-02-24 14:21, Bill Fischofer wrote:
> Are you saying C++ does not support anonymous structs/unions?  They're
> one of the most useful features of C and make for vastly more readable code.
> 
> On Tue, Feb 24, 2015 at 1:01 AM, Simon Kågström
> <[email protected] <mailto:[email protected]>>
> wrote:
> 
>     On 2015-02-23 21:17, [email protected]
>     <mailto:[email protected]> wrote:
>     > Some googling suggests that this is because the ODP API files do not 
> have a
>     > named namespace and as a result default to the namespace 'anonymous'.  
> However,
>     > anonymous is limited to a single translation unit.
> 
>     [...]
> 
>     > #ifdef __cplusplus
>     > extern "C" {
>     > namespace ODP {
>     > #endif
>     >
>     > ...ODP definitions
>     >
>     > #ifdef __cplusplus
>     > }
>     > }
>     > #endif
> 
>     I think the proper fix is something like this:
> 
>     diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
>     index 6fe52fa..5eb8448 100644
>     --- a/include/odp/api/pool.h
>     +++ b/include/odp/api/pool.h
>     @@ -82,7 +82,7 @@ typedef struct odp_pool_param_t {
>                     struct {
>                             uint32_t num;    /**< Number of timeouts in the
>     pool */
>                     } tmo;
>     -       };
>     +       } u;
> 
>             int type;  /**< Pool type */
>      } odp_pool_param_t;
> 
> 
>     And then changing all the uses of them.
> 
>     // Simon
> 
>     _______________________________________________
>     lng-odp mailing list
>     [email protected] <mailto:[email protected]>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
> 
> 

_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to