Skip to content

Commit

Permalink
Removed support for BeOS, development for BeOS was supported 17 years…
Browse files Browse the repository at this point in the history
… ago.

This patch however does not drop support for the BeOS compatible variant, Haiku, see Github PR php#2697 which is currently a WiP

I intentionally left out some fragments for BeOS in the build system for that seems to be bundles
  • Loading branch information
KalleZ committed Aug 29, 2017
1 parent 63ea681 commit d3bc8be
Show file tree
Hide file tree
Showing 22 changed files with 70 additions and 140 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PHP NEWS
. Redesigned the old ext_skel program written in PHP, run:
'php ext_skel.php' for all options. This means there is no dependencies
thrus making it work on Windows out of the box. (Kalle)
. Removed support for BeOS. (Kalle)
. Fixed bug #75031 (support append mode in temp/memory streams). (adsr)
. Fixed bug #74860 (Uncaught exceptions not being formatted properly when
error_log set to "syslog"). (Philip Prindeville)
Expand Down
24 changes: 0 additions & 24 deletions TSRM/TSRM.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ static DWORD tls_key;
# define tsrm_tls_set(what) TlsSetValue(tls_key, (void*)(what))
# define tsrm_tls_get() TlsGetValue(tls_key)

#elif defined(BETHREADS)
static int32 tls_key;
# define tsrm_tls_set(what) tls_set(tls_key, (void*)(what))
# define tsrm_tls_get() (tsrm_tls_entry*)tls_get(tls_key)

#else
# define tsrm_tls_set(what)
# define tsrm_tls_get() NULL
Expand All @@ -135,8 +130,6 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
st_key_create(&tls_key, 0);
#elif defined(TSRM_WIN32)
tls_key = TlsAlloc();
#elif defined(BETHREADS)
tls_key = tls_allocate();
#endif

/* ensure singleton */
Expand Down Expand Up @@ -587,8 +580,6 @@ TSRM_API THREAD_T tsrm_thread_id(void)
return pthread_self();
#elif defined(TSRM_ST)
return st_thread_self();
#elif defined(BETHREADS)
return find_thread(NULL);
#endif
}/*}}}*/

Expand All @@ -608,10 +599,6 @@ TSRM_API MUTEX_T tsrm_mutex_alloc(void)
pthread_mutex_init(mutexp,NULL);
#elif defined(TSRM_ST)
mutexp = st_mutex_new();
#elif defined(BETHREADS)
mutexp = (beos_ben*)malloc(sizeof(beos_ben));
mutexp->ben = 0;
mutexp->sem = create_sem(1, "PHP sempahore");
#endif
#ifdef THR_DEBUG
printf("Mutex created thread: %d\n",mythreadid());
Expand All @@ -634,9 +621,6 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
free(mutexp);
#elif defined(TSRM_ST)
st_mutex_destroy(mutexp);
#elif defined(BETHREADS)
delete_sem(mutexp->sem);
free(mutexp);
#endif
}
#ifdef THR_DEBUG
Expand Down Expand Up @@ -664,10 +648,6 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
return pthread_mutex_lock(mutexp);
#elif defined(TSRM_ST)
return st_mutex_lock(mutexp);
#elif defined(BETHREADS)
if (atomic_add(&mutexp->ben, 1) != 0)
return acquire_sem(mutexp->sem);
return 0;
#endif
}/*}}}*/

Expand All @@ -691,10 +671,6 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
return pthread_mutex_unlock(mutexp);
#elif defined(TSRM_ST)
return st_mutex_unlock(mutexp);
#elif defined(BETHREADS)
if (atomic_add(&mutexp->ben, -1) != 1)
return release_sem(mutexp->sem);
return 0;
#endif
}/*}}}*/

Expand Down
7 changes: 0 additions & 7 deletions TSRM/TSRM.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ typedef int ts_rsrc_id;
#elif defined(TSRM_ST)
# define THREAD_T st_thread_t
# define MUTEX_T st_mutex_t
#elif defined(BETHREADS)
# define THREAD_T thread_id
typedef struct {
sem_id sem;
int32 ben;
} beos_ben;
# define MUTEX_T beos_ben *
#endif

#ifdef HAVE_SIGNAL_H
Expand Down
81 changes: 38 additions & 43 deletions TSRM/threads.m4
Original file line number Diff line number Diff line change
Expand Up @@ -103,52 +103,47 @@ dnl -threads gcc (HP-UX)
dnl
AC_DEFUN([PTHREADS_CHECK],[
if test "$beos_threads" = "1"; then
pthreads_working="yes"
ac_cv_pthreads_cflags=""
else
save_CFLAGS=$CFLAGS
save_LIBS=$LIBS
PTHREADS_ASSIGN_VARS
PTHREADS_CHECK_COMPILE
LIBS=$save_LIBS
CFLAGS=$save_CFLAGS
save_CFLAGS=$CFLAGS
save_LIBS=$LIBS
PTHREADS_ASSIGN_VARS
PTHREADS_CHECK_COMPILE
LIBS=$save_LIBS
CFLAGS=$save_CFLAGS
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
ac_cv_pthreads_cflags=
if test "$pthreads_working" != "yes"; then
for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
ac_save=$CFLAGS
CFLAGS="$CFLAGS $flag"
PTHREADS_CHECK_COMPILE
CFLAGS=$ac_save
if test "$pthreads_checked" = "yes"; then
ac_cv_pthreads_cflags=$flag
break
fi
done
fi
])
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
ac_cv_pthreads_cflags=
if test "$pthreads_working" != "yes"; then
for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
ac_save=$CFLAGS
CFLAGS="$CFLAGS $flag"
PTHREADS_CHECK_COMPILE
CFLAGS=$ac_save
if test "$pthreads_checked" = "yes"; then
ac_cv_pthreads_cflags=$flag
break
fi
done
fi
])
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
ac_cv_pthreads_lib=
if test "$pthreads_working" != "yes"; then
for lib in pthread pthreads c_r; do
ac_save=$LIBS
LIBS="$LIBS -l$lib"
PTHREADS_CHECK_COMPILE
LIBS=$ac_save
if test "$pthreads_checked" = "yes"; then
ac_cv_pthreads_lib=$lib
break
fi
done
fi
])
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
ac_cv_pthreads_lib=
if test "$pthreads_working" != "yes"; then
for lib in pthread pthreads c_r; do
ac_save=$LIBS
LIBS="$LIBS -l$lib"
PTHREADS_CHECK_COMPILE
LIBS=$ac_save
if test "$pthreads_checked" = "yes"; then
ac_cv_pthreads_lib=$lib
break
fi
done
fi
])
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
pthreads_working="yes"
fi
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
pthreads_working="yes"
fi
if test "$pthreads_working" = "yes"; then
Expand Down
18 changes: 7 additions & 11 deletions TSRM/tsrm.m4
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,15 @@ sinclude(threads.m4)
AC_DEFUN([TSRM_CHECK_PTHREADS],[
PTHREADS_CHECK
if test "$pthreads_working" != "yes"; then
AC_MSG_ERROR(Your system seems to lack POSIX threads.)
fi
if test "$beos_threads" = "1"; then
AC_DEFINE(BETHREADS, 1, Whether to use native BeOS threads)
else
if test "$pthreads_working" != "yes"; then
AC_MSG_ERROR(Your system seems to lack POSIX threads.)
fi
AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
AC_MSG_CHECKING(for POSIX threads)
AC_MSG_RESULT(yes)
fi
AC_MSG_CHECKING(for POSIX threads)
AC_MSG_RESULT(yes)
])

AC_DEFUN([TSRM_THREADS_CHECKS],[
Expand Down
1 change: 1 addition & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Core:
. The ext_skel utility has been completely redesigned with new options and
some old options removed. This is now written in PHP and have no external
dependencies.
. Support for BeOS has been dropped.

Standard:
. getimagesize() and related functions now report the mime type of BMP images
Expand Down
4 changes: 2 additions & 2 deletions ext/opcache/Optimizer/zend_func_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ static const func_info_t func_infos[] = {
#ifdef HAVE_GETHOSTNAME
F1("gethostname", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
#endif
#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__)))
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
F0("dns_check_record", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("checkdnsrr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
Expand Down Expand Up @@ -689,7 +689,7 @@ static const func_info_t func_infos[] = {
F0("socket_set_timeout", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
#endif
F1("socket_get_status", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
#if HAVE_REALPATH || defined(ZTS)
F1("realpath", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
#endif
#ifdef HAVE_FNMATCH
Expand Down
2 changes: 1 addition & 1 deletion ext/pcntl/pcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ PHP_FUNCTION(pcntl_alarm)

#define PHP_RUSAGE_PARA(from, to, field) \
add_assoc_long(to, #field, from.field)
#if !defined(_OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */
#ifndef _OSD_POSIX
#define PHP_RUSAGE_SPECIAL(from, to) \
PHP_RUSAGE_PARA(from, to, ru_oublock); \
PHP_RUSAGE_PARA(from, to, ru_inblock); \
Expand Down
4 changes: 2 additions & 2 deletions ext/spl/spl_directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
}
/* }}} */

#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
#if HAVE_REALPATH || defined(ZTS)
/* {{{ proto string SplFileInfo::getRealPath()
Return the resolved path */
SPL_METHOD(SplFileInfo, getRealPath)
Expand Down Expand Up @@ -1947,7 +1947,7 @@ static const zend_function_entry spl_SplFileInfo_functions[] = {
SPL_ME(SplFileInfo, isDir, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
SPL_ME(SplFileInfo, isLink, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
SPL_ME(SplFileInfo, getLinkTarget, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
#if HAVE_REALPATH || defined(ZTS)
SPL_ME(SplFileInfo, getRealPath, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
#endif
SPL_ME(SplFileInfo, getFileInfo, arginfo_info_optinalFileClass, ZEND_ACC_PUBLIC)
Expand Down
12 changes: 6 additions & 6 deletions ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_gethostname, 0)
ZEND_END_ARG_INFO()
#endif

#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, type)
Expand All @@ -984,7 +984,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2)
ZEND_END_ARG_INFO()
# endif

#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__)) */
#endif /* defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC */
/* }}} */

/* {{{ exec.c */
Expand Down Expand Up @@ -1204,7 +1204,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1)
ZEND_ARG_INFO(0, escape)
ZEND_END_ARG_INFO()

#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
#if HAVE_REALPATH || defined(ZTS)
ZEND_BEGIN_ARG_INFO(arginfo_realpath, 0)
ZEND_ARG_INFO(0, path)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -3060,7 +3060,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FE(gethostname, arginfo_gethostname)
#endif

#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC

PHP_FE(dns_check_record, arginfo_dns_check_record)
PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record)
Expand Down Expand Up @@ -3189,7 +3189,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */

PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_stream_get_meta_data)

#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
#if HAVE_REALPATH || defined(ZTS)
PHP_FE(realpath, arginfo_realpath)
#endif

Expand Down Expand Up @@ -3700,7 +3700,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
php_register_url_stream_wrapper("http", &php_stream_http_wrapper);
php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper);

#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
BASIC_MINIT_SUBMODULE(dns)
# endif
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static zend_string *php_gethostbyname(char *name)
#endif /* HAVE_FULL_DNS_FUNCS || defined(PHP_WIN32) */

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

#ifndef HFIXEDSZ
#define HFIXEDSZ 12 /* fixed data in header <arpa/nameser.h> */
Expand Down Expand Up @@ -1114,7 +1114,7 @@ PHP_FUNCTION(dns_get_mx)
}
/* }}} */
#endif /* HAVE_FULL_DNS_FUNCS */
#endif /* !defined(PHP_WIN32) && (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__)) */
#endif /* !defined(PHP_WIN32) && HAVE_DNS_SEARCH_FUNC */

#if HAVE_FULL_DNS_FUNCS || defined(PHP_WIN32)
PHP_MINIT_FUNCTION(dns) {
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2340,7 +2340,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
}
/* }}} */

#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
#if HAVE_REALPATH || defined(ZTS)
/* {{{ proto string realpath(string path)
Return the resolved path */
PHP_FUNCTION(realpath)
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ PHP_FUNCTION(get_meta_tags);
PHP_FUNCTION(flock);
PHP_FUNCTION(fd_set);
PHP_FUNCTION(fd_isset);
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
#if HAVE_REALPATH || defined(ZTS)
PHP_FUNCTION(realpath);
#endif
#ifdef HAVE_FNMATCH
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/filestat.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ PHPAPI void php_stat(const char *filename, size_t filename_length, int type, zva
case S_IFDIR: RETURN_STRING("dir");
case S_IFBLK: RETURN_STRING("block");
case S_IFREG: RETURN_STRING("file");
#if defined(S_IFSOCK) && !defined(ZEND_WIN32)&&!defined(__BEOS__)
#if defined(S_IFSOCK) && !defined(PHP_WIN32)
case S_IFSOCK: RETURN_STRING("socket");
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/microtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ PHP_FUNCTION(getrusage)
#ifdef PHP_WIN32 /* Windows only implements a limited amount of fields from the rusage struct */
PHP_RUSAGE_PARA(ru_majflt);
PHP_RUSAGE_PARA(ru_maxrss);
#elif !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct*/
#elif !defined(_OSD_POSIX)
PHP_RUSAGE_PARA(ru_oublock);
PHP_RUSAGE_PARA(ru_inblock);
PHP_RUSAGE_PARA(ru_msgsnd);
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/php_dns.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ PHP_FUNCTION(gethostbynamel);
PHP_FUNCTION(gethostname);
#endif

#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
PHP_FUNCTION(dns_check_record);

# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
Expand All @@ -74,7 +74,7 @@ PHP_FUNCTION(dns_get_record);
PHP_MINIT_FUNCTION(dns);
# endif

#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__)) */
#endif /* defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC */

#ifndef INT16SZ
#define INT16SZ 2
Expand Down
Loading

0 comments on commit d3bc8be

Please sign in to comment.