Commit 32c36c28 authored by Aleksey Konovalov's avatar Aleksey Konovalov

fix #262

parent b753eff6
...@@ -375,9 +375,16 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -375,9 +375,16 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
w.wl("// This file generated by Djinni from " + origin) w.wl("// This file generated by Djinni from " + origin)
w.wl w.wl
if (refs.nonEmpty) { if (refs.nonEmpty) {
// Ignore the ! in front of each line; used to put own headers to the top var included = mutable.TreeSet[String]();
// according to Objective-C style guide for (s <- refs) {
refs.foreach(s => w.wl(if (s.charAt(0) == '!') s.substring(1) else s)) // Ignore the ! in front of each line; used to put own headers to the top
// according to Objective-C style guide
val include = if (s.charAt(0) == '!') s.substring(1) else s
if (!included.contains(include)) {
included += include
w.wl(include)
}
}
w.wl w.wl
} }
f(w) f(w)
......
...@@ -309,7 +309,9 @@ abstract class Generator(spec: Spec) ...@@ -309,7 +309,9 @@ abstract class Generator(spec: Spec)
w.wl w.wl
val myHeader = q(includePrefix + fileIdentStyle(name) + "." + spec.cppHeaderExt) val myHeader = q(includePrefix + fileIdentStyle(name) + "." + spec.cppHeaderExt)
w.wl(s"#include $myHeader // my header") w.wl(s"#include $myHeader // my header")
includes.foreach(w.wl(_)) val myHeaderInclude = s"#include $myHeader"
for (include <- includes if include != myHeaderInclude)
w.wl(include)
w.wl w.wl
wrapNamespace(w, namespace, f) wrapNamespace(w, namespace, f)
}) })
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeClientInterface.hpp" // my header #include "NativeClientInterface.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeClientInterface.hpp"
#include "NativeClientReturnedRecord.hpp" #include "NativeClientReturnedRecord.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeCppException.hpp" // my header #include "NativeCppException.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeCppException.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeListenerCaller.hpp" // my header #include "NativeListenerCaller.hpp" // my header
#include "NativeFirstListener.hpp" #include "NativeFirstListener.hpp"
#include "NativeListenerCaller.hpp"
#include "NativeSecondListener.hpp" #include "NativeSecondListener.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeReturnOne.hpp" // my header #include "NativeReturnOne.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeReturnOne.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeReturnTwo.hpp" // my header #include "NativeReturnTwo.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeReturnTwo.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeReverseClientInterface.hpp" // my header #include "NativeReverseClientInterface.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeReverseClientInterface.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import "DBClientInterface+Private.h" #import "DBClientInterface+Private.h"
#import "DBClientInterface.h" #import "DBClientInterface.h"
#import "DBClientInterface+Private.h"
#import "DBClientReturnedRecord+Private.h" #import "DBClientReturnedRecord+Private.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#import "DJIObjcWrapperCache+Private.h" #import "DJIObjcWrapperCache+Private.h"
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import "DBCppException+Private.h" #import "DBCppException+Private.h"
#import "DBCppException.h" #import "DBCppException.h"
#import "DBCppException+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni // This file generated by Djinni from extended_record.djinni
#import "DBExtendedRecord+Private.h"
#import "DBExtendedRecord+Private.h" #import "DBExtendedRecord+Private.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#include <cassert> #include <cassert>
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#import "DBListenerCaller+Private.h" #import "DBListenerCaller+Private.h"
#import "DBListenerCaller.h" #import "DBListenerCaller.h"
#import "DBFirstListener+Private.h" #import "DBFirstListener+Private.h"
#import "DBListenerCaller+Private.h"
#import "DBSecondListener+Private.h" #import "DBSecondListener+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import "DBReturnOne+Private.h" #import "DBReturnOne+Private.h"
#import "DBReturnOne.h" #import "DBReturnOne.h"
#import "DBReturnOne+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import "DBReturnTwo+Private.h" #import "DBReturnTwo+Private.h"
#import "DBReturnTwo.h" #import "DBReturnTwo.h"
#import "DBReturnTwo+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import "DBReverseClientInterface+Private.h" #import "DBReverseClientInterface+Private.h"
#import "DBReverseClientInterface.h" #import "DBReverseClientInterface.h"
#import "DBReverseClientInterface+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment