eProsima / Micro-XRCE-DDS-Gen

Micro XRCE-DDS IDL code generator tool. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
10 stars 13 forks source link

Does microxrceddsgen support union? #75

Open coolwaterld opened 11 months ago

coolwaterld commented 11 months ago

Question: Does microxrceddsgen support union? Env: OS: Linuxmint LMDE 5 (elsie) openjdk 17.0.6 2023-01-17 microxrceddsgen version: 2.0.2 (master branch) ID:Micro-XRCE-DDS-Gen/thirdparty/IDL-Parser/test/idls/coverage_basic.idl (only keep MyEnum and SimpleUnion)

enum MyEnum
{
    A,
    B,
    C
};
union SimpleUnion switch (long)
{
    case A:
        long first;
    case B:
        long long second;
};

Operation: ./microxrceddsgen ./coverage_basic.idl -replace (I copy coverage_basic.idl to scrip folder) Result: Generated: coverage_basic.c coverage_basic.h BUT no union supported. coverage_basic.c is empty:

#include "coverage_basic.h"

#include <ucdr/microcdr.h>
#include <string.h>

coverage_basic.h only enum

#ifndef _coverage_basic_H_
#define _coverage_basic_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>
#include <stdbool.h>

typedef enum MyEnum
{
    A,
    B,
    C
} MyEnum;

typedef uint32_t MyEnum_cdr;

#ifdef __cplusplus
}
#endif

#endif // _coverage_basic_H_
pablogs9 commented 10 months ago

No, it does not.