1
0
mirror of https://github.com/golang/go synced 2024-11-20 04:04:41 -07:00

cmd/cc: allow to call nested packages from within C code

E.g. sync/atomic.LoadInt32() can be called as sync»atomic·LoadInt32()

R=rsc
CC=golang-dev
https://golang.org/cl/6448057
This commit is contained in:
Dmitriy Vyukov 2012-08-04 16:11:53 +04:00
parent 6fa38e5e0a
commit 8be5e8a419
2 changed files with 12 additions and 2 deletions

View File

@ -377,11 +377,16 @@ lookup(void)
symb[1] = '"';
}
// turn · into .
for(r=w=symb; *r; r++) {
// turn · (U+00B7) into .
// turn (U+2215) into /
if((uchar)*r == 0xc2 && (uchar)*(r+1) == 0xb7) {
*w++ = '.';
r++;
}else if((uchar)*r == 0xe2 && (uchar)*(r+1) == 0x88 && (uchar)*(r+2) == 0x95) {
*w++ = '/';
r++;
r++;
}else
*w++ = *r;
}

View File

@ -251,11 +251,16 @@ lookup(void)
symb[1] = '"';
}
// turn · into .
for(r=w=symb; *r; r++) {
// turn · (U+00B7) into .
// turn (U+2215) into /
if((uchar)*r == 0xc2 && (uchar)*(r+1) == 0xb7) {
*w++ = '.';
r++;
}else if((uchar)*r == 0xe2 && (uchar)*(r+1) == 0x88 && (uchar)*(r+2) == 0x95) {
*w++ = '/';
r++;
r++;
}else
*w++ = *r;
}