Skip to content

Commit d3bc8be

Browse files
committed
Removed support for BeOS, development for BeOS was supported 17 years ago.
This patch however does not drop support for the BeOS compatible variant, Haiku, see Github PR #2697 which is currently a WiP I intentionally left out some fragments for BeOS in the build system for that seems to be bundles
1 parent 63ea681 commit d3bc8be

22 files changed

+70
-140
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PHP NEWS
66
. Redesigned the old ext_skel program written in PHP, run:
77
'php ext_skel.php' for all options. This means there is no dependencies
88
thrus making it work on Windows out of the box. (Kalle)
9+
. Removed support for BeOS. (Kalle)
910
. Fixed bug #75031 (support append mode in temp/memory streams). (adsr)
1011
. Fixed bug #74860 (Uncaught exceptions not being formatted properly when
1112
error_log set to "syslog"). (Philip Prindeville)

TSRM/TSRM.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ static DWORD tls_key;
110110
# define tsrm_tls_set(what) TlsSetValue(tls_key, (void*)(what))
111111
# define tsrm_tls_get() TlsGetValue(tls_key)
112112

113-
#elif defined(BETHREADS)
114-
static int32 tls_key;
115-
# define tsrm_tls_set(what) tls_set(tls_key, (void*)(what))
116-
# define tsrm_tls_get() (tsrm_tls_entry*)tls_get(tls_key)
117-
118113
#else
119114
# define tsrm_tls_set(what)
120115
# define tsrm_tls_get() NULL
@@ -135,8 +130,6 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
135130
st_key_create(&tls_key, 0);
136131
#elif defined(TSRM_WIN32)
137132
tls_key = TlsAlloc();
138-
#elif defined(BETHREADS)
139-
tls_key = tls_allocate();
140133
#endif
141134

142135
/* ensure singleton */
@@ -587,8 +580,6 @@ TSRM_API THREAD_T tsrm_thread_id(void)
587580
return pthread_self();
588581
#elif defined(TSRM_ST)
589582
return st_thread_self();
590-
#elif defined(BETHREADS)
591-
return find_thread(NULL);
592583
#endif
593584
}/*}}}*/
594585

@@ -608,10 +599,6 @@ TSRM_API MUTEX_T tsrm_mutex_alloc(void)
608599
pthread_mutex_init(mutexp,NULL);
609600
#elif defined(TSRM_ST)
610601
mutexp = st_mutex_new();
611-
#elif defined(BETHREADS)
612-
mutexp = (beos_ben*)malloc(sizeof(beos_ben));
613-
mutexp->ben = 0;
614-
mutexp->sem = create_sem(1, "PHP sempahore");
615602
#endif
616603
#ifdef THR_DEBUG
617604
printf("Mutex created thread: %d\n",mythreadid());
@@ -634,9 +621,6 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
634621
free(mutexp);
635622
#elif defined(TSRM_ST)
636623
st_mutex_destroy(mutexp);
637-
#elif defined(BETHREADS)
638-
delete_sem(mutexp->sem);
639-
free(mutexp);
640624
#endif
641625
}
642626
#ifdef THR_DEBUG
@@ -664,10 +648,6 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
664648
return pthread_mutex_lock(mutexp);
665649
#elif defined(TSRM_ST)
666650
return st_mutex_lock(mutexp);
667-
#elif defined(BETHREADS)
668-
if (atomic_add(&mutexp->ben, 1) != 0)
669-
return acquire_sem(mutexp->sem);
670-
return 0;
671651
#endif
672652
}/*}}}*/
673653

@@ -691,10 +671,6 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
691671
return pthread_mutex_unlock(mutexp);
692672
#elif defined(TSRM_ST)
693673
return st_mutex_unlock(mutexp);
694-
#elif defined(BETHREADS)
695-
if (atomic_add(&mutexp->ben, -1) != 1)
696-
return release_sem(mutexp->sem);
697-
return 0;
698674
#endif
699675
}/*}}}*/
700676

TSRM/TSRM.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ typedef int ts_rsrc_id;
7272
#elif defined(TSRM_ST)
7373
# define THREAD_T st_thread_t
7474
# define MUTEX_T st_mutex_t
75-
#elif defined(BETHREADS)
76-
# define THREAD_T thread_id
77-
typedef struct {
78-
sem_id sem;
79-
int32 ben;
80-
} beos_ben;
81-
# define MUTEX_T beos_ben *
8275
#endif
8376

8477
#ifdef HAVE_SIGNAL_H

TSRM/threads.m4

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -103,52 +103,47 @@ dnl -threads gcc (HP-UX)
103103
dnl
104104
AC_DEFUN([PTHREADS_CHECK],[
105105
106-
if test "$beos_threads" = "1"; then
107-
pthreads_working="yes"
108-
ac_cv_pthreads_cflags=""
109-
else
110-
save_CFLAGS=$CFLAGS
111-
save_LIBS=$LIBS
112-
PTHREADS_ASSIGN_VARS
113-
PTHREADS_CHECK_COMPILE
114-
LIBS=$save_LIBS
115-
CFLAGS=$save_CFLAGS
106+
save_CFLAGS=$CFLAGS
107+
save_LIBS=$LIBS
108+
PTHREADS_ASSIGN_VARS
109+
PTHREADS_CHECK_COMPILE
110+
LIBS=$save_LIBS
111+
CFLAGS=$save_CFLAGS
116112
117-
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
118-
ac_cv_pthreads_cflags=
119-
if test "$pthreads_working" != "yes"; then
120-
for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
121-
ac_save=$CFLAGS
122-
CFLAGS="$CFLAGS $flag"
123-
PTHREADS_CHECK_COMPILE
124-
CFLAGS=$ac_save
125-
if test "$pthreads_checked" = "yes"; then
126-
ac_cv_pthreads_cflags=$flag
127-
break
128-
fi
129-
done
130-
fi
131-
])
113+
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
114+
ac_cv_pthreads_cflags=
115+
if test "$pthreads_working" != "yes"; then
116+
for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
117+
ac_save=$CFLAGS
118+
CFLAGS="$CFLAGS $flag"
119+
PTHREADS_CHECK_COMPILE
120+
CFLAGS=$ac_save
121+
if test "$pthreads_checked" = "yes"; then
122+
ac_cv_pthreads_cflags=$flag
123+
break
124+
fi
125+
done
126+
fi
127+
])
132128
133-
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
134-
ac_cv_pthreads_lib=
135-
if test "$pthreads_working" != "yes"; then
136-
for lib in pthread pthreads c_r; do
137-
ac_save=$LIBS
138-
LIBS="$LIBS -l$lib"
139-
PTHREADS_CHECK_COMPILE
140-
LIBS=$ac_save
141-
if test "$pthreads_checked" = "yes"; then
142-
ac_cv_pthreads_lib=$lib
143-
break
144-
fi
145-
done
146-
fi
147-
])
129+
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
130+
ac_cv_pthreads_lib=
131+
if test "$pthreads_working" != "yes"; then
132+
for lib in pthread pthreads c_r; do
133+
ac_save=$LIBS
134+
LIBS="$LIBS -l$lib"
135+
PTHREADS_CHECK_COMPILE
136+
LIBS=$ac_save
137+
if test "$pthreads_checked" = "yes"; then
138+
ac_cv_pthreads_lib=$lib
139+
break
140+
fi
141+
done
142+
fi
143+
])
148144
149-
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
150-
pthreads_working="yes"
151-
fi
145+
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
146+
pthreads_working="yes"
152147
fi
153148
154149
if test "$pthreads_working" = "yes"; then

TSRM/tsrm.m4

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,15 @@ sinclude(threads.m4)
7777
AC_DEFUN([TSRM_CHECK_PTHREADS],[
7878
7979
PTHREADS_CHECK
80+
81+
if test "$pthreads_working" != "yes"; then
82+
AC_MSG_ERROR(Your system seems to lack POSIX threads.)
83+
fi
8084
81-
if test "$beos_threads" = "1"; then
82-
AC_DEFINE(BETHREADS, 1, Whether to use native BeOS threads)
83-
else
84-
if test "$pthreads_working" != "yes"; then
85-
AC_MSG_ERROR(Your system seems to lack POSIX threads.)
86-
fi
87-
88-
AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
85+
AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
8986
90-
AC_MSG_CHECKING(for POSIX threads)
91-
AC_MSG_RESULT(yes)
92-
fi
87+
AC_MSG_CHECKING(for POSIX threads)
88+
AC_MSG_RESULT(yes)
9389
])
9490

9591
AC_DEFUN([TSRM_THREADS_CHECKS],[

UPGRADING

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Core:
2323
. The ext_skel utility has been completely redesigned with new options and
2424
some old options removed. This is now written in PHP and have no external
2525
dependencies.
26+
. Support for BeOS has been dropped.
2627

2728
Standard:
2829
. getimagesize() and related functions now report the mime type of BMP images

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ static const func_info_t func_infos[] = {
575575
#ifdef HAVE_GETHOSTNAME
576576
F1("gethostname", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
577577
#endif
578-
#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__)))
578+
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
579579
F0("dns_check_record", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
580580
F0("checkdnsrr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
581581
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
@@ -689,7 +689,7 @@ static const func_info_t func_infos[] = {
689689
F0("socket_set_timeout", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
690690
#endif
691691
F1("socket_get_status", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
692-
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
692+
#if HAVE_REALPATH || defined(ZTS)
693693
F1("realpath", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
694694
#endif
695695
#ifdef HAVE_FNMATCH

ext/pcntl/pcntl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ PHP_FUNCTION(pcntl_alarm)
622622

623623
#define PHP_RUSAGE_PARA(from, to, field) \
624624
add_assoc_long(to, #field, from.field)
625-
#if !defined(_OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */
625+
#ifndef _OSD_POSIX
626626
#define PHP_RUSAGE_SPECIAL(from, to) \
627627
PHP_RUSAGE_PARA(from, to, ru_oublock); \
628628
PHP_RUSAGE_PARA(from, to, ru_inblock); \

ext/spl/spl_directory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
12791279
}
12801280
/* }}} */
12811281

1282-
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
1282+
#if HAVE_REALPATH || defined(ZTS)
12831283
/* {{{ proto string SplFileInfo::getRealPath()
12841284
Return the resolved path */
12851285
SPL_METHOD(SplFileInfo, getRealPath)
@@ -1947,7 +1947,7 @@ static const zend_function_entry spl_SplFileInfo_functions[] = {
19471947
SPL_ME(SplFileInfo, isDir, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
19481948
SPL_ME(SplFileInfo, isLink, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
19491949
SPL_ME(SplFileInfo, getLinkTarget, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
1950-
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
1950+
#if HAVE_REALPATH || defined(ZTS)
19511951
SPL_ME(SplFileInfo, getRealPath, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
19521952
#endif
19531953
SPL_ME(SplFileInfo, getFileInfo, arginfo_info_optinalFileClass, ZEND_ACC_PUBLIC)

ext/standard/basic_functions.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_gethostname, 0)
962962
ZEND_END_ARG_INFO()
963963
#endif
964964

965-
#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
965+
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
966966
ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
967967
ZEND_ARG_INFO(0, host)
968968
ZEND_ARG_INFO(0, type)
@@ -984,7 +984,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2)
984984
ZEND_END_ARG_INFO()
985985
# endif
986986

987-
#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__)) */
987+
#endif /* defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC */
988988
/* }}} */
989989

990990
/* {{{ exec.c */
@@ -1204,7 +1204,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1)
12041204
ZEND_ARG_INFO(0, escape)
12051205
ZEND_END_ARG_INFO()
12061206

1207-
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
1207+
#if HAVE_REALPATH || defined(ZTS)
12081208
ZEND_BEGIN_ARG_INFO(arginfo_realpath, 0)
12091209
ZEND_ARG_INFO(0, path)
12101210
ZEND_END_ARG_INFO()
@@ -3060,7 +3060,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */
30603060
PHP_FE(gethostname, arginfo_gethostname)
30613061
#endif
30623062

3063-
#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
3063+
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
30643064

30653065
PHP_FE(dns_check_record, arginfo_dns_check_record)
30663066
PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record)
@@ -3189,7 +3189,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */
31893189

31903190
PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_stream_get_meta_data)
31913191

3192-
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
3192+
#if HAVE_REALPATH || defined(ZTS)
31933193
PHP_FE(realpath, arginfo_realpath)
31943194
#endif
31953195

@@ -3700,7 +3700,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
37003700
php_register_url_stream_wrapper("http", &php_stream_http_wrapper);
37013701
php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper);
37023702

3703-
#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
3703+
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
37043704
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
37053705
BASIC_MINIT_SUBMODULE(dns)
37063706
# endif

ext/standard/dns.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static zend_string *php_gethostbyname(char *name)
304304
#endif /* HAVE_FULL_DNS_FUNCS || defined(PHP_WIN32) */
305305

306306
/* Note: These functions are defined in ext/standard/dns_win32.c for Windows! */
307-
#if !defined(PHP_WIN32) && (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
307+
#if !defined(PHP_WIN32) && HAVE_DNS_SEARCH_FUNC
308308

309309
#ifndef HFIXEDSZ
310310
#define HFIXEDSZ 12 /* fixed data in header <arpa/nameser.h> */
@@ -1114,7 +1114,7 @@ PHP_FUNCTION(dns_get_mx)
11141114
}
11151115
/* }}} */
11161116
#endif /* HAVE_FULL_DNS_FUNCS */
1117-
#endif /* !defined(PHP_WIN32) && (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__)) */
1117+
#endif /* !defined(PHP_WIN32) && HAVE_DNS_SEARCH_FUNC */
11181118

11191119
#if HAVE_FULL_DNS_FUNCS || defined(PHP_WIN32)
11201120
PHP_MINIT_FUNCTION(dns) {

ext/standard/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
23402340
}
23412341
/* }}} */
23422342

2343-
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
2343+
#if HAVE_REALPATH || defined(ZTS)
23442344
/* {{{ proto string realpath(string path)
23452345
Return the resolved path */
23462346
PHP_FUNCTION(realpath)

ext/standard/file.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ PHP_FUNCTION(get_meta_tags);
6262
PHP_FUNCTION(flock);
6363
PHP_FUNCTION(fd_set);
6464
PHP_FUNCTION(fd_isset);
65-
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
65+
#if HAVE_REALPATH || defined(ZTS)
6666
PHP_FUNCTION(realpath);
6767
#endif
6868
#ifdef HAVE_FNMATCH

ext/standard/filestat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ PHPAPI void php_stat(const char *filename, size_t filename_length, int type, zva
894894
case S_IFDIR: RETURN_STRING("dir");
895895
case S_IFBLK: RETURN_STRING("block");
896896
case S_IFREG: RETURN_STRING("file");
897-
#if defined(S_IFSOCK) && !defined(ZEND_WIN32)&&!defined(__BEOS__)
897+
#if defined(S_IFSOCK) && !defined(PHP_WIN32)
898898
case S_IFSOCK: RETURN_STRING("socket");
899899
#endif
900900
}

ext/standard/microtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ PHP_FUNCTION(getrusage)
136136
#ifdef PHP_WIN32 /* Windows only implements a limited amount of fields from the rusage struct */
137137
PHP_RUSAGE_PARA(ru_majflt);
138138
PHP_RUSAGE_PARA(ru_maxrss);
139-
#elif !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct*/
139+
#elif !defined(_OSD_POSIX)
140140
PHP_RUSAGE_PARA(ru_oublock);
141141
PHP_RUSAGE_PARA(ru_inblock);
142142
PHP_RUSAGE_PARA(ru_msgsnd);

ext/standard/php_dns.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ PHP_FUNCTION(gethostbynamel);
6565
PHP_FUNCTION(gethostname);
6666
#endif
6767

68-
#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
68+
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
6969
PHP_FUNCTION(dns_check_record);
7070

7171
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
@@ -74,7 +74,7 @@ PHP_FUNCTION(dns_get_record);
7474
PHP_MINIT_FUNCTION(dns);
7575
# endif
7676

77-
#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__)) */
77+
#endif /* defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC */
7878

7979
#ifndef INT16SZ
8080
#define INT16SZ 2

0 commit comments

Comments
 (0)