--- /dev/null
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "_cgo_export.h"
+
+int get8148(void) {
+ T t;
+ t.i = 42;
+ return issue8148Callback(&t);
+}
--- /dev/null
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "_cgo_export.h"
+
+void lockOSThreadC(void) {
+ lockOSThreadCallback();
+}
+
+void issue7978c(uint32_t *sync) {
+ while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 0)
+ ;
+ __atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
+ while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 2)
+ ;
+ issue7978cb();
+ __atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
+ while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 6)
+ ;
+}
+
+void f7665(void) {
+}
extern void doAdd(int, int);
// issue 1328
-extern void BackIntoGo(void);
void IntoC(void);
// issue 1560
long long twoSleep(int);
// issue 3775
-void lockOSThreadCallback(void);
-inline static void lockOSThreadC(void)
-{
- lockOSThreadCallback();
-}
+void lockOSThreadC(void);
int usleep(unsigned usec);
// issue 4054 part 2 - part 1 in test.go
#include <stdint.h>
-void issue7978cb(void);
-
// use ugly atomic variable sync since that doesn't require calling back into
// Go code or OS dependencies
-static void issue7978c(uint32_t *sync) {
- while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 0)
- ;
- __atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
- while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 2)
- ;
- issue7978cb();
- __atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
- while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 6)
- ;
-}
+void issue7978c(uint32_t *sync);
// issue 8331 part 2 - part 1 in test.go
// A typedef of an unnamed struct is the same struct when
// issue 7665
-//export f7665
-func f7665() {}
-
var bad7665 unsafe.Pointer = C.f7665
var good7665 uintptr = uintptr(C.f7665)