Created
August 12, 2014 03:14
-
-
Save holys/e2bae78ef1eb2bc9407c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // +build leveldb hyperleveldb | |
| package main | |
| // #cgo leveldb CFLAGS: -DLEVELDB=1 | |
| // #cgo hyperleveldb CFLAGS: -DHYPERLEVELDB=1 | |
| // #include <stdio.h> | |
| // void pp() { | |
| // #ifdef LEVELDB | |
| // printf("hello leveldb \n"); | |
| // #endif | |
| // #ifdef HYPERLEVELDB | |
| // printf("hello hyperleveldb\n"); | |
| // #endif | |
| // } | |
| import "C" | |
| func main() { | |
| C.pp() | |
| } | |
| //run | |
| //go run -tags "leveldb" buildt.go | |
| //output: hello leveldb | |
| //go run -tags "hyperleveldb" buildt.go | |
| //output: hello hyperleveldb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment