17
17
# # supports. Currently this is `uint64`, but it is platform-dependent
18
18
# # in general.
19
19
20
- when defined(windows):
20
+ when defined(nimdoc):
21
+ type
22
+ # "Opaque" types defined only in the `nimdoc` branch to not show in error
23
+ # messages in regular code with `clong` and `culong` resolving to base types
24
+ ClongImpl = (when defined(windows): int32 else : int )
25
+ CulongImpl = (when defined(windows): uint32 else : uint )
26
+ clong * = ClongImpl
27
+ # # Represents the *C* `long` type, used for interoperability.
28
+ # #
29
+ # # Its purpose is to match the *C* `long` for the target
30
+ # # platform's Application Binary Interface (ABI).
31
+ # #
32
+ # # Typically, the compiler resolves it to one of the following Nim types
33
+ # # based on the target:
34
+ # # - `int32 <system.html#int32>`_ on Windows using MSVC or MinGW compilers.
35
+ # # - `int <system.html#int>`_ on Linux, macOS and other platforms that use the
36
+ # # LP64 or ILP32 `data models
37
+ # # <https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models>`_.
38
+ # #
39
+ # # .. warning:: The underlying Nim type is an implementation detail and
40
+ # # should not be relied upon.
41
+ culong * = CulongImpl
42
+ # # Represents the *C* `unsigned long` type, used for interoperability.
43
+ # #
44
+ # # Its purpose is to match the *C* `unsigned long` for the target
45
+ # # platform's Application Binary Interface (ABI).
46
+ # #
47
+ # # Typically, the compiler resolves it to one of the following Nim types
48
+ # # based on the target:
49
+ # # - `uint32 <system.html#uint32>`_ on Windows using MSVC or MinGW compilers.
50
+ # # - `uint <system.html#uint>`_ on Linux, macOS and other platforms that use the
51
+ # # LP64 or ILP32 `data models
52
+ # # <https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models>`_.
53
+ # #
54
+ # # .. warning:: The underlying Nim type is an implementation detail and
55
+ # # should not be relied upon.
56
+ elif defined(windows):
21
57
type
22
58
clong * {.importc: " long" , nodecl.} = int32
23
- # # This is the same as the type `long` in *C*.
24
59
culong * {.importc: " unsigned long" , nodecl.} = uint32
25
- # # This is the same as the type `unsigned long` in *C*.
26
60
else :
27
61
type
28
62
clong * {.importc: " long" , nodecl.} = int
29
- # # This is the same as the type `long` in *C*.
30
63
culong * {.importc: " unsigned long" , nodecl.} = uint
31
- # # This is the same as the type `unsigned long` in *C*.
32
64
33
65
type # these work for most platforms:
34
66
cchar * {.importc: " char" , nodecl.} = char
@@ -51,8 +83,7 @@ type # these work for most platforms:
51
83
# # This is the same as the type `long double` in *C*.
52
84
# # This C type is not supported by Nim's code generator.
53
85
54
- cuchar * {.importc: " unsigned char" , nodecl, deprecated: " use `char` or `uint8` instead" .} = char
55
- # # Deprecated: Use `uint8` instead.
86
+ cuchar * {.importc: " unsigned char" , nodecl, deprecated: " Use `char` or `uint8` instead" .} = char
56
87
cushort * {.importc: " unsigned short" , nodecl.} = uint16
57
88
# # This is the same as the type `unsigned short` in *C*.
58
89
cuint * {.importc: " unsigned int" , nodecl.} = uint32
0 commit comments