On MacOS, stdint.h is provided by the compiler for C, and by
the SDK for C++.
OSX 14.4 appears to define char16_t and char32_t within stdint.h for
C++. Defining them again results in:
```
../common/arch.h:53:24: error: cannot combine with previous 'type-name' declaration specifier
typedef uint_least16_t char16_t;
^
../common/arch.h:53:1: warning: typedef requires a name [-Wmissing-declarations]
typedef uint_least16_t char16_t;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../common/arch.h:54:24: error: cannot combine with previous 'type-name' declaration specifier
typedef uint_least32_t char32_t;
^
../common/arch.h:54:1: warning: typedef requires a name [-Wmissing-declarations]
typedef uint_least32_t char32_t;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This commit addresses cppcheck errors such as the following:
portability: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS]
Affected variable types are replaced with corresponding unsigned types
This commit addresses these kind of errors:
portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB]
Reason is that C does not guarantee that all pointer types are the same
size. See C99 6.2.5(27). cppcheck requires some sort of cast when NULL
is used as the last argument in a variadic list.
When using UDS mode for VNC, the following error has been reported:
[WARN ] Cannot write VNC password hash to file (null): Bad address
This prevents an attempt to create a file with a NULL name.
- Removes all redundant NULL checks as per latest feedback.
- Retains C99 inline variable declarations.
- Finalizes local variable snapshotting for race condition safety.
the N policy in sesman.ini, allowing xrdp sessions to be tagged with an
instance name to enable persistent association with a specific
xrdp instance, to allow experiences where users reconnect to specific
sessions based on e.g. the xrdp listening port used.
Functions are added to xrdpapi to allows the connection status
to be determimed. These functions are modelled on the Windows API
functions, but are not compatible with them. In particular, the error
handling is different.
A way for an application to receive events is also provided. At present,
only connect/disconnected events are implemented.
The sys/signal.h is essentially a redirect to signal.h, without further
logic. However when using musl libc, a warning (which is treated as an error)
is also emitted about this:
| /usr/include/sys/signal.h:1:2: error: #warning redirecting incorrect #include <sys/signal.h> to <signal.h> [-Werror=cpp]
| 1 | #warning redirecting incorrect #include <sys/signal.h> to <signal.h>
Remove sys/signal.h header to solve the problem - the signal.h header is already
included in this file.
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>