collate/tools/colcmp: fix build breakage for darwin.

This used to work.
This still doesn't work fully, but it will have to do for now.

Change-Id: Idabfdf9b5ebffad098962b9d5c817e1febc09837
Reviewed-on: https://go-review.googlesource.com/9800
Reviewed-by: Nigel Tao <nigeltao@golang.org>
This commit is contained in:
Marcel van Lohuizen 2015-05-06 13:08:26 +02:00 коммит произвёл Nigel Tao
Родитель 6c3b324efd
Коммит c93e7c9fff
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -77,13 +77,13 @@ func (c osx16Collator) Compare(a, b Input) int {
nil,
osxCharP(a.UTF16),
C.CFIndex(len(a.UTF16)),
C.kCFAllocatorNull,
nil,
)
sb := C.CFStringCreateWithCharactersNoCopy(
nil,
osxCharP(b.UTF16),
C.CFIndex(len(b.UTF16)),
C.kCFAllocatorNull,
nil,
)
_range := C.CFRangeMake(0, C.CFStringGetLength(sa))
return int(C.CFStringCompareWithOptionsAndLocale(sa, sb, _range, c.opt, c.loc))
@ -96,7 +96,7 @@ func (c osx8Collator) Compare(a, b Input) int {
C.CFIndex(len(a.UTF8)),
C.kCFStringEncodingUTF8,
C.Boolean(0),
C.kCFAllocatorNull,
nil,
)
sb := C.CFStringCreateWithBytesNoCopy(
nil,
@ -104,7 +104,7 @@ func (c osx8Collator) Compare(a, b Input) int {
C.CFIndex(len(b.UTF8)),
C.kCFStringEncodingUTF8,
C.Boolean(0),
C.kCFAllocatorNull,
nil,
)
_range := C.CFRangeMake(0, C.CFStringGetLength(sa))
return int(C.CFStringCompareWithOptionsAndLocale(sa, sb, _range, c.opt, c.loc))