From a38f5ee8b5bc5e8b4b04628d63b221294b6a986c Mon Sep 17 00:00:00 2001 From: alancast Date: Tue, 1 May 2018 16:10:37 -0700 Subject: [PATCH] Added support for constexpr for primitives in header files (#354) * Got a basic version of constexpr in headers working * got enum values to work as well * can't do enums because interface headers forward declare so you can't set it there. So only primitives allowed * fixing const enums in obj-c, which apparently never worked to begin with --- CONTRIBUTORS | 1 + src/source/BaseObjcGenerator.scala | 2 +- src/source/CppGenerator.scala | 36 ++++++++++++++-- test-suite/djinni/constants.djinni | 10 +++++ .../generated-src/cpp/constant_enum.hpp | 26 ++++++++++++ test-suite/generated-src/cpp/constants.cpp | 18 ++++---- test-suite/generated-src/cpp/constants.hpp | 19 +++++---- .../generated-src/cpp/constants_interface.cpp | 17 ++++---- .../generated-src/cpp/constants_interface.hpp | 17 ++++---- .../com/dropbox/djinni/test/ConstantEnum.java | 14 +++++++ .../com/dropbox/djinni/test/Constants.java | 3 ++ .../djinni/test/ConstantsInterface.java | 3 ++ .../generated-src/jni/NativeConstantEnum.hpp | 26 ++++++++++++ .../jni/NativeConstantsInterface.cpp | 1 + .../objc/DBConstantEnum+Private.h | 6 +++ .../generated-src/objc/DBConstantEnum.h | 11 +++++ .../generated-src/objc/DBConstants+Private.mm | 1 + test-suite/generated-src/objc/DBConstants.h | 2 + test-suite/generated-src/objc/DBConstants.mm | 6 +++ .../objc/DBConstantsInterface+Private.mm | 7 ++++ .../generated-src/objc/DBConstantsInterface.h | 2 + test-suite/generated-src/outFileList.txt | 5 +++ .../DjinniObjcTest.xcodeproj/project.pbxproj | 42 +++++++++++-------- 23 files changed, 222 insertions(+), 53 deletions(-) create mode 100644 test-suite/generated-src/cpp/constant_enum.hpp create mode 100644 test-suite/generated-src/java/com/dropbox/djinni/test/ConstantEnum.java create mode 100644 test-suite/generated-src/jni/NativeConstantEnum.hpp create mode 100644 test-suite/generated-src/objc/DBConstantEnum+Private.h create mode 100644 test-suite/generated-src/objc/DBConstantEnum.h diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c178ec908..0d9a926e4 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -5,4 +5,5 @@ The complete list of contributors can be identified through Git history. - Google Inc. +- Microsoft Corp. diff --git a/src/source/BaseObjcGenerator.scala b/src/source/BaseObjcGenerator.scala index 3e19473d9..ea23bb658 100644 --- a/src/source/BaseObjcGenerator.scala +++ b/src/source/BaseObjcGenerator.scala @@ -57,7 +57,7 @@ abstract class BaseObjcGenerator(spec: Spec) extends Generator(spec) { case d: Double => w.w(boxedPrimitive(ty) + d.toString) case b: Boolean => w.w(boxedPrimitive(ty) + (if (b) "YES" else "NO")) case s: String => w.w("@" + s) - case e: EnumValue => w.w(idObjc.enum(e.ty + "_" + e.name)) + case e: EnumValue => w.w(marshal.typename(ty) + idObjc.enum(e.name)) case v: ConstRef => w.w(selfName + idObjc.const (v.name)) case z: Map[_, _] => { // Value is record val recordMdef = ty.resolved.base.asInstanceOf[MDef] diff --git a/src/source/CppGenerator.scala b/src/source/CppGenerator.scala index b4bcea828..4902c4adc 100644 --- a/src/source/CppGenerator.scala +++ b/src/source/CppGenerator.scala @@ -112,11 +112,35 @@ class CppGenerator(spec: Spec) extends Generator(spec) { }) } + def shouldConstexpr(c: Const) = { + // Make sure we don't constexpr optionals as some might not support it + val canConstexpr = c.ty.resolved.base match { + case p: MPrimitive if c.ty.resolved.base != MOptional => true + case _ => false + } + canConstexpr + } + def generateHppConstants(w: IndentWriter, consts: Seq[Const]) = { for (c <- consts) { + // set value in header if can constexpr (only primitives) + var constexpr = shouldConstexpr(c) + var constValue = ";" + if (constexpr) { + constValue = c.value match { + case l: Long => " = " + l.toString + ";" + case d: Double if marshal.fieldType(c.ty) == "float" => " = " + d.toString + "f;" + case d: Double => " = " + d.toString + ";" + case b: Boolean => if (b) " = true;" else " = false;" + case _ => ";" + } + } + val constFieldType = if (constexpr) s"constexpr ${marshal.fieldType(c.ty)}" else s"${marshal.fieldType(c.ty)} const" + + // Write code to the header file w.wl writeDoc(w, c.doc) - w.wl(s"static ${marshal.fieldType(c.ty)} const ${idCpp.const(c.ident)};") + w.wl(s"static ${constFieldType} ${idCpp.const(c.ident)}${constValue}") } } @@ -127,7 +151,7 @@ class CppGenerator(spec: Spec) extends Generator(spec) { case d: Double => w.w(d.toString) case b: Boolean => w.w(if (b) "true" else "false") case s: String => w.w("{" + s + "}") - case e: EnumValue => w.w(marshal.typename(ty) + "::" + idCpp.enum(e.ty.name + "_" + e.name)) + case e: EnumValue => w.w(marshal.typename(ty) + "::" + idCpp.enum(e.name)) case v: ConstRef => w.w(selfName + "::" + idCpp.const(v)) case z: Map[_, _] => { // Value is record val recordMdef = ty.resolved.base.asInstanceOf[MDef] @@ -150,8 +174,12 @@ class CppGenerator(spec: Spec) extends Generator(spec) { val skipFirst = SkipFirst() for (c <- consts) { skipFirst{ w.wl } - w.w(s"${marshal.fieldType(c.ty)} const $selfName::${idCpp.const(c.ident)} = ") - writeCppConst(w, c.ty, c.value) + if (shouldConstexpr(c)){ + w.w(s"${marshal.fieldType(c.ty)} const $selfName::${idCpp.const(c.ident)}") + } else { + w.w(s"${marshal.fieldType(c.ty)} const $selfName::${idCpp.const(c.ident)} = ") + writeCppConst(w, c.ty, c.value) + } w.wl(";") } } diff --git a/test-suite/djinni/constants.djinni b/test-suite/djinni/constants.djinni index 3222e8618..6ce178c78 100644 --- a/test-suite/djinni/constants.djinni +++ b/test-suite/djinni/constants.djinni @@ -1,3 +1,9 @@ +# enum for use in constants +constant_enum = enum { + some_value; + some_other_value; +} + # Record for use in constants constant_record = record { some_integer: i32; @@ -18,6 +24,8 @@ constants = record { # Indented third line of multi-line documentation.) const f64_constant: f64 = 5.0; + const const_enum: constant_enum = constant_enum::some_value; + const opt_bool_constant: optional = true; const opt_i8_constant: optional = 1; # opt_i16_constant has documentation. @@ -59,6 +67,8 @@ constants_interface = interface +c { const f32_constant: f32 = 5.0; const f64_constant: f64 = 5.0; + const const_enum: constant_enum = constant_enum::some_value; + const opt_bool_constant: optional = true; const opt_i8_constant: optional = 1; # opt_i16_constant has documentation. diff --git a/test-suite/generated-src/cpp/constant_enum.hpp b/test-suite/generated-src/cpp/constant_enum.hpp new file mode 100644 index 000000000..b6412d050 --- /dev/null +++ b/test-suite/generated-src/cpp/constant_enum.hpp @@ -0,0 +1,26 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file generated by Djinni from constants.djinni + +#pragma once + +#include + +namespace testsuite { + +enum class constant_enum : int { + SOME_VALUE, + SOME_OTHER_VALUE, +}; + +} // namespace testsuite + +namespace std { + +template <> +struct hash<::testsuite::constant_enum> { + size_t operator()(::testsuite::constant_enum type) const { + return std::hash()(static_cast(type)); + } +}; + +} // namespace std diff --git a/test-suite/generated-src/cpp/constants.cpp b/test-suite/generated-src/cpp/constants.cpp index db05286d6..a20cd1305 100644 --- a/test-suite/generated-src/cpp/constants.cpp +++ b/test-suite/generated-src/cpp/constants.cpp @@ -5,19 +5,21 @@ namespace testsuite { -bool const Constants::BOOL_CONSTANT = true; +bool const Constants::BOOL_CONSTANT; -int8_t const Constants::I8_CONSTANT = 1; +int8_t const Constants::I8_CONSTANT; -int16_t const Constants::I16_CONSTANT = 2; +int16_t const Constants::I16_CONSTANT; -int32_t const Constants::I32_CONSTANT = 3; +int32_t const Constants::I32_CONSTANT; -int64_t const Constants::I64_CONSTANT = 4; +int64_t const Constants::I64_CONSTANT; -float const Constants::F32_CONSTANT = 5.0f; +float const Constants::F32_CONSTANT; -double const Constants::F64_CONSTANT = 5.0; +double const Constants::F64_CONSTANT; + +constant_enum const Constants::CONST_ENUM = constant_enum::SOME_VALUE; std::experimental::optional const Constants::OPT_BOOL_CONSTANT = true; @@ -41,6 +43,6 @@ ConstantRecord const Constants::OBJECT_CONSTANT = ConstantRecord( Constants::I32_CONSTANT /* some_integer */ , Constants::STRING_CONSTANT /* some_string */ ); -bool const Constants::DUMMY = false; +bool const Constants::DUMMY; } // namespace testsuite diff --git a/test-suite/generated-src/cpp/constants.hpp b/test-suite/generated-src/cpp/constants.hpp index 32b1a0283..b53a9f952 100644 --- a/test-suite/generated-src/cpp/constants.hpp +++ b/test-suite/generated-src/cpp/constants.hpp @@ -4,6 +4,7 @@ #pragma once #include "../../handwritten-src/cpp/optional.hpp" +#include "constant_enum.hpp" #include "constant_record.hpp" #include #include @@ -15,24 +16,26 @@ namespace testsuite { struct Constants final { /** bool_constant has documentation. */ - static bool const BOOL_CONSTANT; + static constexpr bool BOOL_CONSTANT = true; - static int8_t const I8_CONSTANT; + static constexpr int8_t I8_CONSTANT = 1; - static int16_t const I16_CONSTANT; + static constexpr int16_t I16_CONSTANT = 2; - static int32_t const I32_CONSTANT; + static constexpr int32_t I32_CONSTANT = 3; - static int64_t const I64_CONSTANT; + static constexpr int64_t I64_CONSTANT = 4; - static float const F32_CONSTANT; + static constexpr float F32_CONSTANT = 5.0f; /** * f64_constant has long documentation. * (Second line of multi-line documentation. * Indented third line of multi-line documentation.) */ - static double const F64_CONSTANT; + static constexpr double F64_CONSTANT = 5.0; + + static constant_enum const CONST_ENUM; static std::experimental::optional const OPT_BOOL_CONSTANT; @@ -65,7 +68,7 @@ struct Constants final { * No support for optional constant records * No support for constant binary, list, set, map */ - static bool const DUMMY; + static constexpr bool DUMMY = false; }; } // namespace testsuite diff --git a/test-suite/generated-src/cpp/constants_interface.cpp b/test-suite/generated-src/cpp/constants_interface.cpp index b24932e9f..ebab3a41c 100644 --- a/test-suite/generated-src/cpp/constants_interface.cpp +++ b/test-suite/generated-src/cpp/constants_interface.cpp @@ -2,23 +2,26 @@ // This file generated by Djinni from constants.djinni #include "constants_interface.hpp" // my header +#include "constant_enum.hpp" #include "constant_record.hpp" namespace testsuite { -bool const ConstantsInterface::BOOL_CONSTANT = true; +bool const ConstantsInterface::BOOL_CONSTANT; -int8_t const ConstantsInterface::I8_CONSTANT = 1; +int8_t const ConstantsInterface::I8_CONSTANT; -int16_t const ConstantsInterface::I16_CONSTANT = 2; +int16_t const ConstantsInterface::I16_CONSTANT; -int32_t const ConstantsInterface::I32_CONSTANT = 3; +int32_t const ConstantsInterface::I32_CONSTANT; -int64_t const ConstantsInterface::I64_CONSTANT = 4; +int64_t const ConstantsInterface::I64_CONSTANT; -float const ConstantsInterface::F32_CONSTANT = 5.0f; +float const ConstantsInterface::F32_CONSTANT; -double const ConstantsInterface::F64_CONSTANT = 5.0; +double const ConstantsInterface::F64_CONSTANT; + +constant_enum const ConstantsInterface::CONST_ENUM = constant_enum::SOME_VALUE; std::experimental::optional const ConstantsInterface::OPT_BOOL_CONSTANT = true; diff --git a/test-suite/generated-src/cpp/constants_interface.hpp b/test-suite/generated-src/cpp/constants_interface.hpp index 54a7d6c8c..83682e6e9 100644 --- a/test-suite/generated-src/cpp/constants_interface.hpp +++ b/test-suite/generated-src/cpp/constants_interface.hpp @@ -9,6 +9,7 @@ namespace testsuite { +enum class constant_enum; struct ConstantRecord; /** Interface containing constants */ @@ -16,25 +17,27 @@ class ConstantsInterface { public: virtual ~ConstantsInterface() {} - static bool const BOOL_CONSTANT; + static constexpr bool BOOL_CONSTANT = true; - static int8_t const I8_CONSTANT; + static constexpr int8_t I8_CONSTANT = 1; - static int16_t const I16_CONSTANT; + static constexpr int16_t I16_CONSTANT = 2; /** i32_constant has documentation. */ - static int32_t const I32_CONSTANT; + static constexpr int32_t I32_CONSTANT = 3; /** * i64_constant has long documentation. * (Second line of multi-line documentation. * Indented third line of multi-line documentation.) */ - static int64_t const I64_CONSTANT; + static constexpr int64_t I64_CONSTANT = 4; - static float const F32_CONSTANT; + static constexpr float F32_CONSTANT = 5.0f; - static double const F64_CONSTANT; + static constexpr double F64_CONSTANT = 5.0; + + static constant_enum const CONST_ENUM; static std::experimental::optional const OPT_BOOL_CONSTANT; diff --git a/test-suite/generated-src/java/com/dropbox/djinni/test/ConstantEnum.java b/test-suite/generated-src/java/com/dropbox/djinni/test/ConstantEnum.java new file mode 100644 index 000000000..06995053b --- /dev/null +++ b/test-suite/generated-src/java/com/dropbox/djinni/test/ConstantEnum.java @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file generated by Djinni from constants.djinni + +package com.dropbox.djinni.test; + +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; + +/** enum for use in constants */ +public enum ConstantEnum { + SOME_VALUE, + SOME_OTHER_VALUE, + ; +} diff --git a/test-suite/generated-src/java/com/dropbox/djinni/test/Constants.java b/test-suite/generated-src/java/com/dropbox/djinni/test/Constants.java index 079d8ecca..7563e0014 100644 --- a/test-suite/generated-src/java/com/dropbox/djinni/test/Constants.java +++ b/test-suite/generated-src/java/com/dropbox/djinni/test/Constants.java @@ -29,6 +29,9 @@ public class Constants { */ public static final double F64_CONSTANT = 5.0; + @Nonnull + public static final ConstantEnum CONST_ENUM = ConstantEnum.SOME_VALUE; + @CheckForNull public static final Boolean OPT_BOOL_CONSTANT = true; diff --git a/test-suite/generated-src/java/com/dropbox/djinni/test/ConstantsInterface.java b/test-suite/generated-src/java/com/dropbox/djinni/test/ConstantsInterface.java index 2c38a374f..8409a26c9 100644 --- a/test-suite/generated-src/java/com/dropbox/djinni/test/ConstantsInterface.java +++ b/test-suite/generated-src/java/com/dropbox/djinni/test/ConstantsInterface.java @@ -29,6 +29,9 @@ public abstract class ConstantsInterface { public static final double F64_CONSTANT = 5.0; + @Nonnull + public static final ConstantEnum CONST_ENUM = ConstantEnum.SOME_VALUE; + @CheckForNull public static final Boolean OPT_BOOL_CONSTANT = true; diff --git a/test-suite/generated-src/jni/NativeConstantEnum.hpp b/test-suite/generated-src/jni/NativeConstantEnum.hpp new file mode 100644 index 000000000..d86b708e8 --- /dev/null +++ b/test-suite/generated-src/jni/NativeConstantEnum.hpp @@ -0,0 +1,26 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file generated by Djinni from constants.djinni + +#pragma once + +#include "constant_enum.hpp" +#include "djinni_support.hpp" + +namespace djinni_generated { + +class NativeConstantEnum final : ::djinni::JniEnum { +public: + using CppType = ::testsuite::constant_enum; + using JniType = jobject; + + using Boxed = NativeConstantEnum; + + static CppType toCpp(JNIEnv* jniEnv, JniType j) { return static_cast(::djinni::JniClass::get().ordinal(jniEnv, j)); } + static ::djinni::LocalRef fromCpp(JNIEnv* jniEnv, CppType c) { return ::djinni::JniClass::get().create(jniEnv, static_cast(c)); } + +private: + NativeConstantEnum() : JniEnum("com/dropbox/djinni/test/ConstantEnum") {} + friend ::djinni::JniClass; +}; + +} // namespace djinni_generated diff --git a/test-suite/generated-src/jni/NativeConstantsInterface.cpp b/test-suite/generated-src/jni/NativeConstantsInterface.cpp index 9928944c1..fa47c455d 100644 --- a/test-suite/generated-src/jni/NativeConstantsInterface.cpp +++ b/test-suite/generated-src/jni/NativeConstantsInterface.cpp @@ -3,6 +3,7 @@ #include "NativeConstantsInterface.hpp" // my header #include "Marshal.hpp" +#include "NativeConstantEnum.hpp" #include "NativeConstantRecord.hpp" namespace djinni_generated { diff --git a/test-suite/generated-src/objc/DBConstantEnum+Private.h b/test-suite/generated-src/objc/DBConstantEnum+Private.h new file mode 100644 index 000000000..99cd33158 --- /dev/null +++ b/test-suite/generated-src/objc/DBConstantEnum+Private.h @@ -0,0 +1,6 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file generated by Djinni from constants.djinni + +#include "constant_enum.hpp" +#import "DJIMarshal+Private.h" + diff --git a/test-suite/generated-src/objc/DBConstantEnum.h b/test-suite/generated-src/objc/DBConstantEnum.h new file mode 100644 index 000000000..8492bc3b7 --- /dev/null +++ b/test-suite/generated-src/objc/DBConstantEnum.h @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file generated by Djinni from constants.djinni + +#import + +/** enum for use in constants */ +typedef NS_ENUM(NSInteger, DBConstantEnum) +{ + DBConstantEnumSomeValue, + DBConstantEnumSomeOtherValue, +}; diff --git a/test-suite/generated-src/objc/DBConstants+Private.mm b/test-suite/generated-src/objc/DBConstants+Private.mm index 154a203d2..2bd91bb74 100644 --- a/test-suite/generated-src/objc/DBConstants+Private.mm +++ b/test-suite/generated-src/objc/DBConstants+Private.mm @@ -2,6 +2,7 @@ // This file generated by Djinni from constants.djinni #import "DBConstants+Private.h" +#import "DBConstantEnum+Private.h" #import "DBConstantRecord+Private.h" #import "DJIMarshal+Private.h" #include diff --git a/test-suite/generated-src/objc/DBConstants.h b/test-suite/generated-src/objc/DBConstants.h index f29696d84..168c2a7d1 100644 --- a/test-suite/generated-src/objc/DBConstants.h +++ b/test-suite/generated-src/objc/DBConstants.h @@ -1,6 +1,7 @@ // AUTOGENERATED FILE - DO NOT MODIFY! // This file generated by Djinni from constants.djinni +#import "DBConstantEnum.h" #import "DBConstantRecord.h" #import @@ -9,6 +10,7 @@ - (nonnull instancetype)init; + (nonnull instancetype)constants; ++ (DBConstantEnum)constEnum; + (NSNumber * __nullable)optBoolConstant; + (NSNumber * __nullable)optI8Constant; /** opt_i16_constant has documentation. */ diff --git a/test-suite/generated-src/objc/DBConstants.mm b/test-suite/generated-src/objc/DBConstants.mm index fe0638de6..1967b4b9e 100644 --- a/test-suite/generated-src/objc/DBConstants.mm +++ b/test-suite/generated-src/objc/DBConstants.mm @@ -38,6 +38,12 @@ + (nonnull instancetype)constants return [[self alloc] init]; } ++ (DBConstantEnum)constEnum +{ + static DBConstantEnum const s_constEnum = DBConstantEnumSomeValue; + return s_constEnum; +} + + (NSNumber * __nullable)optBoolConstant { static NSNumber * const s_optBoolConstant = @YES; diff --git a/test-suite/generated-src/objc/DBConstantsInterface+Private.mm b/test-suite/generated-src/objc/DBConstantsInterface+Private.mm index f6e7db467..247db6d0d 100644 --- a/test-suite/generated-src/objc/DBConstantsInterface+Private.mm +++ b/test-suite/generated-src/objc/DBConstantsInterface+Private.mm @@ -3,6 +3,7 @@ #import "DBConstantsInterface+Private.h" #import "DBConstantsInterface.h" +#import "DBConstantEnum+Private.h" #import "DBConstantRecord+Private.h" #import "DJICppWrapperCache+Private.h" #import "DJIError.h" @@ -37,6 +38,12 @@ - (void)dummy { } DJINNI_TRANSLATE_EXCEPTIONS() } ++ (DBConstantEnum)constEnum +{ + static DBConstantEnum const s_constEnum = DBConstantEnumSomeValue; + return s_constEnum; +} + + (NSNumber * __nullable)optBoolConstant { static NSNumber * const s_optBoolConstant = @YES; diff --git a/test-suite/generated-src/objc/DBConstantsInterface.h b/test-suite/generated-src/objc/DBConstantsInterface.h index c8c86ca24..ebd28249c 100644 --- a/test-suite/generated-src/objc/DBConstantsInterface.h +++ b/test-suite/generated-src/objc/DBConstantsInterface.h @@ -1,6 +1,7 @@ // AUTOGENERATED FILE - DO NOT MODIFY! // This file generated by Djinni from constants.djinni +#import "DBConstantEnum.h" #import "DBConstantRecord.h" #import @@ -30,6 +31,7 @@ extern NSString * __nullable const DBConstantsInterfaceOptStringConstant; */ - (void)dummy; ++ (DBConstantEnum)constEnum; + (NSNumber * __nullable)optBoolConstant; + (NSNumber * __nullable)optI8Constant; /** opt_i16_constant has documentation. */ diff --git a/test-suite/generated-src/outFileList.txt b/test-suite/generated-src/outFileList.txt index a99741bc7..ee7bc9227 100644 --- a/test-suite/generated-src/outFileList.txt +++ b/test-suite/generated-src/outFileList.txt @@ -24,6 +24,7 @@ djinni-output-temp/cpp/second_listener.hpp djinni-output-temp/cpp/listener_caller.hpp djinni-output-temp/cpp/return_one.hpp djinni-output-temp/cpp/return_two.hpp +djinni-output-temp/cpp/constant_enum.hpp djinni-output-temp/cpp/constant_record.hpp djinni-output-temp/cpp/constants.hpp djinni-output-temp/cpp/constants.cpp @@ -73,6 +74,7 @@ djinni-output-temp/java/SecondListener.java djinni-output-temp/java/ListenerCaller.java djinni-output-temp/java/ReturnOne.java djinni-output-temp/java/ReturnTwo.java +djinni-output-temp/java/ConstantEnum.java djinni-output-temp/java/ConstantRecord.java djinni-output-temp/java/Constants.java djinni-output-temp/java/ConstantsInterface.java @@ -136,6 +138,7 @@ djinni-output-temp/jni/NativeReturnOne.hpp djinni-output-temp/jni/NativeReturnOne.cpp djinni-output-temp/jni/NativeReturnTwo.hpp djinni-output-temp/jni/NativeReturnTwo.cpp +djinni-output-temp/jni/NativeConstantEnum.hpp djinni-output-temp/jni/NativeConstantRecord.hpp djinni-output-temp/jni/NativeConstantRecord.cpp djinni-output-temp/jni/NativeConstants.hpp @@ -210,6 +213,7 @@ djinni-output-temp/objc/DBSecondListener.h djinni-output-temp/objc/DBListenerCaller.h djinni-output-temp/objc/DBReturnOne.h djinni-output-temp/objc/DBReturnTwo.h +djinni-output-temp/objc/DBConstantEnum.h djinni-output-temp/objc/DBConstantRecord.h djinni-output-temp/objc/DBConstantRecord.mm djinni-output-temp/objc/DBConstants.h @@ -287,6 +291,7 @@ djinni-output-temp/objc/DBReturnOne+Private.h djinni-output-temp/objc/DBReturnOne+Private.mm djinni-output-temp/objc/DBReturnTwo+Private.h djinni-output-temp/objc/DBReturnTwo+Private.mm +djinni-output-temp/objc/DBConstantEnum+Private.h djinni-output-temp/objc/DBConstantRecord+Private.h djinni-output-temp/objc/DBConstantRecord+Private.mm djinni-output-temp/objc/DBConstants+Private.h diff --git a/test-suite/objc/DjinniObjcTest.xcodeproj/project.pbxproj b/test-suite/objc/DjinniObjcTest.xcodeproj/project.pbxproj index 36b34b027..2e7cac57c 100644 --- a/test-suite/objc/DjinniObjcTest.xcodeproj/project.pbxproj +++ b/test-suite/objc/DjinniObjcTest.xcodeproj/project.pbxproj @@ -438,6 +438,9 @@ CFFD58B01B041BD9001E10B6 /* DBConstantsInterface+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBConstantsInterface+Private.mm"; sourceTree = ""; }; CFFD58B51B041BFD001E10B6 /* constants_interface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = constants_interface.cpp; sourceTree = ""; }; CFFD58B61B041BFD001E10B6 /* constants_interface.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = constants_interface.hpp; sourceTree = ""; }; + FAB1E3382024112400B8E3CC /* constant_enum.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = constant_enum.hpp; sourceTree = ""; }; + FAB1E3392024115900B8E3CC /* DBConstantEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBConstantEnum.h; sourceTree = ""; }; + FAB1E33A2024115900B8E3CC /* DBConstantEnum+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBConstantEnum+Private.h"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -593,6 +596,8 @@ B5F06A711D4973BD005BE736 /* DBConflictUser.h */, B5F06A721D4973BD005BE736 /* DBConflictUser+Private.h */, B5F06A731D4973BD005BE736 /* DBConflictUser+Private.mm */, + FAB1E3392024115900B8E3CC /* DBConstantEnum.h */, + FAB1E33A2024115900B8E3CC /* DBConstantEnum+Private.h */, B5D8FC321C23E2F40045ADCF /* DBConstantRecord.h */, B5D8FC331C23E2F40045ADCF /* DBConstantRecord.mm */, B5D8FC341C23E2F40045ADCF /* DBConstantRecord+Private.h */, @@ -748,31 +753,18 @@ A242495D1AF192FC003BF8F0 /* generated-cpp */ = { isa = PBXGroup; children = ( - B58B16B21D5AD55B00EF92B5 /* record_using_extended_record.cpp */, - B58B16B31D5AD55B00EF92B5 /* interface_using_extended_record.cpp */, - B58B16A61D5AC9AD00EF92B5 /* record_using_extended_record.hpp */, - B58B16A71D5AC9AD00EF92B5 /* interface_using_extended_record.hpp */, - B51911471D555EDC00772DFE /* _varname_record_.hpp */, B51911481D555EDC00772DFE /* _varname_interface_.hpp */, - B51911191D542AEC00772DFE /* wchar_test_helpers.hpp */, - B5153F871D54282C00012654 /* wchar_test_rec.hpp */, - B5F06A9B1D4987C7005BE736 /* enum_usage_interface.hpp */, - B5F06A9C1D4987C7005BE736 /* enum_usage_record.hpp */, - B5F06A651D497396005BE736 /* conflict_user.hpp */, - B5F06A661D497396005BE736 /* Conflict.hpp */, - B5F06A681D497396005BE736 /* extended_record_base.cpp */, - B5F06A691D497396005BE736 /* extended_record_base.hpp */, - B5F06A6A1D497396005BE736 /* java_only_listener.hpp */, - B5F06A6B1D497396005BE736 /* objc_only_listener.hpp */, - B5F06A6C1D497396005BE736 /* uses_single_language_listeners.hpp */, + B51911471D555EDC00772DFE /* _varname_record_.hpp */, CFBBB8ED1B6E3A72002EF52F /* access_flags.hpp */, - B5D8FC381C23E30D0045ADCF /* constant_record.hpp */, - B5E9C93C1C1F9DCA0073C123 /* reverse_client_interface.hpp */, B52DA56C1B103FBE005CE75F /* assorted_primitives.cpp */, B52DA56D1B103FBE005CE75F /* assorted_primitives.hpp */, A24249601AF192FC003BF8F0 /* client_interface.hpp */, A24249611AF192FC003BF8F0 /* client_returned_record.hpp */, A24249621AF192FC003BF8F0 /* color.hpp */, + B5F06A651D497396005BE736 /* conflict_user.hpp */, + B5F06A661D497396005BE736 /* Conflict.hpp */, + FAB1E3382024112400B8E3CC /* constant_enum.hpp */, + B5D8FC381C23E30D0045ADCF /* constant_record.hpp */, CFFD58B51B041BFD001E10B6 /* constants_interface.cpp */, CFFD58B61B041BFD001E10B6 /* constants_interface.hpp */, A24249631AF192FC003BF8F0 /* constants.cpp */, @@ -782,18 +774,28 @@ A24249661AF192FC003BF8F0 /* date_record.hpp */, CFBBB8E71B6E3747002EF52F /* empty_flags.hpp */, CFAED8771B54292600E3B8A3 /* empty_record.hpp */, + B5F06A9B1D4987C7005BE736 /* enum_usage_interface.hpp */, + B5F06A9C1D4987C7005BE736 /* enum_usage_record.hpp */, + B5F06A681D497396005BE736 /* extended_record_base.cpp */, + B5F06A691D497396005BE736 /* extended_record_base.hpp */, CFC5D9E01B1513D800BF2DF8 /* extern_interface_1.hpp */, CFC5D9E11B1513D800BF2DF8 /* extern_interface_2.hpp */, CFC5D9CE1B15105100BF2DF8 /* extern_record_with_derivings.cpp */, CFC5D9CF1B15105100BF2DF8 /* extern_record_with_derivings.hpp */, 6551683A1C404B58003682A4 /* first_listener.hpp */, CFBBB8F41B6EF0A0002EF52F /* flag_roundtrip.hpp */, + B58B16B31D5AD55B00EF92B5 /* interface_using_extended_record.cpp */, + B58B16A71D5AC9AD00EF92B5 /* interface_using_extended_record.hpp */, + B5F06A6A1D497396005BE736 /* java_only_listener.hpp */, 650CA04E1C2AB460007ADDDB /* listener_caller.hpp */, A24249671AF192FC003BF8F0 /* map_date_record.hpp */, A24249681AF192FC003BF8F0 /* map_list_record.hpp */, A24249691AF192FC003BF8F0 /* map_record.hpp */, A242496A1AF192FC003BF8F0 /* nested_collection.hpp */, + B5F06A6B1D497396005BE736 /* objc_only_listener.hpp */, A242496B1AF192FC003BF8F0 /* primitive_list.hpp */, + B58B16B21D5AD55B00EF92B5 /* record_using_extended_record.cpp */, + B58B16A61D5AC9AD00EF92B5 /* record_using_extended_record.hpp */, A242496C1AF192FC003BF8F0 /* record_with_derivings.cpp */, A242496D1AF192FC003BF8F0 /* record_with_derivings.hpp */, CFC5DA0C1B15330000BF2DF8 /* record_with_duration_and_derivings.cpp */, @@ -803,11 +805,15 @@ A242496F1AF192FC003BF8F0 /* record_with_nested_derivings.hpp */, 655168441C40508A003682A4 /* return_one.hpp */, 655168451C40508A003682A4 /* return_two.hpp */, + B5E9C93C1C1F9DCA0073C123 /* reverse_client_interface.hpp */, 6551683B1C404B58003682A4 /* second_listener.hpp */, A24249701AF192FC003BF8F0 /* set_record.hpp */, CFC5DA031B15319600BF2DF8 /* test_duration.hpp */, A24249711AF192FC003BF8F0 /* test_helpers.hpp */, A24249721AF192FC003BF8F0 /* user_token.hpp */, + B5F06A6C1D497396005BE736 /* uses_single_language_listeners.hpp */, + B51911191D542AEC00772DFE /* wchar_test_helpers.hpp */, + B5153F871D54282C00012654 /* wchar_test_rec.hpp */, ); name = "generated-cpp"; path = "../generated-src/cpp";