Skip to content

Commit 33ce478

Browse files
committed
Use error constants from Libc
The codes are different e.g. on Mac OS X.
1 parent 28abafb commit 33ce478

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/iconv.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module iconv
44
import Base: close, eof, flush, read, readall, write
5-
import Base.Libc: errno, strerror
5+
import Base.Libc: errno, strerror, E2BIG, EINVAL, EILSEQ
66
export StringEncoder, StringDecoder, encode, decode
77

88
depsjl = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
@@ -11,10 +11,6 @@ isfile(depsjl) ? include(depsjl) : error("libiconv not properly installed. Pleas
1111

1212
## iconv wrappers
1313

14-
const E2BIG = 7
15-
const EINVAL = 22
16-
const EILSEQ = 84
17-
1814
function iconv_close(cd::Ptr{Void})
1915
if cd != C_NULL
2016
ccall((:iconv_close, libiconv), Cint, (Ptr{Void},), cd) == 0 ||

0 commit comments

Comments
 (0)