2015-06-05 15:24:08 -04:00
|
|
|
// Objective-C API for talking to basictypes Go package.
|
|
|
|
// gobind -lang=objc basictypes
|
|
|
|
//
|
|
|
|
// File is generated by gobind. Do not edit.
|
|
|
|
|
|
|
|
#ifndef __GoBasictypes_H__
|
|
|
|
#define __GoBasictypes_H__
|
|
|
|
|
2015-07-16 09:05:28 -04:00
|
|
|
#include <Foundation/Foundation.h>
|
mobile/bind: use objects to pass errors across the language barrier
Gobind uses strings for passing errors across the language barrier.
However, since Gobind doesn't have a concept of a nil string, it
can't separate an empty native string from a nil string.
In turn, that means that empty errors, exceptions or NSError * with
an empty description are treated as no error. With ObjC, empty errors
are replaced with a default string to workaround the issue, while
with Java empty errors are silently ignored.
Fix this by replacing strings with actual error objects, wrapping
the Go error, Java Throwable or ObjC NSError *, and letting the
existing bind machinery take care of passing the references across.
It's a large change for a small corner case, but I believe objects
are a better fit for exception that strings. Error objects also
naturally leads to future additions, for example accessing the
exception class name or chained exception.
Change-Id: Ie03b47cafcb231ad1e12a80195693fa7459c6265
Reviewed-on: https://go-review.googlesource.com/24100
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-14 11:58:31 +02:00
|
|
|
#include "GoUniverse.h"
|
2015-06-05 15:24:08 -04:00
|
|
|
|
2015-09-28 15:08:01 -04:00
|
|
|
FOUNDATION_EXPORT const BOOL GoBasictypesABool;
|
|
|
|
FOUNDATION_EXPORT const double GoBasictypesAFloat;
|
2016-03-06 14:55:37 +01:00
|
|
|
FOUNDATION_EXPORT NSString* const GoBasictypesALongString;
|
2015-09-28 15:08:01 -04:00
|
|
|
FOUNDATION_EXPORT const int32_t GoBasictypesARune;
|
|
|
|
FOUNDATION_EXPORT NSString* const GoBasictypesAString;
|
|
|
|
FOUNDATION_EXPORT const int64_t GoBasictypesAnInt;
|
|
|
|
FOUNDATION_EXPORT const int64_t GoBasictypesAnInt2;
|
|
|
|
|
2015-07-06 11:55:50 -04:00
|
|
|
FOUNDATION_EXPORT BOOL GoBasictypesBool(BOOL p0);
|
2015-06-05 15:24:08 -04:00
|
|
|
|
2015-07-06 11:55:50 -04:00
|
|
|
FOUNDATION_EXPORT NSData* GoBasictypesByteArrays(NSData* x);
|
2015-06-05 15:24:08 -04:00
|
|
|
|
2015-07-06 11:55:50 -04:00
|
|
|
FOUNDATION_EXPORT BOOL GoBasictypesError(NSError** error);
|
2015-06-05 15:24:08 -04:00
|
|
|
|
2016-07-07 11:44:39 -04:00
|
|
|
FOUNDATION_EXPORT BOOL GoBasictypesErrorPair(long* ret0_, NSError** error);
|
2015-06-05 15:24:08 -04:00
|
|
|
|
2016-07-07 11:44:39 -04:00
|
|
|
FOUNDATION_EXPORT void GoBasictypesInts(int8_t x, int16_t y, int32_t z, int64_t t, long u);
|
2015-06-05 15:24:08 -04:00
|
|
|
|
|
|
|
#endif
|