Back to index

php5  5.3.10
config-win.h
Go to the documentation of this file.
00001 /* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB 
00002 This file is public domain and comes with NO WARRANTY of any kind */
00003 
00004 /* Defines for Win32 to make it compatible for MySQL */
00005 
00006 #ifndef _MYSQLND_CONFIG_WIN_H
00007 #define _MYSQLND_CONFIG_WIN_H
00008 
00009 #include <sys/locking.h>
00010 #include <windows.h>
00011 #include <math.h>                  /* Because of rint() */
00012 #include <fcntl.h>
00013 #include <io.h>
00014 #include <malloc.h>
00015 
00016 #include <win32/php_stdint.h>
00017 
00018 #ifndef HAVE_INT8_T
00019 #define HAVE_INT8_T
00020 #endif
00021 #ifndef HAVE_UINT8_T
00022 #define HAVE_UINT8_T
00023 #endif
00024 #ifndef HAVE_INT16_T
00025 #define HAVE_INT16_T
00026 #endif
00027 #ifndef HAVE_UINT16_T
00028 #define HAVE_UINT16_T
00029 #endif
00030 #ifndef HAVE_INT32_T
00031 #define HAVE_INT32_T
00032 #endif
00033 #ifndef HAVE_UINT32_T
00034 #define HAVE_UINT32_T
00035 #endif
00036 #ifndef HAVE_INT64_T
00037 #define HAVE_INT64_T
00038 #endif
00039 #ifndef HAVE_UINT64_T
00040 #define HAVE_UINT64_T
00041 #endif
00042 
00043 
00044 #ifndef _WIN64
00045 #ifndef _WIN32
00046 #define _WIN32                            /* Compatible with old source */
00047 #endif
00048 #ifndef __WIN32__
00049 #define __WIN32__
00050 #endif
00051 #endif /* _WIN64 */
00052 #ifndef __WIN__
00053 #define __WIN__                           /* To make it easier in VC++ */
00054 #endif
00055 
00056 /* Type information */
00057 
00058 #define SIZEOF_CHAR         1
00059 #define SIZEOF_LONG         4
00060 #define SIZEOF_LONG_LONG    8
00061 
00062 
00063 #ifndef _WIN64
00064 /* Optimized store functions for Intel x86 */
00065 
00066 #define sint2korr(A) (*((int16_t *) (A)))
00067 #define sint3korr(A) ((int32_t) ((((zend_uchar) (A)[2]) & 128) ? \
00068                                                                       (((uint32_t) 255L << 24) | \
00069                                                                       (((uint32_t) (zend_uchar) (A)[2]) << 16) |\
00070                                                                       (((uint32_t) (zend_uchar) (A)[1]) << 8) | \
00071                                                                       ((uint32_t) (zend_uchar) (A)[0])) : \
00072                                                                       (((uint32_t) (zend_uchar) (A)[2]) << 16) |\
00073                                                                       (((uint32_t) (zend_uchar) (A)[1]) << 8) | \
00074                                                                       ((uint32_t) (zend_uchar) (A)[0])))
00075 #define sint4korr(A) (*((int32_t *) (A)))
00076 #define uint2korr(A) (*((uint16_t *) (A)))
00077 #define uint3korr(A) (int32_t) (*((uint32_t *) (A)) & 0xFFFFFF)
00078 #define uint4korr(A) (*((uint32_t *) (A)))
00079 #define uint5korr(A) ((uint64_t)(((uint32_t) ((zend_uchar) (A)[0])) +\
00080                                                                (((uint32_t) ((zend_uchar) (A)[1])) << 8) +\
00081                                                                (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\
00082                                                                (((uint32_t) ((zend_uchar) (A)[3])) << 24)) +\
00083                                                                (((uint64_t) ((zend_uchar) (A)[4])) << 32))
00084 #define uint8korr(A) (*((uint64_t *) (A)))
00085 #define sint8korr(A) (*((int64_t *) (A)))
00086 #define int2store(T,A)      *((uint16_t*) (T))= (uint16_t) (A)
00087 #define int3store(T,A)             {      *(T)=  (zend_uchar) ((A));\
00088                                                         *(T+1)=(zend_uchar) (((uint32_t) (A) >> 8));\
00089                                                         *(T+2)=(zend_uchar) (((A) >> 16)); }
00090 #define int4store(T,A)      *((int32_t *) (T))= (int32_t) (A)
00091 #define int5store(T,A)      {      *(T)= (zend_uchar)((A));\
00092                                                  *((T)+1)=(zend_uchar) (((A) >> 8));\
00093                                                  *((T)+2)=(zend_uchar) (((A) >> 16));\
00094                                                  *((T)+3)=(zend_uchar) (((A) >> 24)); \
00095                                                  *((T)+4)=(zend_uchar) (((A) >> 32)); }
00096 #define int8store(T,A)      *((uint64_t *) (T))= (uint64_t) (A)
00097 
00098 #define float8get(V,M)      {      *((int32_t *) &V) = *((int32_t*) M); \
00099                                                  *(((int32_t *) &V)+1) = *(((int32_t*) M)+1); }
00100 #define float8store(T,V) {  *((int32_t *) T) = *((int32_t*) &V); \
00101                                                  *(((int32_t *) T)+1) = *(((int32_t*) &V)+1); }
00102 #define float4get(V,M) { *((int32_t *) &(V)) = *((int32_t*) (M)); }
00103 
00104 #endif /* _WIN64 */
00105 
00106 #endif /* _MYSQLND_CONFIG_WIN_H */
00107 
00108 /*
00109  * Local variables:
00110  * tab-width: 4
00111  * c-basic-offset: 4
00112  * End:
00113  * vim600: noet sw=4 ts=4 fdm=marker
00114  * vim<600: noet sw=4 ts=4
00115  */