aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/include
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/include')
-rw-r--r--xorg-server/include/dix-config.h.in12
-rwxr-xr-xxorg-server/include/os.h31
-rwxr-xr-xxorg-server/include/servermd.h2
-rw-r--r--xorg-server/include/xorg-server.h.in3
4 files changed, 42 insertions, 6 deletions
diff --git a/xorg-server/include/dix-config.h.in b/xorg-server/include/dix-config.h.in
index 1aa77a5eb..76f45f535 100644
--- a/xorg-server/include/dix-config.h.in
+++ b/xorg-server/include/dix-config.h.in
@@ -149,6 +149,9 @@
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
+/* Define to 1 if you have the `reallocarray' function. */
+#undef HAVE_REALLOCARRAY
+
/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
#undef HAVE_RPCSVC_DBM_H
@@ -388,9 +391,15 @@
/* Vendor name */
#undef XVENDORNAME
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
/* Enable GNU and other extensions to the C environment for GLIBC */
#undef _GNU_SOURCE
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
@@ -454,9 +463,6 @@
/* Define to __typeof__ if your compiler spells it that way. */
#undef typeof
-/* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */
-#undef TLS
-
/* Correctly set _XSERVER64 for OSX fat binaries */
#ifdef __APPLE__
#include "dix-config-apple-verbatim.h"
diff --git a/xorg-server/include/os.h b/xorg-server/include/os.h
index cee8f3c90..ede9707e8 100755
--- a/xorg-server/include/os.h
+++ b/xorg-server/include/os.h
@@ -69,11 +69,15 @@ typedef struct _NewClientRec *NewClientPtr;
#ifndef xnfalloc
#define xnfalloc(size) XNFalloc((unsigned long)(size))
-#define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size))
+#define xnfcalloc(_num, _size) XNFcallocarray((_num), (_size))
#define xnfrealloc(ptr, size) XNFrealloc((void *)(ptr), (unsigned long)(size))
#define xstrdup(s) Xstrdup(s)
#define xnfstrdup(s) XNFstrdup(s)
+
+#define xallocarray(num, size) reallocarray(NULL, (num), (size))
+#define xnfallocarray(num, size) XNFreallocarray(NULL, (num), (size))
+#define xnfreallocarray(ptr, num, size) XNFreallocarray((ptr), (num), (size))
#endif
#include <stdio.h>
@@ -224,7 +228,14 @@ XNFalloc(unsigned long /*amount */ );
* enough memory.
*/
extern _X_EXPORT void *
-XNFcalloc(unsigned long /*amount */ );
+XNFcalloc(unsigned long /*amount */ ) _X_DEPRECATED;
+
+/*
+ * This function calloc(3)s buffer, terminating the server if there is not
+ * enough memory or the arguments overflow when multiplied
+ */
+extern _X_EXPORT void *
+XNFcallocarray(size_t nmemb, size_t size);
/*
* This function realloc(3)s passed buffer, terminating the server if there is
@@ -234,6 +245,13 @@ extern _X_EXPORT void *
XNFrealloc(void * /*ptr */ , unsigned long /*amount */ );
/*
+ * This function reallocarray(3)s passed buffer, terminating the server if
+ * there is not enough memory or the arguments overflow when multiplied.
+ */
+extern _X_EXPORT void *
+XNFreallocarray(void *ptr, size_t nmemb, size_t size);
+
+/*
* This function strdup(3)s passed string. The only difference from the library
* function that it is safe to pass NULL, as NULL will be returned.
*/
@@ -512,7 +530,14 @@ ddxGiveUp(enum ExitCode error);
extern _X_EXPORT int
TimeSinceLastInputEvent(void);
-/* strcasecmp.c */
+/* Function fallbacks provided by AC_REPLACE_FUNCS in configure.ac */
+
+#ifndef HAVE_REALLOCARRAY
+#define reallocarray xreallocarray
+extern _X_EXPORT void *
+reallocarray(void *optr, size_t nmemb, size_t size);
+#endif
+
#ifndef HAVE_STRCASECMP
#define strcasecmp xstrcasecmp
extern _X_EXPORT int
diff --git a/xorg-server/include/servermd.h b/xorg-server/include/servermd.h
index 6aeed8248..8577e88f9 100755
--- a/xorg-server/include/servermd.h
+++ b/xorg-server/include/servermd.h
@@ -52,6 +52,8 @@ SOFTWARE.
#error xserver code must include dix-config.h before any other headers
#endif
+#include <X11/Xarch.h> /* for X_LITTLE_ENDIAN/X_BIG_ENDIAN */
+
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
diff --git a/xorg-server/include/xorg-server.h.in b/xorg-server/include/xorg-server.h.in
index 4cb94875c..3152dbd68 100644
--- a/xorg-server/include/xorg-server.h.in
+++ b/xorg-server/include/xorg-server.h.in
@@ -47,6 +47,9 @@
/* Define to 1 if you have the `ffs' function. */
#undef HAVE_FFS
+/* Define to 1 if you have the `reallocarray' function. */
+#undef HAVE_REALLOCARRAY
+
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP