Skip to content

Commit

Permalink
groot/rdict: add initial support for enums in genGoType
Browse files Browse the repository at this point in the history
  • Loading branch information
sbinet committed Feb 1, 2022
1 parent e6f8d63 commit 449e81e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions groot/rdict/gen_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,28 @@ func (g *genGoType) typename(se rbytes.StreamerElement) string {
return "root.Double32"
}
t, ok := rmeta.CxxBuiltins[tname]
if !ok {
enum := se.Type().String()
switch se.Type() {
case rmeta.Uint8:
enum = "uint8_t"
case rmeta.Uint16:
enum = "uint16_t"
case rmeta.Uint32:
enum = "uint32_t"
case rmeta.Uint64:
enum = "uint64_t"
case rmeta.Int8:
enum = "int8_t"
case rmeta.Int16:
enum = "int16_t"
case rmeta.Int32:
enum = "int32_t"
case rmeta.Int64:
enum = "int64_t"
}
t, ok = rmeta.CxxBuiltins[enum]
}
if !ok {
panic(fmt.Errorf("gen-type: unknown C++ builtin %q", tname))
}
Expand Down

0 comments on commit 449e81e

Please sign in to comment.