Skip to content

Commit ba2502b

Browse files
author
brian@zim.(none)
committed
Another long patch to remove the rest of the OS2 support.
1 parent 36b897f commit ba2502b

31 files changed

+41
-341
lines changed

include/config-win.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ functions */
122122

123123
/* Type information */
124124

125-
#if defined(__EMX__) || !defined(HAVE_UINT)
125+
#if !defined(HAVE_UINT)
126126
#undef HAVE_UINT
127127
#define HAVE_UINT
128128
typedef unsigned short ushort;
129129
typedef unsigned int uint;
130-
#endif /* defined(__EMX__) || !defined(HAVE_UINT) */
130+
#endif /* !defined(HAVE_UINT) */
131131

132132
typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */
133133
typedef __int64 longlong;

include/errmsg.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ extern const char *client_errors[]; /* Error messages */
2929

3030
#define CR_MIN_ERROR 2000 /* For easier client code */
3131
#define CR_MAX_ERROR 2999
32-
#if defined(OS2) && defined(MYSQL_SERVER)
33-
#define CER(X) client_errors[(X)-CR_MIN_ERROR]
34-
#elif !defined(ER)
32+
#if !defined(ER)
3533
#define ER(X) client_errors[(X)-CR_MIN_ERROR]
3634
#endif
3735
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */

include/m_string.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
# define bmove_align(A,B,C) memcpy((A),(B),(C))
8585
#endif
8686

87-
#if defined(__cplusplus) && !defined(OS2)
87+
#if defined(__cplusplus)
8888
extern "C" {
8989
#endif
9090

@@ -256,7 +256,7 @@ extern int my_vsnprintf( char *str, size_t n,
256256
const char *format, va_list ap );
257257
extern int my_snprintf(char* to, size_t n, const char* fmt, ...);
258258

259-
#if defined(__cplusplus) && !defined(OS2)
259+
#if defined(__cplusplus)
260260
}
261261
#endif
262262
#endif

include/my_global.h

+3-24
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
#endif
255255
#endif
256256

257-
#if defined(THREAD) && !defined(__WIN__) && !defined(OS2)
257+
#if defined(THREAD) && !defined(__WIN__)
258258
#ifndef _POSIX_PTHREAD_SEMANTICS
259259
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
260260
#endif
@@ -459,9 +459,7 @@ extern "C" int madvise(void *addr, size_t len, int behav);
459459
#define POSIX_MISTAKE 1 /* regexp: Fix stupid spec error */
460460
#define USE_REGEX 1 /* We want the use the regex library */
461461
/* Do not define for ultra sparcs */
462-
#ifndef OS2
463462
#define USE_BMOVE512 1 /* Use this unless system bmove is faster */
464-
#endif
465463

466464
#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */
467465
#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */
@@ -506,7 +504,7 @@ int __void__;
506504
#define min(a, b) ((a) < (b) ? (a) : (b))
507505
#endif
508506

509-
#if defined(__EMX__) || !defined(HAVE_UINT)
507+
#if !defined(HAVE_UINT)
510508
#undef HAVE_UINT
511509
#define HAVE_UINT
512510
typedef unsigned int uint;
@@ -684,14 +682,9 @@ typedef SOCKET_SIZE_TYPE size_socket;
684682
#define FN_DEVCHAR ':'
685683

686684
#ifndef FN_LIBCHAR
687-
#ifdef __EMX__
688-
#define FN_LIBCHAR '\\'
689-
#define FN_ROOTDIR "\\"
690-
#else
691685
#define FN_LIBCHAR '/'
692686
#define FN_ROOTDIR "/"
693687
#endif
694-
#endif
695688
#define MY_NFILE 64 /* This is only used to save filenames */
696689
#ifndef OS_FILE_LIMIT
697690
#define OS_FILE_LIMIT 65535
@@ -738,11 +731,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
738731

739732
#undef remove /* Crashes MySQL on SCO 5.0.0 */
740733
#ifndef __WIN__
741-
#ifdef OS2
742-
#define closesocket(A) soclose(A)
743-
#else
744734
#define closesocket(A) close(A)
745-
#endif
746735
#ifndef ulonglong2double
747736
#define ulonglong2double(A) ((double) (ulonglong) (A))
748737
#define my_off_t2double(A) ((double) (my_off_t) (A))
@@ -951,7 +940,7 @@ typedef ulonglong my_off_t;
951940
typedef unsigned long my_off_t;
952941
#endif
953942
#define MY_FILEPOS_ERROR (~(my_off_t) 0)
954-
#if !defined(__WIN__) && !defined(OS2)
943+
#if !defined(__WIN__)
955944
typedef off_t os_off_t;
956945
#endif
957946

@@ -964,16 +953,6 @@ typedef off_t os_off_t;
964953
#define SOCKET_EADDRINUSE WSAEADDRINUSE
965954
#define SOCKET_ENFILE ENFILE
966955
#define SOCKET_EMFILE EMFILE
967-
#elif defined(OS2)
968-
#define socket_errno sock_errno()
969-
#define SOCKET_EINTR SOCEINTR
970-
#define SOCKET_EAGAIN SOCEINPROGRESS
971-
#define SOCKET_ETIMEDOUT SOCKET_EINTR
972-
#define SOCKET_EWOULDBLOCK SOCEWOULDBLOCK
973-
#define SOCKET_EADDRINUSE SOCEADDRINUSE
974-
#define SOCKET_ENFILE SOCENFILE
975-
#define SOCKET_EMFILE SOCEMFILE
976-
#define closesocket(A) soclose(A)
977956
#else /* Unix */
978957
#define socket_errno errno
979958
#define closesocket(A) close(A)

include/my_net.h

-6
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ C_MODE_START
5353
#endif
5454
#endif
5555

56-
#if defined(__EMX__)
57-
#include <sys/ioctl.h>
58-
#define ioctlsocket(A,B,C) ioctl((A),(B),(void *)(C),sizeof(*(C)))
59-
#undef HAVE_FCNTL
60-
#endif /* defined(__EMX__) */
61-
6256
#if defined(MSDOS) || defined(__WIN__)
6357
#define O_NONBLOCK 1 /* For emulation of fcntl() */
6458
#endif

include/my_no_pthread.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
even in non-threaded builds.
2727
Case in point: 'mf_keycache.c'
2828
*/
29-
#if defined(__WIN__) || defined(OS2)
29+
#if defined(__WIN__)
3030

3131
#elif defined(HAVE_UNIXWARE7_THREADS)
3232
/* #include <thread.h> Currently, not relevant. Enable if needed. */

include/my_pthread.h

+3-42
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,9 @@ extern "C" {
3131
#define EXTERNC
3232
#endif /* __cplusplus */
3333

34-
#if defined(__WIN__) || defined(OS2)
34+
#if defined(__WIN__)
3535

36-
#ifdef OS2
37-
typedef ULONG HANDLE;
38-
typedef ULONG DWORD;
39-
typedef int sigset_t;
40-
#endif
41-
42-
#ifdef OS2
43-
typedef HMTX pthread_mutex_t;
44-
#else
4536
typedef CRITICAL_SECTION pthread_mutex_t;
46-
#endif
4737
typedef HANDLE pthread_t;
4838
typedef struct thread_attr {
4939
DWORD dwStackSize ;
@@ -62,30 +52,19 @@ typedef struct st_pthread_link {
6252

6353
typedef struct {
6454
uint32 waiting;
65-
#ifdef OS2
66-
HEV semaphore;
67-
#else
6855
HANDLE semaphore;
69-
#endif
7056
} pthread_cond_t;
7157

7258

73-
#ifndef OS2
7459
struct timespec { /* For pthread_cond_timedwait() */
7560
time_t tv_sec;
7661
long tv_nsec;
7762
};
78-
#endif
7963

8064
typedef int pthread_mutexattr_t;
8165
#define win_pthread_self my_thread_var->pthread_self
82-
#ifdef OS2
83-
#define pthread_handler_t EXTERNC void * _Optlink
84-
typedef void * (_Optlink *pthread_handler)(void *);
85-
#else
8666
#define pthread_handler_t EXTERNC void * __cdecl
8767
typedef void * (__cdecl *pthread_handler)(void *);
88-
#endif
8968

9069
void win_pthread_init(void);
9170
int win_pthread_setspecific(void *A,void *B,uint length);
@@ -107,10 +86,8 @@ struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
10786

10887
void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
10988

110-
#ifndef OS2
11189
#define ETIMEDOUT 145 /* Win32 doesn't have this */
11290
#define getpid() GetCurrentThreadId()
113-
#endif
11491
#define pthread_self() win_pthread_self
11592
#define HAVE_LOCALTIME_R 1
11693
#define _REENTRANT 1
@@ -145,23 +122,13 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
145122
#endif /* USE_TLS */
146123

147124
#define pthread_equal(A,B) ((A) == (B))
148-
#ifdef OS2
149-
extern int pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *);
150-
extern int pthread_mutex_lock (pthread_mutex_t *);
151-
extern int pthread_mutex_unlock (pthread_mutex_t *);
152-
extern int pthread_mutex_destroy (pthread_mutex_t *);
153-
#define my_pthread_setprio(A,B) DosSetPriority(PRTYS_THREAD,PRTYC_NOCHANGE, B, A)
154-
#define pthread_kill(A,B) raise(B)
155-
#define pthread_exit(A) pthread_dummy()
156-
#else
157125
#define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0)
158126
#define pthread_mutex_lock(A) (EnterCriticalSection(A),0)
159127
#define pthread_mutex_trylock(A) (WaitForSingleObject((A), 0) == WAIT_TIMEOUT)
160128
#define pthread_mutex_unlock(A) LeaveCriticalSection(A)
161129
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
162130
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
163131
#define pthread_kill(A,B) pthread_dummy(0)
164-
#endif /* OS2 */
165132

166133
/* Dummy defines for easier code */
167134
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
@@ -257,9 +224,6 @@ extern int my_sigwait(const sigset_t *set,int *sig);
257224
#ifdef HAVE_SYNCH_H
258225
#include <synch.h>
259226
#endif
260-
#if defined(__EMX__) && (!defined(EMX_PTHREAD_REV) || (EMX_PTHREAD_REV < 2))
261-
#error Requires at least rev 2 of EMX pthreads library.
262-
#endif
263227

264228
#ifdef __NETWARE__
265229
void my_pthread_exit(void *status);
@@ -382,15 +346,12 @@ extern int my_pthread_cond_timedwait(pthread_cond_t *cond,
382346
#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C))
383347
#endif
384348

385-
#if defined(OS2)
386-
#define my_pthread_getspecific(T,A) ((T) &(A))
387-
#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A))
388-
#elif !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
349+
#if !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
389350
#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B))
390351
#else
391352
#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
392353
void *my_pthread_getspecific_imp(pthread_key_t key);
393-
#endif /* OS2 */
354+
#endif
394355

395356
#ifndef HAVE_LOCALTIME_R
396357
struct tm *localtime_r(const time_t *clock, struct tm *res);

include/thr_alarm.h

-8
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,6 @@ typedef struct st_thr_alarm_entry
7373
rf_SetTimer crono;
7474
} thr_alarm_entry;
7575

76-
#elif defined(__EMX__) || defined(OS2)
77-
78-
typedef struct st_thr_alarm_entry
79-
{
80-
uint crono;
81-
uint event;
82-
} thr_alarm_entry;
83-
8476
#else /* System with posix threads */
8577

8678
typedef int thr_alarm_entry;

mysys/default.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
601601
strmov(name,config_file);
602602
}
603603
fn_format(name,name,"","",4);
604-
#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
604+
#if !defined(__WIN__) && !defined(__NETWARE__)
605605
{
606606
MY_STAT stat_info;
607607
if (!my_stat(name,&stat_info,MYF(0)))
@@ -1001,10 +1001,6 @@ static void init_default_directories()
10011001
#elif defined(__NETWARE__)
10021002
*ptr++= "sys:/etc/";
10031003
#else
1004-
#if defined(__EMX__) || defined(OS2)
1005-
if ((env= getenv("ETC")))
1006-
*ptr++= env;
1007-
#endif
10081004
*ptr++= "/etc/";
10091005
#endif
10101006
if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV))))

mysys/mf_path.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ my_string my_path(my_string to, const char *progname,
7373
/* test if file without filename is found in path */
7474
/* Returns to if found and to has dirpart if found, else NullS */
7575

76-
#if defined(MSDOS) || defined(__WIN__) || defined(__EMX__) || defined(OS2)
76+
#if defined(MSDOS) || defined(__WIN__)
7777
#define F_OK 0
7878
#define PATH_SEP ';'
7979
#define PROGRAM_EXTENSION ".exe"

mysys/mf_tempdir.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "mysys_priv.h"
1818
#include <m_string.h>
1919

20-
#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
20+
#if defined( __WIN__) || defined(__NETWARE__)
2121
#define DELIM ';'
2222
#else
2323
#define DELIM ':'
@@ -38,7 +38,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
3838
{
3939
/* Get default temporary directory */
4040
pathlist=getenv("TMPDIR"); /* Use this if possible */
41-
#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
41+
#if defined( __WIN__) || defined(__NETWARE__)
4242
if (!pathlist)
4343
pathlist=getenv("TEMP");
4444
if (!pathlist)

mysys/mf_tempfile.c

+3-12
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#endif
2525

2626
#ifdef HAVE_TEMPNAM
27-
#if !defined(MSDOS) && !defined(OS2) && !defined(__NETWARE__)
27+
#if !defined(MSDOS) && !defined(__NETWARE__)
2828
extern char **environ;
2929
#endif
3030
#endif
@@ -121,16 +121,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
121121
to[1]= 0;
122122
dir=to;
123123
}
124-
#ifdef OS2
125-
/* changing environ variable doesn't work with VACPP */
126-
char buffer[256], *end;
127-
buffer[sizeof(buffer)-1]= 0;
128-
end= strxnmov(buffer, sizeof(buffer)-1, (char*) "TMP=", dir, NullS);
129-
/* remove ending backslash */
130-
if (end[-1] == '\\')
131-
end[-1]= 0;
132-
putenv(buffer);
133-
#elif !defined(__NETWARE__)
124+
#if !defined(__NETWARE__)
134125
old_env= (char**) environ;
135126
if (dir)
136127
{ /* Don't use TMPDIR if dir is given */
@@ -152,7 +143,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
152143
{
153144
DBUG_PRINT("error",("Got error: %d from tempnam",errno));
154145
}
155-
#if !defined(OS2) && !defined(__NETWARE__)
146+
#if !defined(__NETWARE__)
156147
environ=(const char**) old_env;
157148
#endif
158149
}

mysys/my_access.c

+1-9
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int my_access(const char *path, int amode)
5454

5555
#endif /* __WIN__ */
5656

57-
#if defined(MSDOS) || defined(__WIN__) || defined(__EMX__)
57+
#if defined(MSDOS) || defined(__WIN__)
5858

5959
/*
6060
List of file names that causes problem on windows
@@ -112,11 +112,3 @@ int check_if_legal_filename(const char *path)
112112
DBUG_RETURN(0);
113113
}
114114
#endif
115-
116-
117-
#ifdef OS2
118-
int check_if_legal_filename(const char *path)
119-
{
120-
return 0;
121-
}
122-
#endif /* OS2 */

mysys/my_clock.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
#define USES_TYPES
1818
#include "my_global.h"
1919

20-
#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(OS2) && !defined(__NETWARE__)
20+
#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__NETWARE__)
2121
#include "mysys_priv.h"
2222
#include <sys/times.h>
2323
#endif
2424

2525
long my_clock(void)
2626
{
27-
#if !defined(MSDOS) && !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
27+
#if !defined(MSDOS) && !defined(__WIN__) && !defined(__NETWARE__)
2828
struct tms tmsbuf;
2929
VOID(times(&tmsbuf));
3030
return (tmsbuf.tms_utime + tmsbuf.tms_stime);

0 commit comments

Comments
 (0)