Skip to content

Commit bc92507

Browse files
committed
add typealiases for exact C-compatible types
1 parent 1509530 commit bc92507

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

base/exports.jl

+19
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,25 @@ export
122122
MergeSort,
123123
TimSort,
124124

125+
# Ccall types
126+
Cchar,
127+
Cuchar,
128+
Cshort,
129+
Cushort,
130+
Cint,
131+
Cuint,
132+
Clong,
133+
Culong,
134+
Cptrdiff_t,
135+
Csize_t,
136+
Clonglong,
137+
Culonglong,
138+
Cfloat,
139+
Cdouble,
140+
Ccomplex_float,
141+
Ccomplex_double,
142+
Cstring,
143+
125144
# Exceptions
126145
ArgumentError,
127146
DisconnectException,

base/sysimg.jl

+24-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ end
4242
## Load essential files and libraries
4343

4444
include("base.jl")
45+
include("build_h.jl")
4546

4647
# core operations & types
4748
include("range.jl")
@@ -63,6 +64,29 @@ include("reduce.jl")
6364
include("complex.jl")
6465
include("rational.jl")
6566

67+
typealias Cchar Int8
68+
typealias Cuchar Int8
69+
typealias Cshort Int16
70+
typealias Cushort Uint16
71+
typealias Cint Int32
72+
typealias Cuint Uint32
73+
if OS_NAME == :Windows
74+
typealias Clong Int32
75+
typealias Culong Uint32
76+
else
77+
typealias Clong Int
78+
typealias Culong Int
79+
end
80+
typealias Cptrdiff_t Int
81+
typealias Csize_t Uint
82+
typealias Clonglong Int64
83+
typealias Culonglong Uint64
84+
typealias Cfloat Float32
85+
typealias Cdouble Float64
86+
#typealias Ccomplex_float Complex64
87+
#typealias Ccomplex_double Complex128
88+
typealias Cstring Ptr{Uint8}
89+
6690
# core data structures (used by type inference)
6791
include("abstractarray.jl")
6892
include("subarray.jl")
@@ -103,7 +127,6 @@ include("serialize.jl")
103127
include("multi.jl")
104128

105129
# system & environment
106-
include("build_h.jl")
107130
include("osutils.jl")
108131
include("libc.jl")
109132
include("env.jl")

0 commit comments

Comments
 (0)