/src/FreeRDP/winpr/include/winpr/crt.h
Line | Count | Source |
1 | | /** |
2 | | * WinPR: Windows Portable Runtime |
3 | | * C Run-Time Library Routines |
4 | | * |
5 | | * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com> |
6 | | * |
7 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
8 | | * you may not use this file except in compliance with the License. |
9 | | * You may obtain a copy of the License at |
10 | | * |
11 | | * http://www.apache.org/licenses/LICENSE-2.0 |
12 | | * |
13 | | * Unless required by applicable law or agreed to in writing, software |
14 | | * distributed under the License is distributed on an "AS IS" BASIS, |
15 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | | * See the License for the specific language governing permissions and |
17 | | * limitations under the License. |
18 | | */ |
19 | | |
20 | | #ifndef WINPR_CRT_H |
21 | | #define WINPR_CRT_H |
22 | | |
23 | | #include <stdio.h> |
24 | | #include <stdlib.h> |
25 | | #include <string.h> |
26 | | |
27 | | #include <winpr/cast.h> |
28 | | #include <winpr/platform.h> |
29 | | #include <winpr/winpr.h> |
30 | | |
31 | | #include <winpr/spec.h> |
32 | | #include <winpr/string.h> |
33 | | |
34 | | WINPR_PRAGMA_DIAG_PUSH |
35 | | WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER |
36 | | // NOLINTBEGIN(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp) |
37 | | |
38 | | #ifndef _WIN32 |
39 | | |
40 | | #include <unistd.h> |
41 | | |
42 | | #ifndef _write |
43 | 0 | #define _write write |
44 | | #endif |
45 | | |
46 | | #ifndef _strtoui64 |
47 | | #define _strtoui64 strtoull |
48 | | #endif /* _strtoui64 */ |
49 | | |
50 | | #ifndef _strtoi64 |
51 | | #define _strtoi64 strtoll |
52 | | #endif /* _strtoi64 */ |
53 | | |
54 | | #ifndef _rotl |
55 | | static inline UINT32 _rotl(UINT32 value, int shift) |
56 | 0 | { |
57 | 0 | return (value << shift) | (value >> (32 - shift)); |
58 | 0 | } Unexecuted instantiation: TestFuzzCodecs.c:_rotl Unexecuted instantiation: planar.c:_rotl Unexecuted instantiation: interleaved.c:_rotl Unexecuted instantiation: progressive.c:_rotl Unexecuted instantiation: rfx.c:_rotl Unexecuted instantiation: region.c:_rotl Unexecuted instantiation: ncrush.c:_rotl Unexecuted instantiation: xcrush.c:_rotl Unexecuted instantiation: mppc.c:_rotl Unexecuted instantiation: zgfx.c:_rotl Unexecuted instantiation: clear.c:_rotl Unexecuted instantiation: rfx_sse2.c:_rotl Unexecuted instantiation: rfx_neon.c:_rotl Unexecuted instantiation: primitives.c:_rotl Unexecuted instantiation: color.c:_rotl Unexecuted instantiation: bitmap.c:_rotl Unexecuted instantiation: rfx_decode.c:_rotl Unexecuted instantiation: rfx_dwt.c:_rotl Unexecuted instantiation: rfx_encode.c:_rotl Unexecuted instantiation: rfx_quantization.c:_rotl Unexecuted instantiation: rfx_rlgr.c:_rotl Unexecuted instantiation: nsc.c:_rotl Unexecuted instantiation: nsc_encode.c:_rotl Unexecuted instantiation: nsc_sse2.c:_rotl Unexecuted instantiation: nsc_neon.c:_rotl Unexecuted instantiation: prim_add.c:_rotl Unexecuted instantiation: prim_andor.c:_rotl Unexecuted instantiation: prim_alphaComp.c:_rotl Unexecuted instantiation: prim_colors.c:_rotl Unexecuted instantiation: prim_copy.c:_rotl Unexecuted instantiation: prim_set.c:_rotl Unexecuted instantiation: prim_shift.c:_rotl Unexecuted instantiation: prim_sign.c:_rotl Unexecuted instantiation: prim_YUV.c:_rotl Unexecuted instantiation: prim_YCoCg.c:_rotl Unexecuted instantiation: prim_colors_neon.c:_rotl Unexecuted instantiation: prim_YCoCg_neon.c:_rotl Unexecuted instantiation: prim_YUV_neon.c:_rotl Unexecuted instantiation: prim_colors_sse2.c:_rotl Unexecuted instantiation: prim_set_sse2.c:_rotl Unexecuted instantiation: prim_add_sse3.c:_rotl Unexecuted instantiation: prim_alphaComp_sse3.c:_rotl Unexecuted instantiation: prim_andor_sse3.c:_rotl Unexecuted instantiation: prim_shift_sse3.c:_rotl Unexecuted instantiation: prim_sign_ssse3.c:_rotl Unexecuted instantiation: prim_YCoCg_ssse3.c:_rotl Unexecuted instantiation: prim_copy_sse4_1.c:_rotl Unexecuted instantiation: prim_YUV_sse4.1.c:_rotl Unexecuted instantiation: prim_copy_avx2.c:_rotl Unexecuted instantiation: rand.c:_rotl Unexecuted instantiation: registry.c:_rotl Unexecuted instantiation: stream.c:_rotl Unexecuted instantiation: debug.c:_rotl Unexecuted instantiation: BitStream.c:_rotl Unexecuted instantiation: HashTable.c:_rotl Unexecuted instantiation: BufferPool.c:_rotl Unexecuted instantiation: ObjectPool.c:_rotl Unexecuted instantiation: wlog.c:_rotl Unexecuted instantiation: FileAppender.c:_rotl Unexecuted instantiation: BinaryAppender.c:_rotl Unexecuted instantiation: UdpAppender.c:_rotl Unexecuted instantiation: sysinfo.c:_rotl Unexecuted instantiation: work.c:_rotl Unexecuted instantiation: pool.c:_rotl Unexecuted instantiation: handle.c:_rotl Unexecuted instantiation: process.c:_rotl Unexecuted instantiation: thread.c:_rotl Unexecuted instantiation: winsock.c:_rotl Unexecuted instantiation: alignment.c:_rotl Unexecuted instantiation: unicode.c:_rotl Unexecuted instantiation: string.c:_rotl Unexecuted instantiation: critical.c:_rotl Unexecuted instantiation: event.c:_rotl Unexecuted instantiation: wait.c:_rotl Unexecuted instantiation: generic.c:_rotl Unexecuted instantiation: namedPipeClient.c:_rotl Unexecuted instantiation: pattern.c:_rotl Unexecuted instantiation: file.c:_rotl Unexecuted instantiation: comm.c:_rotl Unexecuted instantiation: comm_ioctl.c:_rotl Unexecuted instantiation: comm_serial_sys.c:_rotl Unexecuted instantiation: comm_sercx_sys.c:_rotl Unexecuted instantiation: comm_sercx2_sys.c:_rotl Unexecuted instantiation: pipe.c:_rotl Unexecuted instantiation: environment.c:_rotl Unexecuted instantiation: registry_reg.c:_rotl Unexecuted instantiation: path.c:_rotl Unexecuted instantiation: shell.c:_rotl Unexecuted instantiation: Object.c:_rotl Unexecuted instantiation: Queue.c:_rotl Unexecuted instantiation: ArrayList.c:_rotl Unexecuted instantiation: CountdownEvent.c:_rotl Unexecuted instantiation: Layout.c:_rotl Unexecuted instantiation: Message.c:_rotl Unexecuted instantiation: PacketMessage.c:_rotl Unexecuted instantiation: argv.c:_rotl Unexecuted instantiation: buffer.c:_rotl Unexecuted instantiation: nt.c:_rotl Unexecuted instantiation: comm_io.c:_rotl Unexecuted instantiation: image.c:_rotl |
59 | | #endif /* _rotl */ |
60 | | |
61 | | #ifndef _rotl64 |
62 | | static inline UINT64 _rotl64(UINT64 value, int shift) |
63 | 0 | { |
64 | 0 | return (value << shift) | (value >> (64 - shift)); |
65 | 0 | } Unexecuted instantiation: TestFuzzCodecs.c:_rotl64 Unexecuted instantiation: planar.c:_rotl64 Unexecuted instantiation: interleaved.c:_rotl64 Unexecuted instantiation: progressive.c:_rotl64 Unexecuted instantiation: rfx.c:_rotl64 Unexecuted instantiation: region.c:_rotl64 Unexecuted instantiation: ncrush.c:_rotl64 Unexecuted instantiation: xcrush.c:_rotl64 Unexecuted instantiation: mppc.c:_rotl64 Unexecuted instantiation: zgfx.c:_rotl64 Unexecuted instantiation: clear.c:_rotl64 Unexecuted instantiation: rfx_sse2.c:_rotl64 Unexecuted instantiation: rfx_neon.c:_rotl64 Unexecuted instantiation: primitives.c:_rotl64 Unexecuted instantiation: color.c:_rotl64 Unexecuted instantiation: bitmap.c:_rotl64 Unexecuted instantiation: rfx_decode.c:_rotl64 Unexecuted instantiation: rfx_dwt.c:_rotl64 Unexecuted instantiation: rfx_encode.c:_rotl64 Unexecuted instantiation: rfx_quantization.c:_rotl64 Unexecuted instantiation: rfx_rlgr.c:_rotl64 Unexecuted instantiation: nsc.c:_rotl64 Unexecuted instantiation: nsc_encode.c:_rotl64 Unexecuted instantiation: nsc_sse2.c:_rotl64 Unexecuted instantiation: nsc_neon.c:_rotl64 Unexecuted instantiation: prim_add.c:_rotl64 Unexecuted instantiation: prim_andor.c:_rotl64 Unexecuted instantiation: prim_alphaComp.c:_rotl64 Unexecuted instantiation: prim_colors.c:_rotl64 Unexecuted instantiation: prim_copy.c:_rotl64 Unexecuted instantiation: prim_set.c:_rotl64 Unexecuted instantiation: prim_shift.c:_rotl64 Unexecuted instantiation: prim_sign.c:_rotl64 Unexecuted instantiation: prim_YUV.c:_rotl64 Unexecuted instantiation: prim_YCoCg.c:_rotl64 Unexecuted instantiation: prim_colors_neon.c:_rotl64 Unexecuted instantiation: prim_YCoCg_neon.c:_rotl64 Unexecuted instantiation: prim_YUV_neon.c:_rotl64 Unexecuted instantiation: prim_colors_sse2.c:_rotl64 Unexecuted instantiation: prim_set_sse2.c:_rotl64 Unexecuted instantiation: prim_add_sse3.c:_rotl64 Unexecuted instantiation: prim_alphaComp_sse3.c:_rotl64 Unexecuted instantiation: prim_andor_sse3.c:_rotl64 Unexecuted instantiation: prim_shift_sse3.c:_rotl64 Unexecuted instantiation: prim_sign_ssse3.c:_rotl64 Unexecuted instantiation: prim_YCoCg_ssse3.c:_rotl64 Unexecuted instantiation: prim_copy_sse4_1.c:_rotl64 Unexecuted instantiation: prim_YUV_sse4.1.c:_rotl64 Unexecuted instantiation: prim_copy_avx2.c:_rotl64 Unexecuted instantiation: rand.c:_rotl64 Unexecuted instantiation: registry.c:_rotl64 Unexecuted instantiation: stream.c:_rotl64 Unexecuted instantiation: debug.c:_rotl64 Unexecuted instantiation: BitStream.c:_rotl64 Unexecuted instantiation: HashTable.c:_rotl64 Unexecuted instantiation: BufferPool.c:_rotl64 Unexecuted instantiation: ObjectPool.c:_rotl64 Unexecuted instantiation: wlog.c:_rotl64 Unexecuted instantiation: FileAppender.c:_rotl64 Unexecuted instantiation: BinaryAppender.c:_rotl64 Unexecuted instantiation: UdpAppender.c:_rotl64 Unexecuted instantiation: sysinfo.c:_rotl64 Unexecuted instantiation: work.c:_rotl64 Unexecuted instantiation: pool.c:_rotl64 Unexecuted instantiation: handle.c:_rotl64 Unexecuted instantiation: process.c:_rotl64 Unexecuted instantiation: thread.c:_rotl64 Unexecuted instantiation: winsock.c:_rotl64 Unexecuted instantiation: alignment.c:_rotl64 Unexecuted instantiation: unicode.c:_rotl64 Unexecuted instantiation: string.c:_rotl64 Unexecuted instantiation: critical.c:_rotl64 Unexecuted instantiation: event.c:_rotl64 Unexecuted instantiation: wait.c:_rotl64 Unexecuted instantiation: generic.c:_rotl64 Unexecuted instantiation: namedPipeClient.c:_rotl64 Unexecuted instantiation: pattern.c:_rotl64 Unexecuted instantiation: file.c:_rotl64 Unexecuted instantiation: comm.c:_rotl64 Unexecuted instantiation: comm_ioctl.c:_rotl64 Unexecuted instantiation: comm_serial_sys.c:_rotl64 Unexecuted instantiation: comm_sercx_sys.c:_rotl64 Unexecuted instantiation: comm_sercx2_sys.c:_rotl64 Unexecuted instantiation: pipe.c:_rotl64 Unexecuted instantiation: environment.c:_rotl64 Unexecuted instantiation: registry_reg.c:_rotl64 Unexecuted instantiation: path.c:_rotl64 Unexecuted instantiation: shell.c:_rotl64 Unexecuted instantiation: Object.c:_rotl64 Unexecuted instantiation: Queue.c:_rotl64 Unexecuted instantiation: ArrayList.c:_rotl64 Unexecuted instantiation: CountdownEvent.c:_rotl64 Unexecuted instantiation: Layout.c:_rotl64 Unexecuted instantiation: Message.c:_rotl64 Unexecuted instantiation: PacketMessage.c:_rotl64 Unexecuted instantiation: argv.c:_rotl64 Unexecuted instantiation: buffer.c:_rotl64 Unexecuted instantiation: nt.c:_rotl64 Unexecuted instantiation: comm_io.c:_rotl64 Unexecuted instantiation: image.c:_rotl64 |
66 | | #endif /* _rotl64 */ |
67 | | |
68 | | #ifndef _rotr |
69 | | static inline UINT32 _rotr(UINT32 value, int shift) |
70 | 0 | { |
71 | 0 | return (value >> shift) | (value << (32 - shift)); |
72 | 0 | } Unexecuted instantiation: TestFuzzCodecs.c:_rotr Unexecuted instantiation: planar.c:_rotr Unexecuted instantiation: interleaved.c:_rotr Unexecuted instantiation: progressive.c:_rotr Unexecuted instantiation: rfx.c:_rotr Unexecuted instantiation: region.c:_rotr Unexecuted instantiation: ncrush.c:_rotr Unexecuted instantiation: xcrush.c:_rotr Unexecuted instantiation: mppc.c:_rotr Unexecuted instantiation: zgfx.c:_rotr Unexecuted instantiation: clear.c:_rotr Unexecuted instantiation: rfx_sse2.c:_rotr Unexecuted instantiation: rfx_neon.c:_rotr Unexecuted instantiation: primitives.c:_rotr Unexecuted instantiation: color.c:_rotr Unexecuted instantiation: bitmap.c:_rotr Unexecuted instantiation: rfx_decode.c:_rotr Unexecuted instantiation: rfx_dwt.c:_rotr Unexecuted instantiation: rfx_encode.c:_rotr Unexecuted instantiation: rfx_quantization.c:_rotr Unexecuted instantiation: rfx_rlgr.c:_rotr Unexecuted instantiation: nsc.c:_rotr Unexecuted instantiation: nsc_encode.c:_rotr Unexecuted instantiation: nsc_sse2.c:_rotr Unexecuted instantiation: nsc_neon.c:_rotr Unexecuted instantiation: prim_add.c:_rotr Unexecuted instantiation: prim_andor.c:_rotr Unexecuted instantiation: prim_alphaComp.c:_rotr Unexecuted instantiation: prim_colors.c:_rotr Unexecuted instantiation: prim_copy.c:_rotr Unexecuted instantiation: prim_set.c:_rotr Unexecuted instantiation: prim_shift.c:_rotr Unexecuted instantiation: prim_sign.c:_rotr Unexecuted instantiation: prim_YUV.c:_rotr Unexecuted instantiation: prim_YCoCg.c:_rotr Unexecuted instantiation: prim_colors_neon.c:_rotr Unexecuted instantiation: prim_YCoCg_neon.c:_rotr Unexecuted instantiation: prim_YUV_neon.c:_rotr Unexecuted instantiation: prim_colors_sse2.c:_rotr Unexecuted instantiation: prim_set_sse2.c:_rotr Unexecuted instantiation: prim_add_sse3.c:_rotr Unexecuted instantiation: prim_alphaComp_sse3.c:_rotr Unexecuted instantiation: prim_andor_sse3.c:_rotr Unexecuted instantiation: prim_shift_sse3.c:_rotr Unexecuted instantiation: prim_sign_ssse3.c:_rotr Unexecuted instantiation: prim_YCoCg_ssse3.c:_rotr Unexecuted instantiation: prim_copy_sse4_1.c:_rotr Unexecuted instantiation: prim_YUV_sse4.1.c:_rotr Unexecuted instantiation: prim_copy_avx2.c:_rotr Unexecuted instantiation: rand.c:_rotr Unexecuted instantiation: registry.c:_rotr Unexecuted instantiation: stream.c:_rotr Unexecuted instantiation: debug.c:_rotr Unexecuted instantiation: BitStream.c:_rotr Unexecuted instantiation: HashTable.c:_rotr Unexecuted instantiation: BufferPool.c:_rotr Unexecuted instantiation: ObjectPool.c:_rotr Unexecuted instantiation: wlog.c:_rotr Unexecuted instantiation: FileAppender.c:_rotr Unexecuted instantiation: BinaryAppender.c:_rotr Unexecuted instantiation: UdpAppender.c:_rotr Unexecuted instantiation: sysinfo.c:_rotr Unexecuted instantiation: work.c:_rotr Unexecuted instantiation: pool.c:_rotr Unexecuted instantiation: handle.c:_rotr Unexecuted instantiation: process.c:_rotr Unexecuted instantiation: thread.c:_rotr Unexecuted instantiation: winsock.c:_rotr Unexecuted instantiation: alignment.c:_rotr Unexecuted instantiation: unicode.c:_rotr Unexecuted instantiation: string.c:_rotr Unexecuted instantiation: critical.c:_rotr Unexecuted instantiation: event.c:_rotr Unexecuted instantiation: wait.c:_rotr Unexecuted instantiation: generic.c:_rotr Unexecuted instantiation: namedPipeClient.c:_rotr Unexecuted instantiation: pattern.c:_rotr Unexecuted instantiation: file.c:_rotr Unexecuted instantiation: comm.c:_rotr Unexecuted instantiation: comm_ioctl.c:_rotr Unexecuted instantiation: comm_serial_sys.c:_rotr Unexecuted instantiation: comm_sercx_sys.c:_rotr Unexecuted instantiation: comm_sercx2_sys.c:_rotr Unexecuted instantiation: pipe.c:_rotr Unexecuted instantiation: environment.c:_rotr Unexecuted instantiation: registry_reg.c:_rotr Unexecuted instantiation: path.c:_rotr Unexecuted instantiation: shell.c:_rotr Unexecuted instantiation: Object.c:_rotr Unexecuted instantiation: Queue.c:_rotr Unexecuted instantiation: ArrayList.c:_rotr Unexecuted instantiation: CountdownEvent.c:_rotr Unexecuted instantiation: Layout.c:_rotr Unexecuted instantiation: Message.c:_rotr Unexecuted instantiation: PacketMessage.c:_rotr Unexecuted instantiation: argv.c:_rotr Unexecuted instantiation: buffer.c:_rotr Unexecuted instantiation: nt.c:_rotr Unexecuted instantiation: comm_io.c:_rotr Unexecuted instantiation: image.c:_rotr |
73 | | #endif /* _rotr */ |
74 | | |
75 | | #ifndef _rotr64 |
76 | | static inline UINT64 _rotr64(UINT64 value, int shift) |
77 | 0 | { |
78 | 0 | return (value >> shift) | (value << (64 - shift)); |
79 | 0 | } Unexecuted instantiation: TestFuzzCodecs.c:_rotr64 Unexecuted instantiation: planar.c:_rotr64 Unexecuted instantiation: interleaved.c:_rotr64 Unexecuted instantiation: progressive.c:_rotr64 Unexecuted instantiation: rfx.c:_rotr64 Unexecuted instantiation: region.c:_rotr64 Unexecuted instantiation: ncrush.c:_rotr64 Unexecuted instantiation: xcrush.c:_rotr64 Unexecuted instantiation: mppc.c:_rotr64 Unexecuted instantiation: zgfx.c:_rotr64 Unexecuted instantiation: clear.c:_rotr64 Unexecuted instantiation: rfx_sse2.c:_rotr64 Unexecuted instantiation: rfx_neon.c:_rotr64 Unexecuted instantiation: primitives.c:_rotr64 Unexecuted instantiation: color.c:_rotr64 Unexecuted instantiation: bitmap.c:_rotr64 Unexecuted instantiation: rfx_decode.c:_rotr64 Unexecuted instantiation: rfx_dwt.c:_rotr64 Unexecuted instantiation: rfx_encode.c:_rotr64 Unexecuted instantiation: rfx_quantization.c:_rotr64 Unexecuted instantiation: rfx_rlgr.c:_rotr64 Unexecuted instantiation: nsc.c:_rotr64 Unexecuted instantiation: nsc_encode.c:_rotr64 Unexecuted instantiation: nsc_sse2.c:_rotr64 Unexecuted instantiation: nsc_neon.c:_rotr64 Unexecuted instantiation: prim_add.c:_rotr64 Unexecuted instantiation: prim_andor.c:_rotr64 Unexecuted instantiation: prim_alphaComp.c:_rotr64 Unexecuted instantiation: prim_colors.c:_rotr64 Unexecuted instantiation: prim_copy.c:_rotr64 Unexecuted instantiation: prim_set.c:_rotr64 Unexecuted instantiation: prim_shift.c:_rotr64 Unexecuted instantiation: prim_sign.c:_rotr64 Unexecuted instantiation: prim_YUV.c:_rotr64 Unexecuted instantiation: prim_YCoCg.c:_rotr64 Unexecuted instantiation: prim_colors_neon.c:_rotr64 Unexecuted instantiation: prim_YCoCg_neon.c:_rotr64 Unexecuted instantiation: prim_YUV_neon.c:_rotr64 Unexecuted instantiation: prim_colors_sse2.c:_rotr64 Unexecuted instantiation: prim_set_sse2.c:_rotr64 Unexecuted instantiation: prim_add_sse3.c:_rotr64 Unexecuted instantiation: prim_alphaComp_sse3.c:_rotr64 Unexecuted instantiation: prim_andor_sse3.c:_rotr64 Unexecuted instantiation: prim_shift_sse3.c:_rotr64 Unexecuted instantiation: prim_sign_ssse3.c:_rotr64 Unexecuted instantiation: prim_YCoCg_ssse3.c:_rotr64 Unexecuted instantiation: prim_copy_sse4_1.c:_rotr64 Unexecuted instantiation: prim_YUV_sse4.1.c:_rotr64 Unexecuted instantiation: prim_copy_avx2.c:_rotr64 Unexecuted instantiation: rand.c:_rotr64 Unexecuted instantiation: registry.c:_rotr64 Unexecuted instantiation: stream.c:_rotr64 Unexecuted instantiation: debug.c:_rotr64 Unexecuted instantiation: BitStream.c:_rotr64 Unexecuted instantiation: HashTable.c:_rotr64 Unexecuted instantiation: BufferPool.c:_rotr64 Unexecuted instantiation: ObjectPool.c:_rotr64 Unexecuted instantiation: wlog.c:_rotr64 Unexecuted instantiation: FileAppender.c:_rotr64 Unexecuted instantiation: BinaryAppender.c:_rotr64 Unexecuted instantiation: UdpAppender.c:_rotr64 Unexecuted instantiation: sysinfo.c:_rotr64 Unexecuted instantiation: work.c:_rotr64 Unexecuted instantiation: pool.c:_rotr64 Unexecuted instantiation: handle.c:_rotr64 Unexecuted instantiation: process.c:_rotr64 Unexecuted instantiation: thread.c:_rotr64 Unexecuted instantiation: winsock.c:_rotr64 Unexecuted instantiation: alignment.c:_rotr64 Unexecuted instantiation: unicode.c:_rotr64 Unexecuted instantiation: string.c:_rotr64 Unexecuted instantiation: critical.c:_rotr64 Unexecuted instantiation: event.c:_rotr64 Unexecuted instantiation: wait.c:_rotr64 Unexecuted instantiation: generic.c:_rotr64 Unexecuted instantiation: namedPipeClient.c:_rotr64 Unexecuted instantiation: pattern.c:_rotr64 Unexecuted instantiation: file.c:_rotr64 Unexecuted instantiation: comm.c:_rotr64 Unexecuted instantiation: comm_ioctl.c:_rotr64 Unexecuted instantiation: comm_serial_sys.c:_rotr64 Unexecuted instantiation: comm_sercx_sys.c:_rotr64 Unexecuted instantiation: comm_sercx2_sys.c:_rotr64 Unexecuted instantiation: pipe.c:_rotr64 Unexecuted instantiation: environment.c:_rotr64 Unexecuted instantiation: registry_reg.c:_rotr64 Unexecuted instantiation: path.c:_rotr64 Unexecuted instantiation: shell.c:_rotr64 Unexecuted instantiation: Object.c:_rotr64 Unexecuted instantiation: Queue.c:_rotr64 Unexecuted instantiation: ArrayList.c:_rotr64 Unexecuted instantiation: CountdownEvent.c:_rotr64 Unexecuted instantiation: Layout.c:_rotr64 Unexecuted instantiation: Message.c:_rotr64 Unexecuted instantiation: PacketMessage.c:_rotr64 Unexecuted instantiation: argv.c:_rotr64 Unexecuted instantiation: buffer.c:_rotr64 Unexecuted instantiation: nt.c:_rotr64 Unexecuted instantiation: comm_io.c:_rotr64 Unexecuted instantiation: image.c:_rotr64 |
80 | | #endif /* _rotr64 */ |
81 | | |
82 | | #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) |
83 | | |
84 | | #define _byteswap_ulong(_val) __builtin_bswap32(_val) |
85 | | #define _byteswap_uint64(_val) __builtin_bswap64(_val) |
86 | | |
87 | | #else |
88 | | |
89 | | static inline UINT32 _byteswap_ulong(UINT32 _val) |
90 | | { |
91 | | return (((_val) >> 24) | (((_val)&0x00FF0000) >> 8) | (((_val)&0x0000FF00) << 8) | |
92 | | ((_val) << 24)); |
93 | | } |
94 | | |
95 | | static inline UINT64 _byteswap_uint64(UINT64 _val) |
96 | | { |
97 | | return (((_val) << 56) | (((_val) << 40) & 0xFF000000000000) | |
98 | | (((_val) << 24) & 0xFF0000000000) | (((_val) << 8) & 0xFF00000000) | |
99 | | (((_val) >> 8) & 0xFF000000) | (((_val) >> 24) & 0xFF0000) | (((_val) >> 40) & 0xFF00) | |
100 | | ((_val) >> 56)); |
101 | | } |
102 | | |
103 | | #endif /* (__GNUC__ > 4) || ... */ |
104 | | |
105 | | #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) |
106 | | |
107 | | #define _byteswap_ushort(_val) __builtin_bswap16(_val) |
108 | | |
109 | | #else |
110 | | |
111 | | static inline UINT16 _byteswap_ushort(UINT16 _val) |
112 | 0 | { |
113 | 0 | return WINPR_CXX_COMPAT_CAST(UINT16, ((_val) >> 8U) | ((_val) << 8U)); |
114 | 0 | } Unexecuted instantiation: TestFuzzCodecs.c:_byteswap_ushort Unexecuted instantiation: planar.c:_byteswap_ushort Unexecuted instantiation: interleaved.c:_byteswap_ushort Unexecuted instantiation: progressive.c:_byteswap_ushort Unexecuted instantiation: rfx.c:_byteswap_ushort Unexecuted instantiation: region.c:_byteswap_ushort Unexecuted instantiation: ncrush.c:_byteswap_ushort Unexecuted instantiation: xcrush.c:_byteswap_ushort Unexecuted instantiation: mppc.c:_byteswap_ushort Unexecuted instantiation: zgfx.c:_byteswap_ushort Unexecuted instantiation: clear.c:_byteswap_ushort Unexecuted instantiation: rfx_sse2.c:_byteswap_ushort Unexecuted instantiation: rfx_neon.c:_byteswap_ushort Unexecuted instantiation: primitives.c:_byteswap_ushort Unexecuted instantiation: color.c:_byteswap_ushort Unexecuted instantiation: bitmap.c:_byteswap_ushort Unexecuted instantiation: rfx_decode.c:_byteswap_ushort Unexecuted instantiation: rfx_dwt.c:_byteswap_ushort Unexecuted instantiation: rfx_encode.c:_byteswap_ushort Unexecuted instantiation: rfx_quantization.c:_byteswap_ushort Unexecuted instantiation: rfx_rlgr.c:_byteswap_ushort Unexecuted instantiation: nsc.c:_byteswap_ushort Unexecuted instantiation: nsc_encode.c:_byteswap_ushort Unexecuted instantiation: nsc_sse2.c:_byteswap_ushort Unexecuted instantiation: nsc_neon.c:_byteswap_ushort Unexecuted instantiation: prim_add.c:_byteswap_ushort Unexecuted instantiation: prim_andor.c:_byteswap_ushort Unexecuted instantiation: prim_alphaComp.c:_byteswap_ushort Unexecuted instantiation: prim_colors.c:_byteswap_ushort Unexecuted instantiation: prim_copy.c:_byteswap_ushort Unexecuted instantiation: prim_set.c:_byteswap_ushort Unexecuted instantiation: prim_shift.c:_byteswap_ushort Unexecuted instantiation: prim_sign.c:_byteswap_ushort Unexecuted instantiation: prim_YUV.c:_byteswap_ushort Unexecuted instantiation: prim_YCoCg.c:_byteswap_ushort Unexecuted instantiation: prim_colors_neon.c:_byteswap_ushort Unexecuted instantiation: prim_YCoCg_neon.c:_byteswap_ushort Unexecuted instantiation: prim_YUV_neon.c:_byteswap_ushort Unexecuted instantiation: prim_colors_sse2.c:_byteswap_ushort Unexecuted instantiation: prim_set_sse2.c:_byteswap_ushort Unexecuted instantiation: prim_add_sse3.c:_byteswap_ushort Unexecuted instantiation: prim_alphaComp_sse3.c:_byteswap_ushort Unexecuted instantiation: prim_andor_sse3.c:_byteswap_ushort Unexecuted instantiation: prim_shift_sse3.c:_byteswap_ushort Unexecuted instantiation: prim_sign_ssse3.c:_byteswap_ushort Unexecuted instantiation: prim_YCoCg_ssse3.c:_byteswap_ushort Unexecuted instantiation: prim_copy_sse4_1.c:_byteswap_ushort Unexecuted instantiation: prim_YUV_sse4.1.c:_byteswap_ushort Unexecuted instantiation: prim_copy_avx2.c:_byteswap_ushort Unexecuted instantiation: rand.c:_byteswap_ushort Unexecuted instantiation: registry.c:_byteswap_ushort Unexecuted instantiation: stream.c:_byteswap_ushort Unexecuted instantiation: debug.c:_byteswap_ushort Unexecuted instantiation: BitStream.c:_byteswap_ushort Unexecuted instantiation: HashTable.c:_byteswap_ushort Unexecuted instantiation: BufferPool.c:_byteswap_ushort Unexecuted instantiation: ObjectPool.c:_byteswap_ushort Unexecuted instantiation: wlog.c:_byteswap_ushort Unexecuted instantiation: FileAppender.c:_byteswap_ushort Unexecuted instantiation: BinaryAppender.c:_byteswap_ushort Unexecuted instantiation: UdpAppender.c:_byteswap_ushort Unexecuted instantiation: sysinfo.c:_byteswap_ushort Unexecuted instantiation: work.c:_byteswap_ushort Unexecuted instantiation: pool.c:_byteswap_ushort Unexecuted instantiation: handle.c:_byteswap_ushort Unexecuted instantiation: process.c:_byteswap_ushort Unexecuted instantiation: thread.c:_byteswap_ushort Unexecuted instantiation: winsock.c:_byteswap_ushort Unexecuted instantiation: alignment.c:_byteswap_ushort Unexecuted instantiation: unicode.c:_byteswap_ushort Unexecuted instantiation: string.c:_byteswap_ushort Unexecuted instantiation: critical.c:_byteswap_ushort Unexecuted instantiation: event.c:_byteswap_ushort Unexecuted instantiation: wait.c:_byteswap_ushort Unexecuted instantiation: generic.c:_byteswap_ushort Unexecuted instantiation: namedPipeClient.c:_byteswap_ushort Unexecuted instantiation: pattern.c:_byteswap_ushort Unexecuted instantiation: file.c:_byteswap_ushort Unexecuted instantiation: comm.c:_byteswap_ushort Unexecuted instantiation: comm_ioctl.c:_byteswap_ushort Unexecuted instantiation: comm_serial_sys.c:_byteswap_ushort Unexecuted instantiation: comm_sercx_sys.c:_byteswap_ushort Unexecuted instantiation: comm_sercx2_sys.c:_byteswap_ushort Unexecuted instantiation: pipe.c:_byteswap_ushort Unexecuted instantiation: environment.c:_byteswap_ushort Unexecuted instantiation: registry_reg.c:_byteswap_ushort Unexecuted instantiation: path.c:_byteswap_ushort Unexecuted instantiation: shell.c:_byteswap_ushort Unexecuted instantiation: Object.c:_byteswap_ushort Unexecuted instantiation: Queue.c:_byteswap_ushort Unexecuted instantiation: ArrayList.c:_byteswap_ushort Unexecuted instantiation: CountdownEvent.c:_byteswap_ushort Unexecuted instantiation: Layout.c:_byteswap_ushort Unexecuted instantiation: Message.c:_byteswap_ushort Unexecuted instantiation: PacketMessage.c:_byteswap_ushort Unexecuted instantiation: argv.c:_byteswap_ushort Unexecuted instantiation: buffer.c:_byteswap_ushort Unexecuted instantiation: nt.c:_byteswap_ushort Unexecuted instantiation: comm_io.c:_byteswap_ushort Unexecuted instantiation: image.c:_byteswap_ushort |
115 | | |
116 | | #endif /* (__GNUC__ > 4) || ... */ |
117 | | |
118 | 348k | #define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length)) |
119 | 64.0k | #define MoveMemory(Destination, Source, Length) memmove((Destination), (Source), (Length)) |
120 | 2.04k | #define FillMemory(Destination, Length, Fill) memset((Destination), (Fill), (Length)) |
121 | 10.0M | #define ZeroMemory(Destination, Length) memset((Destination), 0, (Length)) |
122 | | |
123 | | #ifdef __cplusplus |
124 | | extern "C" |
125 | | { |
126 | | #endif |
127 | | |
128 | | WINPR_API PVOID SecureZeroMemory(PVOID ptr, size_t cnt); |
129 | | |
130 | | #ifdef __cplusplus |
131 | | } |
132 | | #endif |
133 | | |
134 | | #endif /* _WIN32 */ |
135 | | |
136 | | /* Data Alignment */ |
137 | | |
138 | | WINPR_PRAGMA_DIAG_PUSH |
139 | | WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO |
140 | | |
141 | | #ifndef _ERRNO_T_DEFINED |
142 | | #define _ERRNO_T_DEFINED |
143 | | typedef int errno_t; |
144 | | #endif /* _ERRNO_T_DEFINED */ |
145 | | |
146 | | WINPR_PRAGMA_DIAG_POP |
147 | | |
148 | | #ifndef _WIN32 |
149 | | |
150 | | #ifdef __cplusplus |
151 | | extern "C" |
152 | | { |
153 | | #endif |
154 | | |
155 | | /* Data Conversion */ |
156 | | |
157 | | WINPR_API errno_t _itoa_s(int value, char* buffer, size_t sizeInCharacters, int radix); |
158 | | |
159 | | /* Buffer Manipulation */ |
160 | | |
161 | | WINPR_API errno_t memmove_s(void* dest, size_t numberOfElements, const void* src, size_t count); |
162 | | WINPR_API errno_t wmemmove_s(WCHAR* dest, size_t numberOfElements, const WCHAR* src, |
163 | | size_t count); |
164 | | #ifdef __cplusplus |
165 | | } |
166 | | #endif |
167 | | |
168 | | #endif /* _WIN32 */ |
169 | | |
170 | | #if !defined(_WIN32) || (defined(__MINGW32__) && !defined(_UCRT)) |
171 | | /* note: we use our own implementation of _aligned_XXX function when: |
172 | | * - it's not win32 |
173 | | * - it's mingw with native libs (not ucrt64) because we didn't managed to have it working |
174 | | * and not have C runtime deadly mixes |
175 | | */ |
176 | | #if defined(WINPR_MSVCR_ALIGNMENT_EMULATE) |
177 | | #define _aligned_malloc winpr_aligned_malloc |
178 | | #define _aligned_realloc winpr_aligned_realloc |
179 | | #define _aligned_recalloc winpr_aligned_recalloc |
180 | | #define _aligned_offset_malloc winpr_aligned_offset_malloc |
181 | | #define _aligned_offset_realloc winpr_aligned_offset_realloc |
182 | | #define _aligned_offset_recalloc winpr_aligned_offset_recalloc |
183 | | #define _aligned_msize winpr_aligned_msize |
184 | | #define _aligned_free winpr_aligned_free |
185 | | #endif |
186 | | |
187 | | #ifdef __cplusplus |
188 | | extern "C" |
189 | | { |
190 | | #endif |
191 | | |
192 | | WINPR_API void winpr_aligned_free(void* memblock); |
193 | | |
194 | | WINPR_ATTR_MALLOC(winpr_aligned_free, 1) |
195 | | WINPR_API void* winpr_aligned_malloc(size_t size, size_t alignment); |
196 | | |
197 | | WINPR_ATTR_MALLOC(winpr_aligned_free, 1) |
198 | | WINPR_API void* winpr_aligned_calloc(size_t count, size_t size, size_t alignment); |
199 | | |
200 | | WINPR_ATTR_MALLOC(winpr_aligned_free, 1) |
201 | | WINPR_API void* winpr_aligned_realloc(void* memblock, size_t size, size_t alignment); |
202 | | |
203 | | WINPR_ATTR_MALLOC(winpr_aligned_free, 1) |
204 | | WINPR_API void* winpr_aligned_recalloc(void* memblock, size_t num, size_t size, |
205 | | size_t alignment); |
206 | | |
207 | | WINPR_ATTR_MALLOC(winpr_aligned_free, 1) |
208 | | WINPR_API void* winpr_aligned_offset_malloc(size_t size, size_t alignment, size_t offset); |
209 | | |
210 | | WINPR_ATTR_MALLOC(winpr_aligned_free, 1) |
211 | | WINPR_API void* winpr_aligned_offset_realloc(void* memblock, size_t size, size_t alignment, |
212 | | size_t offset); |
213 | | |
214 | | WINPR_ATTR_MALLOC(winpr_aligned_free, 1) |
215 | | WINPR_API void* winpr_aligned_offset_recalloc(void* memblock, size_t num, size_t size, |
216 | | size_t alignment, size_t offset); |
217 | | |
218 | | WINPR_API size_t winpr_aligned_msize(void* memblock, size_t alignment, size_t offset); |
219 | | |
220 | | #ifdef __cplusplus |
221 | | } |
222 | | #endif |
223 | | |
224 | | #else |
225 | | #define winpr_aligned_malloc _aligned_malloc |
226 | | #define winpr_aligned_realloc _aligned_realloc |
227 | | #define winpr_aligned_recalloc _aligned_recalloc |
228 | | #define winpr_aligned_offset_malloc _aligned_offset_malloc |
229 | | #define winpr_aligned_offset_realloc _aligned_offset_realloc |
230 | | #define winpr_aligned_offset_recalloc _aligned_offset_recalloc |
231 | | #define winpr_aligned_msize _aligned_msize |
232 | | #define winpr_aligned_free _aligned_free |
233 | | #endif /* !defined(_WIN32) || (defined(__MINGW32__) ... */ |
234 | | |
235 | | #if defined(_WIN32) && (!defined(__MINGW32__) || defined(_UCRT)) |
236 | | #define winpr_aligned_calloc(count, size, alignment) _aligned_recalloc(NULL, count, size, alignment) |
237 | | #endif /* defined(_WIN32) && (!defined(__MINGW32__) || defined(_UCRT)) */ |
238 | | |
239 | | // NOLINTEND(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp) |
240 | | WINPR_PRAGMA_DIAG_POP |
241 | | |
242 | | #endif /* WINPR_CRT_H */ |