bind: always include ref.h in generated ObjC headers
Current generated headers work because they require `ref.h` to be loaded beforehand by the bridging header. However, in some cases where the bridging header is generated by another tool (such as Bazel), the order can't be guaranteed. Fix that by explicitly importing `ref.h` in the headers that need it. Change-Id: I444453a0ebdf53e14ba1b5290f7cc7084eaf2c07 GitHub-Last-Rev: e1e1e915bf0428d871cb1a268c8456cf7051d383 GitHub-Pull-Request: golang/mobile#28 Reviewed-on: https://go-review.googlesource.com/c/159758 Reviewed-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
parent
feefccb6c1
commit
a421117049
|
@ -149,6 +149,7 @@ func (g *ObjcGen) GenH() error {
|
|||
for _, m := range g.modules {
|
||||
g.Printf("@import %s;\n", m)
|
||||
}
|
||||
g.Printf("#include \"ref.h\"\n")
|
||||
if g.Pkg != nil {
|
||||
g.Printf("#include \"Universe.objc.h\"\n\n")
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Basictypes_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Customprefix_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __EXCustomprefix_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Doc_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Ignore_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Interfaces_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Issue10788_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Issue12328_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Issue12403_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Issue29559_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Keywords_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Structs_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Try_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Underscore_pkg_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Universe_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
|
||||
@protocol Universeerror;
|
||||
@class Universeerror;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define __Vars_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue