os: macro for marking struct fields xserver-internal

Several drivers still accessing internal struct field they shouldn't,
eg. directly calling or manipulating low level proc vectors, while
there are higher level functions for that.

Introducing a macro for marking struct fields internal, so the compiler
spits out a deprecation warning when those are accessed by drivers
directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-02-10 17:14:01 +01:00
parent 3562298068
commit b4502bb6ff
2 changed files with 8 additions and 0 deletions

View File

@ -84,6 +84,12 @@ typedef struct _NewClientRec *NewClientPtr;
#include <stdio.h>
#include <stdarg.h>
#ifdef _INSIDE_XSERVER
#define _X_XSERVER_INTERNAL(msg)
#else
#define _X_XSERVER_INTERNAL(msg) _X_DEPRECATED_MSG(msg)
#endif
extern _X_EXPORT int ReadRequestFromClient(ClientPtr /*client */ );
extern _X_EXPORT int ReadFdFromClient(ClientPtr client);

View File

@ -9,6 +9,8 @@ project('xserver', 'c',
release_date = '2021-07-05'
add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc'])
add_project_arguments('-D_INSIDE_XSERVER', language: ['c', 'objc'])
cc = meson.get_compiler('c')
add_project_arguments('-fno-strict-aliasing', language : 'c')