File tree 1 file changed +10
-15
lines changed
1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -238,21 +238,16 @@ macro print(items...)
238
238
end
239
239
end
240
240
241
- @generated function promote_c_argument (arg)
242
- # > When a function with a variable-length argument list is called, the variable
243
- # > arguments are passed using C's old ``default argument promotions.'' These say that
244
- # > types char and short int are automatically promoted to int, and type float is
245
- # > automatically promoted to double. Therefore, varargs functions will never receive
246
- # > arguments of type char, short int, or float.
247
-
248
- if arg == Cchar || arg == Cshort
249
- return :(Cint (arg))
250
- elseif arg == Cfloat
251
- return :(Cdouble (arg))
252
- else
253
- return :(arg)
254
- end
255
- end
241
+ # When a function with a variable-length argument list is called, the variable
242
+ # arguments are passed using C's old ``default argument promotions.'' These say that
243
+ # types char and short int are automatically promoted to int, and type float is
244
+ # automatically promoted to double. Therefore, varargs functions will never receive
245
+ # arguments of type char, short int, or float.
246
+
247
+ promote_c_argument (arg) = arg
248
+ promote_c_argument (arg:: Cfloat ) = Cdouble (arg)
249
+ promote_c_argument (arg:: Cchar ) = Cint (arg)
250
+ promote_c_argument (arg:: Cshort ) = Cint (arg)
256
251
257
252
"""
258
253
@printf(fmt::String, args...)
You can’t perform that action at this time.
0 commit comments