$go get github.com/jmhodges/levigo
the console give the resutl as flow:
github.com/jmhodges/levigo
gcc did not produce error at completed:1
on input:
line 3 "/Users/jeff/projects/gocode/src/github.com/jmhodges/levigo/db.go"
include <stdlib.h>
include "leveldb/c.h"
// This function exists only to clean up lack-of-const warnings when
// leveldb_approximate_sizes is called from Go-land.
void levigo_leveldb_approximate_sizes(
leveldb_t* db,
int num_ranges,
char** range_start_key, const size_t* range_start_key_len,
char** range_limit_key, const size_t* range_limit_key_len,
uint64_t* sizes) {
leveldb_approximate_sizes(db,
num_ranges,
(const char* const_)range_start_key,
range_start_key_len,
(const char_ const*)range_limit_key,
range_limit_key_len,
sizes);
}
include <sys/types.h> /* for size_t below */
/* Define intgo when compiling with GCC. */
ifdef PTRDIFF_TYPE
typedef PTRDIFF_TYPE intgo;
elif defined(_LP64)
typedef long long intgo;
else
typedef int intgo;
endif
typedef struct { char *p; intgo n; } GoString;
typedef struct { char *p; intgo n; intgo c; } GoBytes;
GoString GoString(char *p);
GoString GoStringN(char *p, int l);
GoBytes GoBytes(void *p, int n);
char *CString(GoString);
void *_CMalloc(size_t);
line 1 "not-declared"
void cgo_f_1_1(void) { __typeof(int) *cgo_undefined; }
line 1 "not-type"
void *cgo_f_1_2(void) { int __cgo_undefined; }
line 1 "not-const"
void cgo_f_1_3(void) { enum { __cgo__undefined = (int)*1 }; }
line 2 "not-declared"
void cgo_f_2_1(void) { __typeof(leveldb_create_iterator) *cgo_undefined; }
line 2 "not-type"
void *cgo_f_2_2(void) { leveldb_create_iterator __cgo_undefined; }
line 2 "not-const"
void cgo_f_2_3(void) { enum { __cgo__undefined = (leveldb_create_iterator)*1 }; }
line 3 "not-declared"
void cgo_f_3_1(void) { __typeof(leveldb_t) *cgo_undefined; }
line 3 "not-type"
void *cgo_f_3_2(void) { leveldb_t __cgo_undefined; }
line 3 "not-const"
void cgo_f_3_3(void) { enum { __cgo__undefined = (leveldb_t)*1 }; }
line 4 "not-declared"
void cgo_f_4_1(void) { __typeof(leveldb_put) *cgo_undefined; }
line 4 "not-type"
void *cgo_f_4_2(void) { leveldb_put __cgo_undefined; }
line 4 "not-const"
void cgo_f_4_3(void) { enum { __cgo__undefined = (leveldb_put)*1 }; }
line 5 "not-declared"
void cgo_f_5_1(void) { __typeof(leveldb_repair_db) *cgo_undefined; }
line 5 "not-type"
void *cgo_f_5_2(void) { leveldb_repair_db __cgo_undefined; }
line 5 "not-const"
void cgo_f_5_3(void) { enum { __cgo__undefined = (leveldb_repair_db)*1 }; }
line 6 "not-declared"
void cgo_f_6_1(void) { __typeof(leveldb_get) *cgo_undefined; }
line 6 "not-type"
void *cgo_f_6_2(void) { leveldb_get __cgo_undefined; }
line 6 "not-const"
void cgo_f_6_3(void) { enum { __cgo__undefined = (leveldb_get)*1 }; }
line 7 "not-declared"
void cgo_f_7_1(void) { __typeof(GoBytes) *cgo_undefined; }
line 7 "not-type"
void *cgo_f_7_2(void) { GoBytes __cgo_undefined; }
line 7 "not-const"
void cgo_f_7_3(void) { enum { __cgo__undefined = (GoBytes)*1 }; }
line 8 "not-declared"
void cgo_f_8_1(void) { __typeof(leveldb_write) *cgo_undefined; }
line 8 "not-type"
void *cgo_f_8_2(void) { leveldb_write __cgo_undefined; }
line 8 "not-const"
void cgo_f_8_3(void) { enum { __cgo__undefined = (leveldb_write)*1 }; }
line 9 "not-declared"
void cgo_f_9_1(void) { __typeof(leveldb_close) *cgo_undefined; }
line 9 "not-type"
void *cgo_f_9_2(void) { leveldb_close __cgo_undefined; }
line 9 "not-const"
void cgo_f_9_3(void) { enum { __cgo__undefined = (leveldb_close)*1 }; }
line 10 "not-declared"
void cgo_f_10_1(void) { __typeof(leveldb_snapshot_t) *cgo_undefined; }
line 10 "not-type"
void *cgo_f_10_2(void) { leveldb_snapshot_t __cgo_undefined; }
line 10 "not-const"
void cgo_f_10_3(void) { enum { __cgo__undefined = (leveldb_snapshot_t)*1 }; }
line 11 "not-declared"
void cgo_f_11_1(void) { __typeof(leveldb_free) *cgo_undefined; }
line 11 "not-type"
void *cgo_f_11_2(void) { leveldb_free __cgo_undefined; }
line 11 "not-const"
void cgo_f_11_3(void) { enum { __cgo__undefined = (leveldb_free)*1 }; }
line 12 "not-declared"
void cgo_f_12_1(void) { __typeof(uint64_t) *cgo_undefined; }
line 12 "not-type"
void *cgo_f_12_2(void) { uint64_t __cgo_undefined; }
line 12 "not-const"
void cgo_f_12_3(void) { enum { __cgo__undefined = (uint64_t)*1 }; }
line 13 "not-declared"
void cgo_f_13_1(void) { __typeof(leveldb_property_value) *cgo_undefined; }
line 13 "not-type"
void *cgo_f_13_2(void) { leveldb_property_value __cgo_undefined; }
line 13 "not-const"
void cgo_f_13_3(void) { enum { __cgo__undefined = (leveldb_property_value)*1 }; }
line 14 "not-declared"
void cgo_f_14_1(void) { __typeof(leveldb_create_snapshot) *cgo_undefined; }
line 14 "not-type"
void *cgo_f_14_2(void) { leveldb_create_snapshot __cgo_undefined; }
line 14 "not-const"
void cgo_f_14_3(void) { enum { __cgo__undefined = (leveldb_create_snapshot)*1 }; }
line 15 "not-declared"
void cgo_f_15_1(void) { __typeof(leveldb_compact_range) *cgo_undefined; }
line 15 "not-type"
void *cgo_f_15_2(void) { leveldb_compact_range __cgo_undefined; }
line 15 "not-const"
void cgo_f_15_3(void) { enum { __cgo__undefined = (leveldb_compact_range)*1 }; }
line 16 "not-declared"
void cgo_f_16_1(void) { __typeof(char) *cgo_undefined; }
line 16 "not-type"
void *cgo_f_16_2(void) { char __cgo_undefined; }
line 16 "not-const"
void cgo_f_16_3(void) { enum { __cgo__undefined = (char)*1 }; }
line 17 "not-declared"
void cgo_f_17_1(void) { __typeof(size_t) *cgo_undefined; }
line 17 "not-type"
void *cgo_f_17_2(void) { size_t __cgo_undefined; }
line 17 "not-const"
void cgo_f_17_3(void) { enum { __cgo__undefined = (size_t)*1 }; }
line 18 "not-declared"
void cgo_f_18_1(void) { __typeof(GoString) *cgo_undefined; }
line 18 "not-type"
void *cgo_f_18_2(void) { GoString __cgo_undefined; }
line 18 "not-const"
void cgo_f_18_3(void) { enum { __cgo__undefined = (GoString)*1 }; }
line 19 "not-declared"
void cgo_f_19_1(void) { __typeof(leveldb_destroy_db) *cgo_undefined; }
line 19 "not-type"
void *cgo_f_19_2(void) { leveldb_destroy_db __cgo_undefined; }
line 19 "not-const"
void cgo_f_19_3(void) { enum { __cgo__undefined = (leveldb_destroy_db)*1 }; }
line 20 "not-declared"
void cgo_f_20_1(void) { __typeof(leveldb_delete) *cgo_undefined; }
line 20 "not-type"
void *cgo_f_20_2(void) { leveldb_delete __cgo_undefined; }
line 20 "not-const"
void cgo_f_20_3(void) { enum { __cgo__undefined = (leveldb_delete)*1 }; }
line 21 "not-declared"
void cgo_f_21_1(void) { __typeof(levigo_leveldb_approximate_sizes) *cgo_undefined; }
line 21 "not-type"
void *cgo_f_21_2(void) { levigo_leveldb_approximate_sizes __cgo_undefined; }
line 21 "not-const"
void cgo_f_21_3(void) { enum { __cgo__undefined = (levigo_leveldb_approximate_sizes)*1 }; }
line 22 "not-declared"
void cgo_f_22_1(void) { __typeof(leveldb_release_snapshot) *cgo_undefined; }
line 22 "not-type"
void *cgo_f_22_2(void) { leveldb_release_snapshot __cgo_undefined; }
line 22 "not-const"
void cgo_f_22_3(void) { enum { __cgo__undefined = (leveldb_release_snapshot)*1 }; }
line 23 "not-declared"
void cgo_f_23_1(void) { __typeof(CString) *cgo_undefined; }
line 23 "not-type"
void *cgo_f_23_2(void) { CString __cgo_undefined; }
line 23 "not-const"
void cgo_f_23_3(void) { enum { __cgo__undefined = (CString)*1 }; }
line 24 "not-declared"
void cgo_f_24_1(void) { __typeof(leveldb_open) *cgo_undefined; }
line 24 "not-type"
void *cgo_f_24_2(void) { leveldb_open __cgo_undefined; }
line 24 "not-const"
void cgo_f_24_3(void) { enum { __cgo__undefined = (leveldb_open)*1 }; }
line 1 "completed"
int __cgo__1 = __cgo__2;