diff options
author | Andi Gutmans <andi@php.net> | 2000-08-22 17:59:35 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2000-08-22 17:59:35 +0000 |
commit | 0222b7ab416d845abcd3925b3da47fa2d7ed238d (patch) | |
tree | 38cbb73fda38196612fddffda4d803003a86b568 /ext/mysql/libmysql/global.h | |
parent | 60676f19a5f5425c4375d8ba60e8bd07016ba562 (diff) | |
download | php-git-0222b7ab416d845abcd3925b3da47fa2d7ed238d.tar.gz |
- Try and revert libmysql for 4.0.2
Diffstat (limited to 'ext/mysql/libmysql/global.h')
-rw-r--r-- | ext/mysql/libmysql/global.h | 113 |
1 files changed, 21 insertions, 92 deletions
diff --git a/ext/mysql/libmysql/global.h b/ext/mysql/libmysql/global.h index 9cffcbf477..34b45c2418 100644 --- a/ext/mysql/libmysql/global.h +++ b/ext/mysql/libmysql/global.h @@ -1,19 +1,5 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ +/* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB + This file is public domain and comes with NO WARRANTY of any kind */ /* This is the main include file that should included 'first' in every C file. */ @@ -21,19 +7,17 @@ #ifndef _global_h #define _global_h -#if defined(_WIN32) || defined(_WIN64) -#include <config-win.h> +#if defined(__WIN32__) || defined(WIN32) +#include <config-win32.h> #else #include <my_config.h> #endif -#if defined(__cplusplus) -#if defined(inline) -#undef inline /* fix configure problem */ +#if defined(__cplusplus) && defined(inline) +#undef inline /* fix configure problem */ #endif -#endif /* _cplusplus */ /* The client defines this to avoid all thread code */ -#if defined(UNDEF_THREADS_HACK) +#if defined(UNDEF_THREADS_HACK) && !defined(THREAD_SAFE_CLIENT) #undef THREAD #undef HAVE_mit_thread #undef HAVE_LINUXTHREADS @@ -49,11 +33,9 @@ #ifndef __STDC_EXT__ #define __STDC_EXT__ 1 /* To get large file support on hpux */ #endif -#if defined(THREAD) && defined(HAVE_LINUXTHREADS) && defined(HAVE_PTHREAD_RWLOCK_RDLOCK) -#define _GNU_SOURCE 1 -#endif +/* #define _GNU_SOURCE 1 */ /* Get define for strtok_r on Alpha-linux */ -#if defined(THREAD) && !defined(__WIN__) +#if defined(THREAD) && !defined(__WIN32__) #define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ /* was #if defined(HAVE_LINUXTHREADS) || defined(HAVE_DEC_THREADS) || defined(HPUX) */ #if !defined(SCO) @@ -89,36 +71,12 @@ #undef HAVE_PWRITE #endif -#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */ -#undef HAVE_GETHOSTBYNAME_R -#endif -#ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */ -#undef HAVE_INITGROUPS -#endif - /* Fix a bug in gcc 2.8.0 on IRIX 6.2 */ #if SIZEOF_LONG == 4 && defined(__LONG_MAX__) #undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */ #define __LONG_MAX__ 2147483647 #endif -/* egcs 1.1.2 has a problem with memcpy on Alpha */ -#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -#define BAD_MEMCPY -#endif - -/* In Linux-alpha we have atomic.h if we are using gcc */ -#if defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && defined(__alpha__) && (__GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -#define HAVE_ATOMIC_ADD -#define HAVE_ATOMIC_SUB -#endif - -/* In Linux-ia64 including atomic.h will give us an error */ -#if defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && defined(__ia64__) -#undef HAVE_ATOMIC_ADD -#undef HAVE_ATOMIC_SUB -#endif - #if defined(_lint) && !defined(lint) #define lint #endif @@ -173,10 +131,6 @@ #ifdef HAVE_ALLOCA_H #include <alloca.h> #endif -#ifdef HAVE_ATOMIC_ADD -#define __SMP__ -#include <asm/atomic.h> -#endif /* Go around some bugs in different OS and compilers */ #if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) @@ -213,7 +167,6 @@ #endif /* Define void to stop lint from generating "null effekt" comments */ -#ifndef DONT_DEFINE_VOID #ifdef _lint int __void__; #define VOID(X) (__void__ = (int) (X)) @@ -221,7 +174,6 @@ int __void__; #undef VOID #define VOID(X) (X) #endif -#endif /* DONT_DEFINE_VOID */ #if defined(_lint) || defined(FORCE_INIT_OF_VARS) #define LINT_INIT(var) var=0 /* No uninitialize-warning */ @@ -290,11 +242,6 @@ typedef unsigned short ushort; #endif #include <dbug.h> -#ifndef DBUG_OFF -#define dbug_assert(A) assert(A) -#else -#define dbug_assert(A) -#endif #define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/ #define ASCII_BITS_USED 8 /* Bit char used */ @@ -331,7 +278,7 @@ typedef int (*qsort_cmp)(const void *,const void *); #define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */ #endif #ifdef HAVE_mit_thread -#define size_socket socklen_t /* Type of last arg to accept */ +typedef int size_socket; /* Type of last arg to accept */ #else #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> @@ -412,7 +359,7 @@ typedef SOCKET_SIZE_TYPE size_socket; #define NO_PISAM /* Not needed anymore */ #define NO_MISAM /* Not needed anymore */ #define NO_HASH /* Not needed anymore */ -#ifdef __WIN__ +#ifdef __WIN32__ #define NO_DIR_LIBRARY /* Not standar dir-library */ #define USE_MY_STAT_STRUCT /* For my_lib */ #endif @@ -434,7 +381,7 @@ extern void init_my_atof(void); extern double my_atof(const char*); #endif #undef remove /* Crashes MySQL on SCO 5.0.0 */ -#ifndef __WIN__ +#ifndef __WIN32__ #define closesocket(A) close(A) #ifndef ulonglong2double #define ulonglong2double(A) ((double) (A)) @@ -454,7 +401,7 @@ extern double my_atof(const char*); #ifdef HAVE_LINUXTHREADS /* #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) */ -/* #define sigset(A,B) signal((A),(B)) */ +#define sigset(A,B) signal((A),(B)) #endif /* Remove some things that mit_thread break or doesn't support */ @@ -523,8 +470,6 @@ typedef long my_ptrdiff_t; #define NEAR /* Who needs segments ? */ #define FAR /* On a good machine */ #define HUGE_PTR -#endif -#ifndef STDCALL #define STDCALL #endif @@ -582,9 +527,7 @@ typedef long longlong; #endif #undef SIZEOF_OFF_T #define SIZEOF_OFF_T 8 -#else -#define SYSTEM_SIZEOF_OFF_T SIZEOF_OFF_T -#endif /* USE_RAID */ +#endif #if SIZEOF_OFF_T > 4 typedef ulonglong my_off_t; @@ -592,9 +535,7 @@ typedef ulonglong my_off_t; typedef unsigned long my_off_t; #endif #define MY_FILEPOS_ERROR (~(my_off_t) 0) -#ifndef __WIN__ -typedef off_t os_off_t; -#endif +/*typedef off_t os_off_t;*/ typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */ typedef short int15; /* Most effective integer 0 <= x <= 32767 */ @@ -782,8 +723,8 @@ typedef char bool; /* Ordinary boolean values 0 1 */ ((byte*) &def_temp)[7]=(M)[0];\ (V) = def_temp; } #else -#define float4get(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float)) -#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float)) +#define float4get(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float)) +#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) #define float8get(V,M) doubleget((V),(M)) #define float8store(V,M) doublestore((V),(M)) #endif /* WORDS_BIGENDIAN */ @@ -834,24 +775,12 @@ typedef char bool; /* Ordinary boolean values 0 1 */ #define shortstore(T,V) int2store(T,V) #define longstore(T,V) int4store(T,V) #ifndef doubleget -#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) -#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double)) +#define doubleget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(double)) +#define doublestore(T,V) memcpy((byte*) (T),(byte*) &V,sizeof(double)) #endif -#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong)) -#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong)) +#define longlongget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(ulonglong)) +#define longlongstore(T,V) memcpy((byte*) (T),(byte*) &V,sizeof(ulonglong)) #endif /* WORDS_BIGENDIAN */ -/* sprintf does not always return the number of bytes :- */ -#ifdef SPRINTF_RETURNS_INT -#define my_sprintf(buff,args) sprintf args -#else -#ifdef SPRINTF_RETURNS_PTR -#define my_sprintf(buff,args) ((int)(sprintf args - buff)) -#else -#define my_sprintf(buff,args) sprintf args,strlen(buff) -#endif -#endif - - #endif /* _global_h */ |