Commit 0832f814 authored by j4cbo's avatar j4cbo

Merge pull request #17 from skabbes/fix/assert_arc

static_assert that ARC is enabled
parents f6e2a81d 28a34a25
......@@ -5,6 +5,7 @@
#import <Foundation/Foundation.h>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation TXSItemList
......
......@@ -9,6 +9,8 @@
#include <exception>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation TXSSortItemsCppProxy
- (id)initWithCpp:(const std::shared_ptr<::textsort::SortItems> &)cppRef
......
......@@ -99,6 +99,8 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
})
writeObjcFile(enumTranslatorName(ident), origin, refs.body, w => {
w.wl(s"static_assert(__has_feature(objc_arc), " + q("Djinni requires ARC to be enabled for this file") + ");" )
w.wl
w.wl(s"@implementation " + self + "Translator")
w.wl
w.wl(s"+ ($self)cpp${name}ToObjc${name}:($cppSelf)${argName}")
......@@ -251,6 +253,8 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
})
writeObjcFile(bodyName(cppExtName), origin, refs.body, w => {
w.wl(s"static_assert(__has_feature(objc_arc), " + q("Djinni requires ARC to be enabled for this file") + ");" )
w.wl
w.wl(s"@implementation $cppExtSelf")
w.wl
w.wl(s"- (id)initWithCpp:(const std::shared_ptr<$cppName> &)cppRef")
......@@ -443,6 +447,7 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
writeObjcFile(bodyName(objcName), origin, refs.body, w => {
if (r.consts.nonEmpty) generateObjcConstants(w, r.consts, noBaseSelf)
w.wl(s"static_assert(__has_feature(objc_arc), " + q("Djinni requires ARC to be enabled for this file") + ");" )
w.wl
w.wl(s"@implementation $self")
w.wl
......
......@@ -5,6 +5,7 @@
#import <Foundation/Foundation.h>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBClientReturnedRecord
......
......@@ -7,6 +7,8 @@
#include <exception>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBCppExceptionCppProxy
- (id)initWithCpp:(const std::shared_ptr<CppException> &)cppRef
......
......@@ -5,6 +5,7 @@
#import <Foundation/Foundation.h>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBMapListRecord
......
......@@ -5,6 +5,7 @@
#import <Foundation/Foundation.h>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBMapRecord
......
......@@ -5,6 +5,7 @@
#import <Foundation/Foundation.h>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBNestedCollection
......
......@@ -5,6 +5,7 @@
#import <Foundation/Foundation.h>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBPrimitiveList
......
......@@ -5,6 +5,7 @@
#import <Foundation/Foundation.h>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBRecordWithDerivings
......
......@@ -6,6 +6,7 @@
#import <Foundation/Foundation.h>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBRecordWithNestedDerivings
......
......@@ -5,6 +5,7 @@
#import <Foundation/Foundation.h>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBSetRecord
......
......@@ -11,6 +11,8 @@
#include <exception>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBTestHelpersCppProxy
- (id)initWithCpp:(const std::shared_ptr<TestHelpers> &)cppRef
......
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