summaryrefslogtreecommitdiff
path: root/ext/mysql/libmysql
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-02-23 21:10:18 +0000
committerAndi Gutmans <andi@php.net>2000-02-23 21:10:18 +0000
commitde6c9f35a1caa5e76d830b341d099007e3b68a9b (patch)
treefe4baddbac349a6225791bda364b8a257baaedf0 /ext/mysql/libmysql
parentccc386c8e38d7b1aba52ee43164e326d721f0517 (diff)
downloadphp-git-de6c9f35a1caa5e76d830b341d099007e3b68a9b.tar.gz
- MySQL now compiles right into the PHP 4 binary on Windows
Diffstat (limited to 'ext/mysql/libmysql')
-rw-r--r--ext/mysql/libmysql/libmysql.dsp433
-rw-r--r--ext/mysql/libmysql/my_wincond.c139
2 files changed, 548 insertions, 24 deletions
diff --git a/ext/mysql/libmysql/libmysql.dsp b/ext/mysql/libmysql/libmysql.dsp
index 4eaea585c8..1630067bb6 100644
--- a/ext/mysql/libmysql/libmysql.dsp
+++ b/ext/mysql/libmysql/libmysql.dsp
@@ -4,7 +4,7 @@
# TARGTYPE "Win32 (x86) Static Library" 0x0104
-CFG=libmysql - Win32 Debug
+CFG=libmysql - Win32 Debug_TS
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
@@ -13,12 +13,13 @@ CFG=libmysql - Win32 Debug
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
-!MESSAGE NMAKE /f "libmysql.mak" CFG="libmysql - Win32 Debug"
+!MESSAGE NMAKE /f "libmysql.mak" CFG="libmysql - Win32 Debug_TS"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "libmysql - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "libmysql - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "libmysql - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
+!MESSAGE "libmysql - Win32 Release_TS" (based on "Win32 (x86) Static Library")
+!MESSAGE "libmysql - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
@@ -28,20 +29,43 @@ CFG=libmysql - Win32 Debug
CPP=cl.exe
RSC=rc.exe
-!IF "$(CFG)" == "libmysql - Win32 Release"
+!IF "$(CFG)" == "libmysql - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "__WIN32__" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "__WIN32__" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "libmysql - Win32 Release_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "Release_TS"
+# PROP Intermediate_Dir "Release_TS"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE CPP /nologo /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "__WIN32__" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "__WIN32__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -51,22 +75,22 @@ LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
-!ELSEIF "$(CFG)" == "libmysql - Win32 Debug"
+!ELSEIF "$(CFG)" == "libmysql - Win32 Release_TS_inline"
# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "libmysql___Win32_Debug"
-# PROP BASE Intermediate_Dir "libmysql___Win32_Debug"
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS_inline"
+# PROP BASE Intermediate_Dir "Release_TS_inline"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "libmysql___Win32_Debug"
-# PROP Intermediate_Dir "libmysql___Win32_Debug"
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_TS_inline"
+# PROP Intermediate_Dir "Release_TS_inline"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
+# ADD BASE CPP /nologo /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "__WIN32__" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "__WIN32__" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
@@ -78,15 +102,376 @@ LIB32=link.exe -lib
# Begin Target
-# Name "libmysql - Win32 Release"
-# Name "libmysql - Win32 Debug"
+# Name "libmysql - Win32 Debug_TS"
+# Name "libmysql - Win32 Release_TS"
+# Name "libmysql - Win32 Release_TS_inline"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\array.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\bchange.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\bmove.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\bmove_upp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ct_init.c
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-latin1.c"
+# End Source File
+# Begin Source File
+
+SOURCE=.\dbug.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\default.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\dll.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\errmsg.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\errors.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\get_password.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\int2str.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\is_prefix.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libmysql.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\list.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\longlong2str.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mf_casecnv.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mf_dirname.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mf_fn_ext.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mf_format.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mf_loadpath.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mf_pack.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mf_path.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mf_unixpath.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mf_wcomp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mulalloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_alloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_compress.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_create.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_delete.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_div.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_error.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_fopen.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_getwd.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_init.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_malloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_messnc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_net.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_once.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_pthread.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_read.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_realloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_static.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_tempnam.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_thr_init.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_wincond.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_write.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\net.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\password.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\safemalloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\str2int.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strcend.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strcont.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strend.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strfill.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\string.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strinstr.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strmake.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strmov.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strnmov.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strtoll.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strtoull.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strxmov.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\thr_mutex.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\typelib.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\violite.c
+# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\acconfig.h
+# End Source File
+# Begin Source File
+
+SOURCE=".\config-win32.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\dbug.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\errmsg.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\global.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\m_ctype.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\m_string.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_alarm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_dir.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_list.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_net.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_pthread.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_static.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_sys.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mysql.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mysql_com.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mysql_version.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mysqld_error.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mysys_err.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mysys_priv.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\thr_alarm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\violite.h
+# End Source File
# End Group
# End Target
# End Project
diff --git a/ext/mysql/libmysql/my_wincond.c b/ext/mysql/libmysql/my_wincond.c
new file mode 100644
index 0000000000..f33a197298
--- /dev/null
+++ b/ext/mysql/libmysql/my_wincond.c
@@ -0,0 +1,139 @@
+/* Copyright (C) 2000 Monty Program KB
+
+ This software is distributed with NO WARRANTY OF ANY KIND. No author or
+ distributor accepts any responsibility for the consequences of using it, or
+ for whether it serves any particular purpose or works at all, unless he or
+ she says so in writing. Refer to the Free Public License (the "License")
+ for full details.
+
+ Every copy of this file must include a copy of the License, normally in a
+ plain ASCII text file named PUBLIC. The License grants you the right to
+ copy, modify and redistribute this file, but only under certain conditions
+ described in the License. Among other things, the License requires that
+ the copyright notice and this notice be preserved on all copies. */
+
+
+/*****************************************************************************
+** The following is a simple implementation of posix conditions
+*****************************************************************************/
+
+#include "mysys_priv.h"
+#if defined(THREAD) && defined(__WIN32__)
+#include <m_string.h>
+#undef getpid
+#include <process.h>
+#include <sys/timeb.h>
+
+int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
+{
+ cond->waiting=0;
+ cond->semaphore=CreateSemaphore(NULL,0,0x7FFFFFFF,NullS);
+ if (!cond->semaphore)
+ return ENOMEM;
+ return 0;
+}
+
+int pthread_cond_destroy(pthread_cond_t *cond)
+{
+ return CloseHandle(cond->semaphore) ? 0 : EINVAL;
+}
+
+
+int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
+{
+ InterlockedIncrement(&cond->waiting);
+ LeaveCriticalSection(mutex);
+ WaitForSingleObject(cond->semaphore,INFINITE);
+ InterlockedDecrement(&cond->waiting);
+ EnterCriticalSection(mutex);
+ return 0 ;
+}
+
+int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+ struct timespec *abstime)
+{
+ struct _timeb curtime;
+ int result;
+ long timeout;
+ _ftime(&curtime);
+ timeout= ((long) (abstime->tv_sec - curtime.time)*1000L +
+ (long)((abstime->tv_nsec/1000) - curtime.millitm)/1000L);
+ if (timeout < 0) /* Some safety */
+ timeout = 0L;
+ InterlockedIncrement(&cond->waiting);
+ LeaveCriticalSection(mutex);
+ result=WaitForSingleObject(cond->semaphore,timeout);
+ InterlockedDecrement(&cond->waiting);
+ EnterCriticalSection(mutex);
+
+ return result == WAIT_TIMEOUT ? ETIMEDOUT : 0;
+}
+
+
+int pthread_cond_signal(pthread_cond_t *cond)
+{
+ long prev_count;
+ if (cond->waiting)
+ ReleaseSemaphore(cond->semaphore,1,&prev_count);
+ return 0;
+}
+
+
+int pthread_cond_broadcast(pthread_cond_t *cond)
+{
+ long prev_count;
+ if (cond->waiting)
+ ReleaseSemaphore(cond->semaphore,cond->waiting,&prev_count);
+ return 0 ;
+}
+
+
+int pthread_attr_init(pthread_attr_t *connect_att)
+{
+ connect_att->dwStackSize = 0;
+ connect_att->dwCreatingFlag = 0;
+ connect_att->priority = 0;
+ return 0;
+}
+
+int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack)
+{
+ connect_att->dwStackSize=stack;
+ return 0;
+}
+
+int pthread_attr_setprio(pthread_attr_t *connect_att,int priority)
+{
+ connect_att->priority=priority;
+ return 0;
+}
+
+int pthread_attr_destroy(pthread_attr_t *connect_att)
+{
+ bzero((gptr) connect_att,sizeof(*connect_att));
+ return 0;
+}
+
+/****************************************************************************
+** Fix localtime_r() to be a bit safer
+****************************************************************************/
+
+struct tm *localtime_r(const time_t *timep,struct tm *tmp)
+{
+ if (*timep == (time_t) -1) /* This will crash win32 */
+ {
+ bzero(tmp,sizeof(*tmp));
+ }
+ else
+ {
+ struct tm *res=localtime(timep);
+ if (!res) /* Wrong date */
+ {
+ bzero(tmp,sizeof(*tmp)); /* Keep things safe */
+ return 0;
+ }
+ *tmp= *res;
+ }
+ return tmp;
+}
+#endif /* __WIN32__ */