https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/Major64-BitChanges/Major64-BitChanges.html Fixes golang/go#16182 Change-Id: I312749e8a7113bf9231eb3896f801e450f46a410 Reviewed-on: https://go-review.googlesource.com/24792 Reviewed-by: Elias Naur <elias.naur@gmail.com>
85 lines
2.8 KiB
Plaintext
85 lines
2.8 KiB
Plaintext
// Objective-C API for talking to basictypes Go package.
|
|
// gobind -lang=objc basictypes
|
|
//
|
|
// File is generated by gobind. Do not edit.
|
|
|
|
#include <Foundation/Foundation.h>
|
|
#include "seq.h"
|
|
#include "_cgo_export.h"
|
|
#include "GoBasictypes.h"
|
|
|
|
static NSString* errDomain = @"go.basictypes";
|
|
|
|
const BOOL GoBasictypesABool = YES;
|
|
const double GoBasictypesAFloat = 0.2015;
|
|
NSString* const GoBasictypesALongString = @"LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString";
|
|
const int32_t GoBasictypesARune = 32;
|
|
NSString* const GoBasictypesAString = @"a string";
|
|
const int64_t GoBasictypesAnInt = 7LL;
|
|
const int64_t GoBasictypesAnInt2 = 9223372036854775807LL;
|
|
|
|
|
|
BOOL GoBasictypesBool(BOOL p0) {
|
|
char _p0 = (char)p0;
|
|
char r0 = proxybasictypes__Bool(_p0);
|
|
BOOL _ret0_ = r0 ? YES : NO;
|
|
return _ret0_;
|
|
}
|
|
|
|
NSData* GoBasictypesByteArrays(NSData* x) {
|
|
nbyteslice _x = go_seq_from_objc_bytearray(x, 0);
|
|
nbyteslice r0 = proxybasictypes__ByteArrays(_x);
|
|
if (![x isKindOfClass:[NSMutableData class]]) {
|
|
free(_x.ptr);
|
|
}
|
|
NSData *_ret0_ = go_seq_to_objc_bytearray(r0, 1);
|
|
return _ret0_;
|
|
}
|
|
|
|
BOOL GoBasictypesError(NSError** error) {
|
|
int32_t r0 = proxybasictypes__Error();
|
|
GoUniverseerror* _error = nil;
|
|
GoSeqRef* _error_ref = go_seq_from_refnum(r0);
|
|
if (_error_ref != NULL) {
|
|
_error = _error_ref.obj;
|
|
if (_error == nil) {
|
|
_error = [[GoUniverseerror alloc] initWithRef:_error_ref];
|
|
}
|
|
}
|
|
if (_error != nil && error != nil) {
|
|
*error = go_seq_to_nserror(_error, errDomain);
|
|
}
|
|
return (_error == nil);
|
|
}
|
|
|
|
BOOL GoBasictypesErrorPair(long* ret0_, NSError** error) {
|
|
struct proxybasictypes__ErrorPair_return res = proxybasictypes__ErrorPair();
|
|
long _ret0_ = (long)res.r0;
|
|
GoUniverseerror* _error = nil;
|
|
GoSeqRef* _error_ref = go_seq_from_refnum(res.r1);
|
|
if (_error_ref != NULL) {
|
|
_error = _error_ref.obj;
|
|
if (_error == nil) {
|
|
_error = [[GoUniverseerror alloc] initWithRef:_error_ref];
|
|
}
|
|
}
|
|
*ret0_ = _ret0_;
|
|
if (_error != nil && error != nil) {
|
|
*error = go_seq_to_nserror(_error, errDomain);
|
|
}
|
|
return (_error == nil);
|
|
}
|
|
|
|
void GoBasictypesInts(int8_t x, int16_t y, int32_t z, int64_t t, long u) {
|
|
int8_t _x = (int8_t)x;
|
|
int16_t _y = (int16_t)y;
|
|
int32_t _z = (int32_t)z;
|
|
int64_t _t = (int64_t)t;
|
|
nint _u = (nint)u;
|
|
proxybasictypes__Ints(_x, _y, _z, _t, _u);
|
|
}
|
|
|
|
__attribute__((constructor)) static void init() {
|
|
init_seq();
|
|
}
|