Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
djinni
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
djinni
Commits
143fb84c
Commit
143fb84c
authored
Sep 15, 2015
by
Jacob Potter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assorted small fixes/cleanups
parent
805c1eda
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
6 deletions
+7
-6
src/source/ObjcppGenerator.scala
src/source/ObjcppGenerator.scala
+2
-4
support-lib/jni/djinni_support.cpp
support-lib/jni/djinni_support.cpp
+0
-1
test-suite/djinni/constants.djinni
test-suite/djinni/constants.djinni
+1
-0
test-suite/generated-src/cpp/constants.hpp
test-suite/generated-src/cpp/constants.hpp
+1
-0
test-suite/generated-src/java/com/dropbox/djinni/test/Constants.java
...generated-src/java/com/dropbox/djinni/test/Constants.java
+1
-0
test-suite/generated-src/objc/DBConstants.h
test-suite/generated-src/objc/DBConstants.h
+1
-0
test-suite/handwritten-src/java/com/dropbox/djinni/test/AllTests.java
...andwritten-src/java/com/dropbox/djinni/test/AllTests.java
+1
-1
No files found.
src/source/ObjcppGenerator.scala
View file @
143fb84c
...
@@ -20,11 +20,9 @@ import djinni.ast.Record.DerivingType
...
@@ -20,11 +20,9 @@ import djinni.ast.Record.DerivingType
import
djinni.ast._
import
djinni.ast._
import
djinni.generatorTools._
import
djinni.generatorTools._
import
djinni.meta._
import
djinni.meta._
import
djinni.syntax.Error
import
djinni.writer.IndentWriter
import
djinni.writer.IndentWriter
import
scala.collection.mutable
import
scala.collection.mutable
import
scala.collection.parallel.immutable
class
ObjcppGenerator
(
spec
:
Spec
)
extends
Generator
(
spec
)
{
class
ObjcppGenerator
(
spec
:
Spec
)
extends
Generator
(
spec
)
{
...
@@ -229,7 +227,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
...
@@ -229,7 +227,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
if
(
i
.
ext
.
objc
)
{
if
(
i
.
ext
.
objc
)
{
// If it could be implemented in ObjC, we might have to unwrap a proxy object.
// If it could be implemented in ObjC, we might have to unwrap a proxy object.
val
objcExtSelf
=
objcppMarshal
.
helperClass
(
"objc_proxy"
)
val
objcExtSelf
=
objcppMarshal
.
helperClass
(
"objc_proxy"
)
w
.
w
(
s
"if (auto cppPtr = dynamic_cast<$
{objcExtSelf}
*>(cpp.get()))"
).
braced
{
w
.
w
(
s
"if (auto cppPtr = dynamic_cast<$
objcExtSelf
*>(cpp.get()))"
).
braced
{
w
.
wl
(
"return cppPtr->Handle::get();"
)
w
.
wl
(
"return cppPtr->Handle::get();"
)
}
}
}
}
...
@@ -277,7 +275,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
...
@@ -277,7 +275,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
w
.
wl
(
s
"struct $helperClass"
)
w
.
wl
(
s
"struct $helperClass"
)
w
.
bracedSemi
{
w
.
bracedSemi
{
w
.
wl
(
s
"using CppType = $cppSelf;"
)
w
.
wl
(
s
"using CppType = $cppSelf;"
)
w
.
wl
(
s
"using ObjcType = $noBaseSelf*;"
)
;
w
.
wl
(
s
"using ObjcType = $noBaseSelf*;"
)
w
.
wl
w
.
wl
w
.
wl
(
s
"using Boxed = $helperClass;"
)
w
.
wl
(
s
"using Boxed = $helperClass;"
)
w
.
wl
w
.
wl
...
...
support-lib/jni/djinni_support.cpp
View file @
143fb84c
...
@@ -174,7 +174,6 @@ void jniThrowAssertionError(JNIEnv * env, const char * file, int line, const cha
...
@@ -174,7 +174,6 @@ void jniThrowAssertionError(JNIEnv * env, const char * file, int line, const cha
env
->
ExceptionClear
();
env
->
ExceptionClear
();
env
->
DeleteLocalRef
(
cassert
);
env
->
DeleteLocalRef
(
cassert
);
env
->
DeleteLocalRef
(
e
);
jniThrowCppFromJavaException
(
env
,
e
);
jniThrowCppFromJavaException
(
env
,
e
);
}
}
...
...
test-suite/djinni/constants.djinni
View file @
143fb84c
# Record containing constants
constants = record {
constants = record {
some_integer: i32;
some_integer: i32;
some_string: string;
some_string: string;
...
...
test-suite/generated-src/cpp/constants.hpp
View file @
143fb84c
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include <string>
#include <string>
#include <utility>
#include <utility>
/** Record containing constants */
struct
Constants
final
{
struct
Constants
final
{
/** bool_constant has documentation. */
/** bool_constant has documentation. */
...
...
test-suite/generated-src/java/com/dropbox/djinni/test/Constants.java
View file @
143fb84c
...
@@ -6,6 +6,7 @@ package com.dropbox.djinni.test;
...
@@ -6,6 +6,7 @@ package com.dropbox.djinni.test;
import
javax.annotation.CheckForNull
;
import
javax.annotation.CheckForNull
;
import
javax.annotation.Nonnull
;
import
javax.annotation.Nonnull
;
/** Record containing constants */
public
final
class
Constants
{
public
final
class
Constants
{
/** bool_constant has documentation. */
/** bool_constant has documentation. */
...
...
test-suite/generated-src/objc/DBConstants.h
View file @
143fb84c
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#import "DBConstants.h"
#import "DBConstants.h"
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
/** Record containing constants */
@interface
DBConstants
:
NSObject
@interface
DBConstants
:
NSObject
-
(
nonnull
instancetype
)
initWithSomeInteger
:(
int32_t
)
someInteger
-
(
nonnull
instancetype
)
initWithSomeInteger
:(
int32_t
)
someInteger
someString
:(
nonnull
NSString
*
)
someString
;
someString
:(
nonnull
NSString
*
)
someString
;
...
...
test-suite/handwritten-src/java/com/dropbox/djinni/test/AllTests.java
View file @
143fb84c
...
@@ -17,7 +17,7 @@ public class AllTests extends TestSuite {
...
@@ -17,7 +17,7 @@ public class AllTests extends TestSuite {
mySuite
.
addTestSuite
(
EnumTest
.
class
);
mySuite
.
addTestSuite
(
EnumTest
.
class
);
mySuite
.
addTestSuite
(
PrimitivesTest
.
class
);
mySuite
.
addTestSuite
(
PrimitivesTest
.
class
);
mySuite
.
addTestSuite
(
TokenTest
.
class
);
mySuite
.
addTestSuite
(
TokenTest
.
class
);
mySuite
.
addTestSuite
(
DurationTest
.
class
);
mySuite
.
addTestSuite
(
DurationTest
.
class
);
return
mySuite
;
return
mySuite
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment