Skip to content

Commit

Permalink
fix ccalls using wchar_t, for #2901
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Apr 26, 2013
1 parent c8b99d9 commit 293925d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ isascii(c::Char) = c < 0x80
for name = ("alnum", "alpha", "cntrl", "digit", "graph",
"lower", "print", "punct", "space", "upper")
f = symbol(string("is",name))
@eval ($f)(c::Char) = bool(ccall($(string("isw",name)), Int32, (Char,), c))
@eval ($f)(c::Char) = bool(ccall($(string("isw",name)), Int32, (Cwchar_t,), c))
end

isblank(c::Char) = c==' ' || c=='\t'
Expand Down Expand Up @@ -456,8 +456,8 @@ write(io::IO, s::RopeString) = (write(io, s.head); write(io, s.tail))

## uppercase and lowercase transformations ##

uppercase(c::Char) = ccall(:towupper, Char, (Char,), c)
lowercase(c::Char) = ccall(:towlower, Char, (Char,), c)
uppercase(c::Char) = convert(Char, ccall(:towupper, Cwchar_t, (Cwchar_t,), c))
lowercase(c::Char) = convert(Char, ccall(:towlower, Cwchar_t, (Cwchar_t,), c))

uppercase(s::String) = map(uppercase, s)
lowercase(s::String) = map(lowercase, s)
Expand Down

0 comments on commit 293925d

Please sign in to comment.