Skip to content

Commit

Permalink
Merge pull request JuliaLang#2370 from JuliaLang/jn/ctypealias
Browse files Browse the repository at this point in the history
add typealiases for exact C-compatible types
  • Loading branch information
JeffBezanson committed Feb 27, 2013
2 parents 1240bb0 + bc92507 commit a751bac
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
19 changes: 19 additions & 0 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,25 @@ export
MergeSort,
TimSort,

# Ccall types
Cchar,
Cuchar,
Cshort,
Cushort,
Cint,
Cuint,
Clong,
Culong,
Cptrdiff_t,
Csize_t,
Clonglong,
Culonglong,
Cfloat,
Cdouble,
Ccomplex_float,
Ccomplex_double,
Cstring,

# Exceptions
ArgumentError,
DisconnectException,
Expand Down
25 changes: 24 additions & 1 deletion base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ end
## Load essential files and libraries

include("base.jl")
include("build_h.jl")

# core operations & types
include("range.jl")
Expand All @@ -63,6 +64,29 @@ include("reduce.jl")
include("complex.jl")
include("rational.jl")

typealias Cchar Int8
typealias Cuchar Int8
typealias Cshort Int16
typealias Cushort Uint16
typealias Cint Int32
typealias Cuint Uint32
if OS_NAME == :Windows
typealias Clong Int32
typealias Culong Uint32
else
typealias Clong Int
typealias Culong Int
end
typealias Cptrdiff_t Int
typealias Csize_t Uint
typealias Clonglong Int64
typealias Culonglong Uint64
typealias Cfloat Float32
typealias Cdouble Float64
#typealias Ccomplex_float Complex64
#typealias Ccomplex_double Complex128
typealias Cstring Ptr{Uint8}

# core data structures (used by type inference)
include("abstractarray.jl")
include("subarray.jl")
Expand Down Expand Up @@ -103,7 +127,6 @@ include("serialize.jl")
include("multi.jl")

# system & environment
include("build_h.jl")
include("osutils.jl")
include("libc.jl")
include("env.jl")
Expand Down

0 comments on commit a751bac

Please sign in to comment.