diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2013-05-14 18:39:35 +0200 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-05-14 18:39:35 +0200 |
commit | efcc50dfdc94c82ee0292bf71992ecb7c0123061 (patch) | |
tree | 17dca99d1dc7fc4e9fe49c2cf6a99d337d4c039f /src/cmd/cc/dpchk.c | |
parent | 04b08da9af0c450d645ab7389d1467308cfc2db8 (diff) | |
download | golang-efcc50dfdc94c82ee0292bf71992ecb7c0123061.tar.gz |
Imported Upstream version 1.1upstream/1.1
Diffstat (limited to 'src/cmd/cc/dpchk.c')
-rw-r--r-- | src/cmd/cc/dpchk.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/cmd/cc/dpchk.c b/src/cmd/cc/dpchk.c index 2f038f520..34163ff92 100644 --- a/src/cmd/cc/dpchk.c +++ b/src/cmd/cc/dpchk.c @@ -692,22 +692,24 @@ pragcgo(char *verb) goto out; } - if(strcmp(verb, "cgo_export") == 0 || strcmp(verb, "dynexport") == 0) { + if(strcmp(verb, "dynexport") == 0) + verb = "cgo_export_dynamic"; + if(strcmp(verb, "cgo_export_static") == 0 || strcmp(verb, "cgo_export_dynamic") == 0) { local = getimpsym(); if(local == nil) goto err2; if(!more()) { - fmtprint(&pragcgobuf, "cgo_export %q\n", local->name); + fmtprint(&pragcgobuf, "%s %q\n", verb, local->name); goto out; } remote = getimpsym(); if(remote == nil) goto err2; - fmtprint(&pragcgobuf, "cgo_export %q %q\n", local->name, remote->name); + fmtprint(&pragcgobuf, "%s %q %q\n", verb, local->name, remote->name); goto out; err2: - yyerror("usage: #pragma cgo_export local [remote]"); + yyerror("usage: #pragma %s local [remote]", verb); goto out; } @@ -749,6 +751,18 @@ pragcgo(char *verb) goto out; } + if(strcmp(verb, "cgo_ldflag") == 0) { + p = getquoted(); + if(p == nil) + goto err5; + fmtprint(&pragcgobuf, "cgo_ldflag %q\n", p); + goto out; + + err5: + yyerror("usage: #pragma cgo_ldflag \"arg\""); + goto out; + } + out: while(getnsc() != '\n') ; |