-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C++: add missing export macro to 'CppEnumeration.mustache'
Generated files for C++ did not contain export macro for enumerations. That was not the case of structs and classes. The reason for that was missing inclusion of 'CppExportMacro' in 'CppEnumeration.mustache'. Note: the change in logic is only a single line. The remaining changes in the commit are related to smoke tests -- the expected generated files with enumerations have been adjusted. Signed-off-by: Patryk Wrobel <[email protected]>
- Loading branch information
1 parent
1506145
commit fb2fc62
Showing
35 changed files
with
209 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
gluecodium/src/test/resources/smoke/attributes/output/cpp/include/smoke/AttributesEnum.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// | ||
|
||
// | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include "gluecodium/ExportGluecodiumCpp.h" | ||
#include <cstdint> | ||
|
||
namespace smoke { | ||
enum class [[OnEnumeration]] AttributesEnum { | ||
enum class _GLUECODIUM_CPP_EXPORT [[OnEnumeration]] AttributesEnum { | ||
[[OnEnumerator]] | ||
NOPE | ||
}; | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 16 additions & 1 deletion
17
gluecodium/src/test/resources/smoke/constants/output/cpp/include/smoke/Constants.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,38 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// | ||
|
||
// | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include "gluecodium/ExportGluecodiumCpp.h" | ||
#include <cstdint> | ||
#include <string> | ||
|
||
namespace smoke { | ||
struct _GLUECODIUM_CPP_EXPORT Constants { | ||
static const bool BOOL_CONSTANT; | ||
|
||
static const int32_t INT_CONSTANT; | ||
|
||
static const uint32_t UINT_CONSTANT; | ||
|
||
static const float FLOAT_CONSTANT; | ||
|
||
static const double DOUBLE_CONSTANT; | ||
|
||
static const ::std::string STRING_CONSTANT; | ||
enum class StateEnum { | ||
|
||
enum class _GLUECODIUM_CPP_EXPORT StateEnum { | ||
OFF, | ||
ON | ||
}; | ||
|
||
|
||
static const ::smoke::Constants::StateEnum ENUM_CONSTANT; | ||
|
||
}; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 18 additions & 1 deletion
19
...um/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/DeclarationOrder.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,54 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// | ||
|
||
// | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include "gluecodium/ExportGluecodiumCpp.h" | ||
#include "gluecodium/UnorderedMapHash.h" | ||
#include "gluecodium/VectorHash.h" | ||
#include <cstdint> | ||
#include <string> | ||
#include <unordered_map> | ||
#include <vector> | ||
|
||
namespace smoke { | ||
struct _GLUECODIUM_CPP_EXPORT DeclarationOrder { | ||
struct _GLUECODIUM_CPP_EXPORT NestedStruct { | ||
::std::string some_field; | ||
|
||
NestedStruct( ); | ||
explicit NestedStruct( ::std::string some_field ); | ||
|
||
}; | ||
enum class SomeEnum { | ||
|
||
enum class _GLUECODIUM_CPP_EXPORT SomeEnum { | ||
FOO, | ||
BAR = 7 | ||
}; | ||
|
||
|
||
using SomeTypeDef = int32_t; | ||
|
||
using NestedStructArray = ::std::vector< ::smoke::DeclarationOrder::NestedStruct >; | ||
|
||
using ErrorCodeToMessageMap = ::std::unordered_map< int32_t, ::smoke::DeclarationOrder::NestedStructArray >; | ||
|
||
struct _GLUECODIUM_CPP_EXPORT MainStruct { | ||
::smoke::DeclarationOrder::NestedStruct struct_field; | ||
::smoke::DeclarationOrder::SomeTypeDef type_def_field; | ||
::smoke::DeclarationOrder::NestedStructArray struct_array_field; | ||
::smoke::DeclarationOrder::ErrorCodeToMessageMap map_field; | ||
::smoke::DeclarationOrder::SomeEnum enum_field; | ||
|
||
MainStruct( ); | ||
MainStruct( ::smoke::DeclarationOrder::NestedStruct struct_field, ::smoke::DeclarationOrder::SomeTypeDef type_def_field, ::smoke::DeclarationOrder::NestedStructArray struct_array_field, ::smoke::DeclarationOrder::ErrorCodeToMessageMap map_field, ::smoke::DeclarationOrder::SomeEnum enum_field ); | ||
|
||
}; | ||
|
||
}; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
...odium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStruct.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// | ||
|
||
// | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include "gluecodium/ExportGluecodiumCpp.h" | ||
#include <cstdint> | ||
#include <string> | ||
|
||
namespace smoke { | ||
struct _GLUECODIUM_CPP_EXPORT OrderInStruct { | ||
struct _GLUECODIUM_CPP_EXPORT NestedStruct { | ||
::std::string some_field; | ||
|
||
NestedStruct( ); | ||
explicit NestedStruct( ::std::string some_field ); | ||
|
||
}; | ||
enum class SomeEnum { | ||
|
||
enum class _GLUECODIUM_CPP_EXPORT SomeEnum { | ||
FOO, | ||
BAR = 7 | ||
}; | ||
|
||
|
||
::smoke::OrderInStruct::NestedStruct struct_field; | ||
::smoke::OrderInStruct::SomeEnum enum_field; | ||
|
||
OrderInStruct( ); | ||
OrderInStruct( ::smoke::OrderInStruct::NestedStruct struct_field, ::smoke::OrderInStruct::SomeEnum enum_field ); | ||
|
||
}; | ||
|
||
|
||
} |
16 changes: 15 additions & 1 deletion
16
...t/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStructWithFunctions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,39 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// | ||
|
||
// | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include "gluecodium/ExportGluecodiumCpp.h" | ||
#include <cstdint> | ||
#include <string> | ||
|
||
namespace smoke { | ||
struct _GLUECODIUM_CPP_EXPORT OrderInStructWithFunctions { | ||
struct _GLUECODIUM_CPP_EXPORT NestedStruct { | ||
::std::string some_field; | ||
|
||
NestedStruct( ); | ||
explicit NestedStruct( ::std::string some_field ); | ||
|
||
}; | ||
enum class SomeEnum { | ||
|
||
enum class _GLUECODIUM_CPP_EXPORT SomeEnum { | ||
FOO, | ||
BAR = 7 | ||
}; | ||
|
||
|
||
::std::string some_field; | ||
|
||
OrderInStructWithFunctions( ); | ||
explicit OrderInStructWithFunctions( ::std::string some_field ); | ||
|
||
::smoke::OrderInStructWithFunctions::SomeEnum do_stuff( const ::smoke::OrderInStructWithFunctions::NestedStruct& struct_foo ) const; | ||
|
||
}; | ||
|
||
|
||
} |
10 changes: 9 additions & 1 deletion
10
gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithAlias.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithToStringHelper.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// | ||
|
||
// | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include "gluecodium/ExportGluecodiumCpp.h" | ||
#include <cstdint> | ||
#include <string_view> | ||
|
||
namespace smoke { | ||
enum class EnumWithToStringHelper { | ||
enum class _GLUECODIUM_CPP_EXPORT EnumWithToStringHelper { | ||
FIRST, | ||
SECOND | ||
}; | ||
|
||
std::string_view | ||
_GLUECODIUM_CPP_EXPORT to_string(EnumWithToStringHelper enumeration); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.