OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package main | 5 package main |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 "go/ast" | 9 "go/ast" |
10 "go/printer" | 10 "go/printer" |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 ` | 561 ` |
562 | 562 |
563 const cProlog = ` | 563 const cProlog = ` |
564 #include "runtime.h" | 564 #include "runtime.h" |
565 #include "cgocall.h" | 565 #include "cgocall.h" |
566 | 566 |
567 #pragma dynimport initcgo initcgo "%s/libcgo.so" | 567 #pragma dynimport initcgo initcgo "%s/libcgo.so" |
568 #pragma dynimport libcgo_thread_start libcgo_thread_start "%s/libcgo.so" | 568 #pragma dynimport libcgo_thread_start libcgo_thread_start "%s/libcgo.so" |
569 #pragma dynimport libcgo_set_scheduler libcgo_set_scheduler "%s/libcgo.so" | 569 #pragma dynimport libcgo_set_scheduler libcgo_set_scheduler "%s/libcgo.so" |
570 #pragma dynimport _cgo_malloc _cgo_malloc "%s/libcgo.so" | 570 #pragma dynimport _cgo_malloc _cgo_malloc "%s/libcgo.so" |
571 #pragma dynimport _cgo_free free "%s/libcgo.so" | 571 #pragma dynimport _cgo_free _cgo_free "%s/libcgo.so" |
572 | 572 |
573 void | 573 void |
574 ·_C_GoString(int8 *p, String s) | 574 ·_C_GoString(int8 *p, String s) |
575 { | 575 { |
576 s = gostring((byte*)p); | 576 s = gostring((byte*)p); |
577 FLUSH(&s); | 577 FLUSH(&s); |
578 } | 578 } |
579 | 579 |
580 void | 580 void |
581 ·_C_CString(String s, int8 *p) | 581 ·_C_CString(String s, int8 *p) |
(...skipping 11 matching lines...) Expand all Loading... |
593 typedef unsigned char uchar; | 593 typedef unsigned char uchar; |
594 typedef unsigned short ushort; | 594 typedef unsigned short ushort; |
595 typedef long long int64; | 595 typedef long long int64; |
596 typedef unsigned long long uint64; | 596 typedef unsigned long long uint64; |
597 | 597 |
598 typedef struct { char *p; int n; } GoString; | 598 typedef struct { char *p; int n; } GoString; |
599 typedef void *GoMap; | 599 typedef void *GoMap; |
600 typedef void *GoChan; | 600 typedef void *GoChan; |
601 typedef struct { void *t; void *v; } GoInterface; | 601 typedef struct { void *t; void *v; } GoInterface; |
602 ` | 602 ` |
OLD | NEW |