diff options
Diffstat (limited to 'xorg-server/include/misc.h')
-rw-r--r-- | xorg-server/include/misc.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h index 7f7f221a8..406ced8af 100644 --- a/xorg-server/include/misc.h +++ b/xorg-server/include/misc.h @@ -79,6 +79,16 @@ OF THIS SOFTWARE. #include <stddef.h> #include <stdint.h> +#include <unistd.h> + +#ifdef _MSC_VER +#define inline __inline +#include <math.h> +static double __inline trunc(double d) +{ + return (d>0) ? floor(d) : ceil(d) ; +} +#endif #ifndef MAXSCREENS #define MAXSCREENS 16 @@ -86,7 +96,7 @@ OF THIS SOFTWARE. #ifndef MAXGPUSCREENS #define MAXGPUSCREENS 16 #endif -#define MAXCLIENTS 256 +#define MAXCLIENTS 1024 #define MAXEXTENSIONS 128 #define MAXFORMATS 8 #define MAXDEVICES 40 /* input devices */ @@ -173,9 +183,9 @@ lswaps(uint16_t x) #include <math.h> #undef MAXSHORT -#define MAXSHORT SHRT_MAX +#define MAXSHORT 32767 #undef MINSHORT -#define MINSHORT SHRT_MIN +#define MINSHORT -32768 #undef MAXINT #define MAXINT INT_MAX #undef MININT @@ -203,7 +213,7 @@ lswaps(uint16_t x) * @param bits The minimum number of bits needed. * @return The number of bytes needed to hold bits. */ -static inline int +static __inline int bits_to_bytes(const int bits) { return ((bits + 7) >> 3); @@ -215,7 +225,7 @@ bits_to_bytes(const int bits) * @param bytes The minimum number of bytes needed. * @return The number of 4-byte units needed to hold bytes. */ -static inline int +static __inline int bytes_to_int32(const int bytes) { return (((bytes) + 3) >> 2); @@ -226,7 +236,7 @@ bytes_to_int32(const int bytes) * @param bytes The minimum number of bytes needed. * @return The closest multiple of 4 that is equal or higher than bytes. */ -static inline int +static __inline int pad_to_int32(const int bytes) { return (((bytes) + 3) & ~3); @@ -391,7 +401,7 @@ extern _X_EXPORT unsigned long serverGeneration; do { if (cond) { \ ErrorFSigSafe("BUG: triggered 'if (" #cond ")'\n"); \ ErrorFSigSafe("BUG: %s:%u in %s()\n", \ - __FILE__, __LINE__, __func__); \ + __FILE__, __LINE__, __FUNCTION__); \ if (with_msg) ErrorFSigSafe(__VA_ARGS__); \ xorg_backtrace(); \ } } while(0) |