зеркало из https://github.com/mozilla/pjs.git
Upgrade NSPR to NSPR_HEAD_20090321. This CVS tag includes
the following changes: - Bug 439144: fixed strict aliasing issues in prdtoa.c - Bug 449665: suppress the parentheses warnings in prdtoa.c - Bug 442706: build for Symbian OS with autoconf and GNU make - Bug 432430: some more changes for the Symbian OS port - Bug 476536: added PR_ASSERT_CURRENT_THREAD_OWNS_LOCK and PR_ASSERT_CURRENT_THREAD_IN_MONITOR. - Bug 478687: made PRUint64/uint64 compatible with uint64_t for 64-bit Mac OS X - Bug 480730: PR_LoadLibrary for 64-bit MAC OS X should not search DYLD_LIBRARY_PATH if the library is specified as a pathname - Bug 480740: PR_ParseTimeString crash with dates >= year 3001 when compiled with Visual C++ 2005. - Bug 480074: better dependency resolution for import libraries - Bug 469083: ported NSPR test programs to WINCE - Bug 433790: removed some obsolete WIN16 code
This commit is contained in:
Родитель
d9b5456bb1
Коммит
32a240fd4f
|
@ -113,7 +113,7 @@ PROGS = $(OBJDIR)/now$(PROG_SUFFIX)
|
|||
ifeq (,$(CROSS_COMPILE)$(filter-out OS2 WINNT,$(OS_ARCH)))
|
||||
TARGETS = $(PROGS)
|
||||
else
|
||||
ifeq ($(OS_ARCH),WINCE)
|
||||
ifeq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH)))
|
||||
TARGETS = $(PROGS)
|
||||
else
|
||||
PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX)
|
||||
|
|
|
@ -124,6 +124,8 @@ endif
|
|||
|
||||
MACOS_SDK_DIR = @MACOS_SDK_DIR@
|
||||
|
||||
SYMBIAN_SDK_DIR = @SYMBIAN_SDK_DIR@
|
||||
|
||||
NEXT_ROOT = @NEXT_ROOT@
|
||||
ifdef NEXT_ROOT
|
||||
export NEXT_ROOT
|
||||
|
|
|
@ -42,4 +42,3 @@
|
|||
*/
|
||||
|
||||
#error "Do not include this header file."
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ ifdef LIBRARY_NAME
|
|||
ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH)))
|
||||
|
||||
#
|
||||
# Win95, Win16, and OS/2 require library names conforming to the 8.3 rule.
|
||||
# Win95 and OS/2 require library names conforming to the 8.3 rule.
|
||||
# other platforms do not.
|
||||
#
|
||||
ifeq (,$(filter-out WIN95 WINCE OS2,$(OS_TARGET)))
|
||||
|
@ -318,6 +318,10 @@ ifeq ($(OS_TARGET), OS2)
|
|||
$(IMPORT_LIBRARY): $(MAPFILE)
|
||||
rm -f $@
|
||||
$(IMPLIB) $@ $(MAPFILE)
|
||||
else
|
||||
ifeq (,$(filter-out WIN95 WINCE,$(OS_TARGET)))
|
||||
$(IMPORT_LIBRARY): $(SHARED_LIBRARY)
|
||||
endif
|
||||
endif
|
||||
|
||||
$(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE)
|
||||
|
|
|
@ -31,6 +31,9 @@ ac_help="$ac_help
|
|||
ac_help="$ac_help
|
||||
--enable-win32-target=\$t
|
||||
Specify win32 flavor. (WIN95 or WINNT)"
|
||||
ac_help="$ac_help
|
||||
--enable-symbian-target=\$t
|
||||
Specify symbian flavor. (WINSCW or GCCE)"
|
||||
ac_help="$ac_help
|
||||
--enable-debug-rtl Use the MSVC debug runtime library"
|
||||
ac_help="$ac_help
|
||||
|
@ -52,6 +55,9 @@ ac_help="$ac_help
|
|||
[10.2 for ppc, 10.4 for x86]"
|
||||
ac_help="$ac_help
|
||||
--disable-os2-high-mem Disable high-memory support on OS/2"
|
||||
ac_help="$ac_help
|
||||
--with-symbian-sdk=SYMBIAN_SDK_DIR
|
||||
The path to the Symbian SDK"
|
||||
ac_help="$ac_help
|
||||
--enable-strip Enable stripping of shared libs and programs"
|
||||
ac_help="$ac_help
|
||||
|
@ -625,7 +631,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
|
|||
fi
|
||||
|
||||
echo $ac_n "checking host system type""... $ac_c" 1>&6
|
||||
echo "configure:629: checking host system type" >&5
|
||||
echo "configure:635: checking host system type" >&5
|
||||
|
||||
host_alias=$host
|
||||
case "$host_alias" in
|
||||
|
@ -646,7 +652,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
|||
echo "$ac_t""$host" 1>&6
|
||||
|
||||
echo $ac_n "checking target system type""... $ac_c" 1>&6
|
||||
echo "configure:650: checking target system type" >&5
|
||||
echo "configure:656: checking target system type" >&5
|
||||
|
||||
target_alias=$target
|
||||
case "$target_alias" in
|
||||
|
@ -664,7 +670,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
|||
echo "$ac_t""$target" 1>&6
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:668: checking build system type" >&5
|
||||
echo "configure:674: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
|
@ -736,7 +742,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:740: checking for $ac_word" >&5
|
||||
echo "configure:746: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -888,8 +894,13 @@ fi
|
|||
if test "${enable_win32_target+set}" = set; then
|
||||
enableval="$enable_win32_target"
|
||||
OS_TARGET=`echo $enableval | tr a-z A-Z`
|
||||
else
|
||||
OS_TARGET=
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-symbian-target or --disable-symbian-target was given.
|
||||
if test "${enable_symbian_target+set}" = set; then
|
||||
enableval="$enable_symbian_target"
|
||||
OS_TARGET=`echo $enableval | tr a-z A-Z`
|
||||
fi
|
||||
|
||||
|
||||
|
@ -1064,7 +1075,7 @@ if test -z "$SKIP_PATH_CHECKS"; then
|
|||
# Extract the first word of "$WHOAMI whoami", so it can be a program name with args.
|
||||
set dummy $WHOAMI whoami; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1068: checking for $ac_word" >&5
|
||||
echo "configure:1079: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_WHOAMI'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1135,13 +1146,13 @@ if test "$target" != "$host"; then
|
|||
_SAVE_LDFLAGS="$LDFLAGS"
|
||||
|
||||
echo $ac_n "checking for $host compiler""... $ac_c" 1>&6
|
||||
echo "configure:1139: checking for $host compiler" >&5
|
||||
echo "configure:1150: checking for $host compiler" >&5
|
||||
for ac_prog in $HOST_CC gcc cc /usr/ucb/cc
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1145: checking for $ac_word" >&5
|
||||
echo "configure:1156: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_HOST_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1187,16 +1198,16 @@ test -n "$HOST_CC" || HOST_CC=""""
|
|||
LDFLAGS="$HOST_LDFLAGS"
|
||||
|
||||
echo $ac_n "checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1191: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
|
||||
echo "configure:1202: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1193 "configure"
|
||||
#line 1204 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
return(0);
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_prog_host_cc_works=1 echo "$ac_t""yes" 1>&6
|
||||
else
|
||||
|
@ -1225,7 +1236,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1229: checking for $ac_word" >&5
|
||||
echo "configure:1240: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1259,7 +1270,7 @@ test -n "$CC" || CC="echo"
|
|||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1263: checking for $ac_word" >&5
|
||||
echo "configure:1274: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1289,7 +1300,7 @@ if test -z "$CC"; then
|
|||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1293: checking for $ac_word" >&5
|
||||
echo "configure:1304: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1340,7 +1351,7 @@ fi
|
|||
# Extract the first word of "cl", so it can be a program name with args.
|
||||
set dummy cl; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1344: checking for $ac_word" >&5
|
||||
echo "configure:1355: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1372,7 +1383,7 @@ fi
|
|||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1376: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:1387: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
|
@ -1383,12 +1394,12 @@ cross_compiling=$ac_cv_prog_cc_cross
|
|||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 1387 "configure"
|
||||
#line 1398 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:1392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:1403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
|
@ -1414,12 +1425,12 @@ if test $ac_cv_prog_cc_works = no; then
|
|||
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:1418: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:1429: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:1423: checking whether we are using GNU C" >&5
|
||||
echo "configure:1434: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1428,7 +1439,7 @@ else
|
|||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
|
@ -1447,7 +1458,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
|
|||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:1451: checking whether ${CC-cc} accepts -g" >&5
|
||||
echo "configure:1462: checking whether ${CC-cc} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1484,7 +1495,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1488: checking for $ac_word" >&5
|
||||
echo "configure:1499: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1520,7 +1531,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1524: checking for $ac_word" >&5
|
||||
echo "configure:1535: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1552,7 +1563,7 @@ test -n "$CXX" || CXX="gcc"
|
|||
|
||||
|
||||
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1556: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:1567: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=C
|
||||
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
|
@ -1563,12 +1574,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
|
|||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 1567 "configure"
|
||||
#line 1578 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:1572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:1583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cxx_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
|
@ -1594,12 +1605,12 @@ if test $ac_cv_prog_cxx_works = no; then
|
|||
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:1598: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:1609: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cxx_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
|
||||
echo "configure:1603: checking whether we are using GNU C++" >&5
|
||||
echo "configure:1614: checking whether we are using GNU C++" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1608,7 +1619,7 @@ else
|
|||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gxx=yes
|
||||
else
|
||||
ac_cv_prog_gxx=no
|
||||
|
@ -1627,7 +1638,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
|||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS=
|
||||
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:1631: checking whether ${CXX-g++} accepts -g" >&5
|
||||
echo "configure:1642: checking whether ${CXX-g++} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1672,7 +1683,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1676: checking for $ac_word" >&5
|
||||
echo "configure:1687: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1707,7 +1718,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1711: checking for $ac_word" >&5
|
||||
echo "configure:1722: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1742,7 +1753,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1746: checking for $ac_word" >&5
|
||||
echo "configure:1757: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1777,7 +1788,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1781: checking for $ac_word" >&5
|
||||
echo "configure:1792: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1812,7 +1823,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1816: checking for $ac_word" >&5
|
||||
echo "configure:1827: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1847,7 +1858,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1851: checking for $ac_word" >&5
|
||||
echo "configure:1862: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1882,7 +1893,7 @@ else
|
|||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1886: checking for $ac_word" >&5
|
||||
echo "configure:1897: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1912,7 +1923,7 @@ if test -z "$CC"; then
|
|||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1916: checking for $ac_word" >&5
|
||||
echo "configure:1927: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1963,7 +1974,7 @@ fi
|
|||
# Extract the first word of "cl", so it can be a program name with args.
|
||||
set dummy cl; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1967: checking for $ac_word" >&5
|
||||
echo "configure:1978: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1995,7 +2006,7 @@ fi
|
|||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1999: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:2010: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
|
@ -2006,12 +2017,12 @@ cross_compiling=$ac_cv_prog_cc_cross
|
|||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 2010 "configure"
|
||||
#line 2021 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:2015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:2026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
|
@ -2037,12 +2048,12 @@ if test $ac_cv_prog_cc_works = no; then
|
|||
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:2041: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:2052: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:2046: checking whether we are using GNU C" >&5
|
||||
echo "configure:2057: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2051,7 +2062,7 @@ else
|
|||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
|
@ -2070,7 +2081,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
|
|||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:2074: checking whether ${CC-cc} accepts -g" >&5
|
||||
echo "configure:2085: checking whether ${CC-cc} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2110,7 +2121,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2114: checking for $ac_word" >&5
|
||||
echo "configure:2125: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2142,7 +2153,7 @@ test -n "$CXX" || CXX="gcc"
|
|||
|
||||
|
||||
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:2146: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:2157: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=C
|
||||
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
|
@ -2153,12 +2164,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
|
|||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 2157 "configure"
|
||||
#line 2168 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:2162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cxx_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
|
@ -2184,12 +2195,12 @@ if test $ac_cv_prog_cxx_works = no; then
|
|||
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:2188: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:2199: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cxx_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
|
||||
echo "configure:2193: checking whether we are using GNU C++" >&5
|
||||
echo "configure:2204: checking whether we are using GNU C++" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2198,7 +2209,7 @@ else
|
|||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gxx=yes
|
||||
else
|
||||
ac_cv_prog_gxx=no
|
||||
|
@ -2217,7 +2228,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
|||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS=
|
||||
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:2221: checking whether ${CXX-g++} accepts -g" >&5
|
||||
echo "configure:2232: checking whether ${CXX-g++} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2251,7 +2262,7 @@ fi
|
|||
fi
|
||||
fi
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:2255: checking how to run the C preprocessor" >&5
|
||||
echo "configure:2266: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
|
@ -2266,13 +2277,13 @@ else
|
|||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2270 "configure"
|
||||
#line 2281 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:2287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
|
@ -2283,13 +2294,13 @@ else
|
|||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2287 "configure"
|
||||
#line 2298 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:2304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
|
@ -2300,13 +2311,13 @@ else
|
|||
rm -rf conftest*
|
||||
CPP="${CC-cc} -nologo -E"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2304 "configure"
|
||||
#line 2315 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:2321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
|
@ -2333,7 +2344,7 @@ echo "$ac_t""$CPP" 1>&6
|
|||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2337: checking for $ac_word" >&5
|
||||
echo "configure:2348: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2365,7 +2376,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2369: checking for $ac_word" >&5
|
||||
echo "configure:2380: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2406,7 +2417,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2410: checking for $ac_word" >&5
|
||||
echo "configure:2421: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2447,7 +2458,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2451: checking for $ac_word" >&5
|
||||
echo "configure:2462: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2488,7 +2499,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2492: checking for $ac_word" >&5
|
||||
echo "configure:2503: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_STRIP'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2529,7 +2540,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2533: checking for $ac_word" >&5
|
||||
echo "configure:2544: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_WINDRES'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2597,7 +2608,7 @@ else
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for gcc -pipe support""... $ac_c" 1>&6
|
||||
echo "configure:2601: checking for gcc -pipe support" >&5
|
||||
echo "configure:2612: checking for gcc -pipe support" >&5
|
||||
if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
|
||||
echo '#include <stdio.h>' > dummy-hello.c
|
||||
echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
|
||||
|
@ -2612,14 +2623,14 @@ if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
|
|||
_SAVE_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS -pipe"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2616 "configure"
|
||||
#line 2627 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
printf("Hello World\n");
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
_res_gcc_pipe="yes"
|
||||
else
|
||||
|
@ -2646,7 +2657,7 @@ fi
|
|||
|
||||
if test "$GNU_CC"; then
|
||||
echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6
|
||||
echo "configure:2650: checking for visibility(hidden) attribute" >&5
|
||||
echo "configure:2661: checking for visibility(hidden) attribute" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2670,7 +2681,7 @@ echo "$ac_t""$ac_cv_visibility_hidden" 1>&6
|
|||
EOF
|
||||
|
||||
echo $ac_n "checking for visibility pragma support""... $ac_c" 1>&6
|
||||
echo "configure:2674: checking for visibility pragma support" >&5
|
||||
echo "configure:2685: checking for visibility pragma support" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_visibility_pragma'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2723,7 +2734,7 @@ do
|
|||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2727: checking for $ac_word" >&5
|
||||
echo "configure:2738: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -2826,9 +2837,6 @@ fi
|
|||
# at lesser performance (the Win95 target uses threads; the WinNT target
|
||||
# uses fibers).
|
||||
#
|
||||
# When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
|
||||
# is built. See: win16_3.11.mk for lots more about the Win16 target.
|
||||
#
|
||||
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
|
||||
# cross-compilation.
|
||||
#
|
||||
|
@ -2927,9 +2935,6 @@ fi
|
|||
if test "$OS_TARGET" = "WIN95"; then
|
||||
OS_RELEASE="4.0"
|
||||
fi
|
||||
if test "$OS_TARGET" = "WIN16"; then
|
||||
OS_RELEASE=
|
||||
fi
|
||||
OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
|
||||
|
||||
# Check whether --enable-os2-high-mem or --disable-os2-high-mem was given.
|
||||
|
@ -2981,17 +2986,17 @@ EOF
|
|||
DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
|
||||
ac_safe=`echo "sys/atomic_op.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for sys/atomic_op.h""... $ac_c" 1>&6
|
||||
echo "configure:2985: checking for sys/atomic_op.h" >&5
|
||||
echo "configure:2990: checking for sys/atomic_op.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2990 "configure"
|
||||
#line 2995 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/atomic_op.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:3000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
|
@ -3148,7 +3153,7 @@ EOF
|
|||
_DEBUG_FLAGS='-gdwarf-2 -O0'
|
||||
MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
|
||||
echo $ac_n "checking for gethostbyaddr in -lbind""... $ac_c" 1>&6
|
||||
echo "configure:3152: checking for gethostbyaddr in -lbind" >&5
|
||||
echo "configure:3157: checking for gethostbyaddr in -lbind" >&5
|
||||
ac_lib_var=`echo bind'_'gethostbyaddr | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
|
@ -3156,7 +3161,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lbind $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 3160 "configure"
|
||||
#line 3165 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
|
@ -3167,7 +3172,7 @@ int main() {
|
|||
gethostbyaddr()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:3171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:3176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
|
@ -4128,9 +4133,6 @@ EOF
|
|||
WIN95)
|
||||
MDCPUCFG_H=_win95.cfg
|
||||
;;
|
||||
WIN16)
|
||||
MDCPUCFG_H=_win16.cfg
|
||||
;;
|
||||
*)
|
||||
{ echo "configure: error: Missing OS_TARGET for ${target}. Use --enable-win32-target to set." 1>&2; exit 1; }
|
||||
;;
|
||||
|
@ -4543,17 +4545,17 @@ EOF
|
|||
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
|
||||
ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
|
||||
echo "configure:4547: checking for machine/builtins.h" >&5
|
||||
echo "configure:4549: checking for machine/builtins.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 4552 "configure"
|
||||
#line 4554 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <machine/builtins.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:4557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:4559: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
|
@ -5006,6 +5008,126 @@ EOF
|
|||
CPU_ARCH=x86
|
||||
;;
|
||||
|
||||
*-symbian*)
|
||||
# Check whether --with-symbian-sdk or --without-symbian-sdk was given.
|
||||
if test "${with_symbian_sdk+set}" = set; then
|
||||
withval="$with_symbian_sdk"
|
||||
SYMBIAN_SDK_DIR=$withval
|
||||
fi
|
||||
|
||||
|
||||
echo -----------------------------------------------------------------------------
|
||||
echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
|
||||
echo -----------------------------------------------------------------------------
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define XP_UNIX 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define SYMBIAN 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define __arm__ 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define __SYMBIAN32__ 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define _UNICODE 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define NDEBUG 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define __SUPPORT_CPP_EXCEPTIONS__ 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define MOZ_STDERR_TO_STDOUT 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_FCNTL_FILE_LOCKING 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_SOCKLEN_T 1
|
||||
EOF
|
||||
|
||||
USE_PTHREADS=1
|
||||
LIB_SUFFIX=lib
|
||||
DLL_SUFFIX=dll
|
||||
MKSHLIB=
|
||||
DSO_LDOPTS=
|
||||
DSO_CFLAGS=
|
||||
VISIBILITY_FLAGS=
|
||||
MDCPUCFG_H=_symbian.cfg
|
||||
PR_MD_CSRCS=symbian.c
|
||||
NSINSTALL=nsinstall
|
||||
RANLIB='echo no ranlib '
|
||||
CPU_ARCH=ARM
|
||||
OS_ARCH=SYMBIAN
|
||||
OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
|
||||
CFLAGS="$CFLAGS -MD -nostdinc"
|
||||
SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
|
||||
echo -------------------------------------------------------
|
||||
echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
|
||||
echo -------------------------------------------------------
|
||||
case "$OS_TARGET" in
|
||||
WINSCW)
|
||||
CC=mwccsym2.exe
|
||||
CXX=mwccsym2.exe
|
||||
LD=mwldsym2.exe
|
||||
AR=mwldsym2.exe
|
||||
WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
|
||||
CFLAGS="$CFLAGS -O0 -inline off -wchar_t off -align 4 -warnings on -w nohidevirtual,nounusedexpr -msgstyle gcc -enum int -str pool -exc ms -trigraphs on -nostderr -gccdep -cwd source -i- -I\$(VPATH)"
|
||||
SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
|
||||
AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define _DEBUG 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define __CW32__ 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define __WINS__ 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define __WINSCW__ 1
|
||||
EOF
|
||||
|
||||
DEFINES="$DEFINES -U_WIN32"
|
||||
;;
|
||||
GCCE)
|
||||
CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
|
||||
CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
|
||||
SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define __GCCE__ 1
|
||||
EOF
|
||||
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define __EABI__ 1
|
||||
EOF
|
||||
|
||||
DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
|
||||
;;
|
||||
*)
|
||||
{ echo "configure: error: Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'." 1>&2; exit 1; }
|
||||
;;
|
||||
esac
|
||||
CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
|
||||
;;
|
||||
|
||||
*-os2*)
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define XP_OS2 1
|
||||
|
@ -5082,7 +5204,7 @@ case $target in
|
|||
;;
|
||||
*)
|
||||
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
|
||||
echo "configure:5086: checking for dlopen in -ldl" >&5
|
||||
echo "configure:5208: checking for dlopen in -ldl" >&5
|
||||
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
|
@ -5090,7 +5212,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldl $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5094 "configure"
|
||||
#line 5216 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
|
@ -5101,7 +5223,7 @@ int main() {
|
|||
dlopen()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:5105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:5227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
|
@ -5118,17 +5240,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
|||
echo "$ac_t""yes" 1>&6
|
||||
ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
|
||||
echo "configure:5122: checking for dlfcn.h" >&5
|
||||
echo "configure:5244: checking for dlfcn.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5127 "configure"
|
||||
#line 5249 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <dlfcn.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:5132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:5254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
|
@ -5161,13 +5283,13 @@ esac
|
|||
|
||||
if test $ac_cv_prog_gcc = yes; then
|
||||
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
|
||||
echo "configure:5165: checking whether ${CC-cc} needs -traditional" >&5
|
||||
echo "configure:5287: checking whether ${CC-cc} needs -traditional" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_pattern="Autoconf.*'x'"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5171 "configure"
|
||||
#line 5293 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sgtty.h>
|
||||
Autoconf TIOCGETP
|
||||
|
@ -5185,7 +5307,7 @@ rm -f conftest*
|
|||
|
||||
if test $ac_cv_prog_gcc_traditional = no; then
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5189 "configure"
|
||||
#line 5311 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <termio.h>
|
||||
Autoconf TCGETA
|
||||
|
@ -5209,12 +5331,12 @@ fi
|
|||
for ac_func in lchown strerror
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:5213: checking for $ac_func" >&5
|
||||
echo "configure:5335: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5218 "configure"
|
||||
#line 5340 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
|
@ -5237,7 +5359,7 @@ $ac_func();
|
|||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:5241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:5363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
|
@ -5278,7 +5400,7 @@ hpux*)
|
|||
if test -z "$GNU_CC"; then
|
||||
|
||||
echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
|
||||
echo "configure:5282: checking for +Olit support" >&5
|
||||
echo "configure:5404: checking for +Olit support" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -5317,7 +5439,7 @@ darwin*)
|
|||
*)
|
||||
|
||||
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
|
||||
echo "configure:5321: checking for pthread_create in -lpthreads" >&5
|
||||
echo "configure:5443: checking for pthread_create in -lpthreads" >&5
|
||||
echo "
|
||||
#include <pthread.h>
|
||||
void *foo(void *v) { return v; }
|
||||
|
@ -5339,7 +5461,7 @@ echo "
|
|||
echo "$ac_t""no" 1>&6
|
||||
|
||||
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
|
||||
echo "configure:5343: checking for pthread_create in -lpthread" >&5
|
||||
echo "configure:5465: checking for pthread_create in -lpthread" >&5
|
||||
echo "
|
||||
#include <pthread.h>
|
||||
void *foo(void *v) { return v; }
|
||||
|
@ -5361,7 +5483,7 @@ echo "
|
|||
echo "$ac_t""no" 1>&6
|
||||
|
||||
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
|
||||
echo "configure:5365: checking for pthread_create in -lc_r" >&5
|
||||
echo "configure:5487: checking for pthread_create in -lc_r" >&5
|
||||
echo "
|
||||
#include <pthread.h>
|
||||
void *foo(void *v) { return v; }
|
||||
|
@ -5383,7 +5505,7 @@ echo "
|
|||
echo "$ac_t""no" 1>&6
|
||||
|
||||
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
|
||||
echo "configure:5387: checking for pthread_create in -lc" >&5
|
||||
echo "configure:5509: checking for pthread_create in -lc" >&5
|
||||
echo "
|
||||
#include <pthread.h>
|
||||
void *foo(void *v) { return v; }
|
||||
|
@ -5515,7 +5637,7 @@ if test -n "$USE_PTHREADS"; then
|
|||
rm -f conftest*
|
||||
ac_cv_have_dash_pthread=no
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
|
||||
echo "configure:5519: checking whether ${CC-cc} accepts -pthread" >&5
|
||||
echo "configure:5641: checking whether ${CC-cc} accepts -pthread" >&5
|
||||
echo 'int main() { return 0; }' | cat > conftest.c
|
||||
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
|
||||
if test $? -eq 0; then
|
||||
|
@ -5538,7 +5660,7 @@ echo "configure:5519: checking whether ${CC-cc} accepts -pthread" >&5
|
|||
ac_cv_have_dash_pthreads=no
|
||||
if test "$ac_cv_have_dash_pthread" = "no"; then
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
|
||||
echo "configure:5542: checking whether ${CC-cc} accepts -pthreads" >&5
|
||||
echo "configure:5664: checking whether ${CC-cc} accepts -pthreads" >&5
|
||||
echo 'int main() { return 0; }' | cat > conftest.c
|
||||
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
|
||||
if test $? -eq 0; then
|
||||
|
@ -5945,6 +6067,7 @@ esac
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
MAKEFILES="
|
||||
|
@ -6071,7 +6194,7 @@ s%\[%\\&%g
|
|||
s%\]%\\&%g
|
||||
s%\$%$$%g
|
||||
EOF
|
||||
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
|
||||
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' ' | tr '\015' ' '` # Manually modified for MKS support.
|
||||
rm -f conftest.defs
|
||||
|
||||
|
||||
|
@ -6241,6 +6364,7 @@ s%@CYGWIN_WRAPPER@%$CYGWIN_WRAPPER%g
|
|||
s%@VISIBILITY_FLAGS@%$VISIBILITY_FLAGS%g
|
||||
s%@WRAP_SYSTEM_INCLUDES@%$WRAP_SYSTEM_INCLUDES%g
|
||||
s%@MACOS_SDK_DIR@%$MACOS_SDK_DIR%g
|
||||
s%@SYMBIAN_SDK_DIR@%$SYMBIAN_SDK_DIR%g
|
||||
s%@NEXT_ROOT@%$NEXT_ROOT%g
|
||||
s%@MT@%$MT%g
|
||||
|
||||
|
|
|
@ -208,8 +208,12 @@ AC_ARG_ENABLE(debug,
|
|||
AC_ARG_ENABLE(win32-target,
|
||||
[ --enable-win32-target=\$t
|
||||
Specify win32 flavor. (WIN95 or WINNT)],
|
||||
OS_TARGET=`echo $enableval | tr a-z A-Z`,
|
||||
OS_TARGET=)
|
||||
OS_TARGET=`echo $enableval | tr a-z A-Z`)
|
||||
|
||||
AC_ARG_ENABLE(symbian-target,
|
||||
[ --enable-symbian-target=\$t
|
||||
Specify symbian flavor. (WINSCW or GCCE)],
|
||||
OS_TARGET=`echo $enableval | tr a-z A-Z`)
|
||||
|
||||
AC_ARG_ENABLE(debug-rtl,
|
||||
[ --enable-debug-rtl Use the MSVC debug runtime library],
|
||||
|
@ -694,9 +698,6 @@ fi
|
|||
# at lesser performance (the Win95 target uses threads; the WinNT target
|
||||
# uses fibers).
|
||||
#
|
||||
# When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
|
||||
# is built. See: win16_3.11.mk for lots more about the Win16 target.
|
||||
#
|
||||
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
|
||||
# cross-compilation.
|
||||
#
|
||||
|
@ -795,9 +796,6 @@ fi
|
|||
if test "$OS_TARGET" = "WIN95"; then
|
||||
OS_RELEASE="4.0"
|
||||
fi
|
||||
if test "$OS_TARGET" = "WIN16"; then
|
||||
OS_RELEASE=
|
||||
fi
|
||||
OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
|
||||
|
||||
dnl ========================================================
|
||||
|
@ -1632,9 +1630,6 @@ tools are selected during the Xcode/Developer Tools installation.])
|
|||
WIN95)
|
||||
MDCPUCFG_H=_win95.cfg
|
||||
;;
|
||||
WIN16)
|
||||
MDCPUCFG_H=_win16.cfg
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
|
||||
;;
|
||||
|
@ -2166,6 +2161,76 @@ mips-sony-newsos*)
|
|||
CPU_ARCH=x86
|
||||
;;
|
||||
|
||||
*-symbian*)
|
||||
AC_ARG_WITH(symbian-sdk,
|
||||
[ --with-symbian-sdk=SYMBIAN_SDK_DIR
|
||||
The path to the Symbian SDK],
|
||||
SYMBIAN_SDK_DIR=$withval)
|
||||
|
||||
echo -----------------------------------------------------------------------------
|
||||
echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
|
||||
echo -----------------------------------------------------------------------------
|
||||
|
||||
AC_DEFINE(XP_UNIX)
|
||||
AC_DEFINE(SYMBIAN)
|
||||
AC_DEFINE(__arm__)
|
||||
AC_DEFINE(__SYMBIAN32__)
|
||||
AC_DEFINE(_UNICODE)
|
||||
AC_DEFINE(NDEBUG)
|
||||
AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
|
||||
AC_DEFINE(MOZ_STDERR_TO_STDOUT)
|
||||
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
|
||||
AC_DEFINE(HAVE_SOCKLEN_T)
|
||||
USE_PTHREADS=1
|
||||
LIB_SUFFIX=lib
|
||||
DLL_SUFFIX=dll
|
||||
MKSHLIB=
|
||||
DSO_LDOPTS=
|
||||
DSO_CFLAGS=
|
||||
VISIBILITY_FLAGS=
|
||||
MDCPUCFG_H=_symbian.cfg
|
||||
PR_MD_CSRCS=symbian.c
|
||||
NSINSTALL=nsinstall
|
||||
RANLIB='echo no ranlib '
|
||||
CPU_ARCH=ARM
|
||||
OS_ARCH=SYMBIAN
|
||||
OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
|
||||
CFLAGS="$CFLAGS -MD -nostdinc"
|
||||
SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
|
||||
echo -------------------------------------------------------
|
||||
echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
|
||||
echo -------------------------------------------------------
|
||||
case "$OS_TARGET" in
|
||||
WINSCW)
|
||||
CC=mwccsym2.exe
|
||||
CXX=mwccsym2.exe
|
||||
LD=mwldsym2.exe
|
||||
AR=mwldsym2.exe
|
||||
WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
|
||||
CFLAGS="$CFLAGS -O0 -inline off -wchar_t off -align 4 -warnings on -w nohidevirtual,nounusedexpr -msgstyle gcc -enum int -str pool -exc ms -trigraphs on -nostderr -gccdep -cwd source -i- -I\$(VPATH)"
|
||||
SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
|
||||
AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
|
||||
AC_DEFINE(_DEBUG)
|
||||
AC_DEFINE(__CW32__)
|
||||
AC_DEFINE(__WINS__)
|
||||
AC_DEFINE(__WINSCW__)
|
||||
DEFINES="$DEFINES -U_WIN32"
|
||||
;;
|
||||
GCCE)
|
||||
CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
|
||||
CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
|
||||
SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
|
||||
AC_DEFINE(__GCCE__)
|
||||
AC_DEFINE(__EABI__)
|
||||
DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
|
||||
;;
|
||||
esac
|
||||
CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
|
||||
;;
|
||||
|
||||
*-os2*)
|
||||
AC_DEFINE(XP_OS2)
|
||||
AC_DEFINE(XP_PC)
|
||||
|
@ -2823,6 +2888,7 @@ AC_SUBST(CYGWIN_WRAPPER)
|
|||
AC_SUBST(VISIBILITY_FLAGS)
|
||||
AC_SUBST(WRAP_SYSTEM_INCLUDES)
|
||||
AC_SUBST(MACOS_SDK_DIR)
|
||||
AC_SUBST(SYMBIAN_SDK_DIR)
|
||||
AC_SUBST(NEXT_ROOT)
|
||||
AC_SUBST(MT)
|
||||
|
||||
|
|
|
@ -132,12 +132,6 @@ PL_NewHashTable(PRUint32 n, PLHashFunction keyHash,
|
|||
memset(ht, 0, sizeof *ht);
|
||||
ht->shift = PL_HASH_BITS - n;
|
||||
n = 1 << n;
|
||||
#if defined(WIN16)
|
||||
if (n > 16000) {
|
||||
(*allocOps->freeTable)(allocPriv, ht);
|
||||
return 0;
|
||||
}
|
||||
#endif /* WIN16 */
|
||||
nb = n * sizeof(PLHashEntry *);
|
||||
ht->buckets = (PLHashEntry**)((*allocOps->allocTable)(allocPriv, nb));
|
||||
if (!ht->buckets) {
|
||||
|
@ -254,10 +248,6 @@ PL_HashTableRawAdd(PLHashTable *ht, PLHashEntry **hep,
|
|||
n = NBUCKETS(ht);
|
||||
if (ht->nentries >= OVERLOADED(n)) {
|
||||
oldbuckets = ht->buckets;
|
||||
#if defined(WIN16)
|
||||
if (2 * n > 16000)
|
||||
return 0;
|
||||
#endif /* WIN16 */
|
||||
nb = 2 * n * sizeof(PLHashEntry *);
|
||||
ht->buckets = (PLHashEntry**)
|
||||
((*ht->allocOps->allocTable)(ht->allocPriv, nb));
|
||||
|
|
|
@ -69,20 +69,4 @@ PR_IMPLEMENT(void) PL_PrintError(const char *msg)
|
|||
PL_FPrintError(fd, msg);
|
||||
} /* PL_PrintError */
|
||||
|
||||
#if defined(WIN16)
|
||||
/*
|
||||
** libmain() is a required function for win16
|
||||
**
|
||||
*/
|
||||
int CALLBACK LibMain( HINSTANCE hInst, WORD wDataSeg,
|
||||
WORD cbHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* WIN16 */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* plerror.c */
|
||||
|
|
|
@ -269,10 +269,6 @@ PR_IMPLEMENT(void) PR_GetEndFinalizeHook(GCEndFinalizeHook **hook, void **arg)
|
|||
#ifdef DEBUG
|
||||
#include "prprf.h"
|
||||
|
||||
#if defined(WIN16)
|
||||
static FILE *tracefile = 0;
|
||||
#endif
|
||||
|
||||
PR_IMPLEMENT(void) GCTrace(char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -281,16 +277,7 @@ PR_IMPLEMENT(void) GCTrace(char *fmt, ...)
|
|||
va_start(ap, fmt);
|
||||
PR_vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
va_end(ap);
|
||||
#if defined(WIN16)
|
||||
if ( tracefile == 0 )
|
||||
{
|
||||
tracefile = fopen( "xxxGCtr", "w" );
|
||||
}
|
||||
fprintf(tracefile, "%s\n", buf );
|
||||
fflush(tracefile);
|
||||
#else
|
||||
PR_LOG(_pr_msgc_lm, PR_LOG_ALWAYS, ("%s", buf));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -297,7 +297,6 @@ static PRWord bigAllocBytes = 0;
|
|||
** for empty objects).
|
||||
** XXX tune: put subtract of _sp->base into _sp->hbits pointer?
|
||||
*/
|
||||
#if !defined(WIN16)
|
||||
#define SET_HBIT(_sp,_ph) \
|
||||
SET_BIT((_sp)->hbits, (((PRWord*)(_ph)) - ((PRWord*) (_sp)->base)))
|
||||
|
||||
|
@ -306,67 +305,6 @@ static PRWord bigAllocBytes = 0;
|
|||
|
||||
#define IS_HBIT(_sp,_ph) \
|
||||
TEST_BIT((_sp)->hbits, (((PRWord*)(_ph)) - ((PRWord*) (_sp)->base)))
|
||||
#else
|
||||
|
||||
#define SET_HBIT(_sp,_ph) set_hbit(_sp,_ph)
|
||||
|
||||
#define CLEAR_HBIT(_sp,_ph) clear_hbit(_sp,_ph)
|
||||
|
||||
#define IS_HBIT(_sp,_ph) is_hbit(_sp,_ph)
|
||||
|
||||
static void
|
||||
set_hbit(GCSeg *sp, PRWord *p)
|
||||
{
|
||||
unsigned int distance;
|
||||
unsigned int index;
|
||||
PRWord mask;
|
||||
|
||||
PR_ASSERT( SELECTOROF(p) == SELECTOROF(sp->base) );
|
||||
PR_ASSERT( OFFSETOF(p) >= OFFSETOF(sp->base) );
|
||||
|
||||
distance = (OFFSETOF(p) - OFFSETOF(sp->base)) >> 2;
|
||||
index = distance >> PR_BITS_PER_WORD_LOG2;
|
||||
mask = 1L << (distance&(PR_BITS_PER_WORD-1));
|
||||
|
||||
sp->hbits[index] |= mask;
|
||||
}
|
||||
|
||||
static void
|
||||
clear_hbit(GCSeg *sp, PRWord *p)
|
||||
{
|
||||
unsigned int distance;
|
||||
unsigned int index;
|
||||
PRWord mask;
|
||||
|
||||
PR_ASSERT( SELECTOROF(p) == SELECTOROF(sp->base) );
|
||||
PR_ASSERT( OFFSETOF(p) >= OFFSETOF(sp->base) );
|
||||
|
||||
distance = (OFFSETOF(p) - OFFSETOF(sp->base)) >> 2;
|
||||
index = distance >> PR_BITS_PER_WORD_LOG2;
|
||||
mask = 1L << (distance&(PR_BITS_PER_WORD-1));
|
||||
|
||||
sp->hbits[index] &= ~mask;
|
||||
}
|
||||
|
||||
static int
|
||||
is_hbit(GCSeg *sp, PRWord *p)
|
||||
{
|
||||
unsigned int distance;
|
||||
unsigned int index;
|
||||
PRWord mask;
|
||||
|
||||
PR_ASSERT( SELECTOROF(p) == SELECTOROF(sp->base) );
|
||||
PR_ASSERT( OFFSETOF(p) >= OFFSETOF(sp->base) );
|
||||
|
||||
distance = (OFFSETOF(p) - OFFSETOF(sp->base)) >> 2;
|
||||
index = distance >> PR_BITS_PER_WORD_LOG2;
|
||||
mask = 1L << (distance&(PR_BITS_PER_WORD-1));
|
||||
|
||||
return ((sp->hbits[index] & mask) != 0);
|
||||
}
|
||||
|
||||
|
||||
#endif /* WIN16 */
|
||||
|
||||
/*
|
||||
** Given a pointer into this segment, back it up until we are at the
|
||||
|
@ -383,9 +321,6 @@ static PRWord *FindObject(GCSeg *sp, PRWord *p)
|
|||
p = (PRWord*) ((PRWord)p & ~(PR_BYTES_PER_WORD-1L));
|
||||
|
||||
base = (PRWord *) sp->base;
|
||||
#if defined(WIN16)
|
||||
PR_ASSERT( SELECTOROF(p) == SELECTOROF(base));
|
||||
#endif
|
||||
do {
|
||||
if (IS_HBIT(sp, p)) {
|
||||
return (p);
|
||||
|
@ -404,15 +339,9 @@ static PRWord *FindObject(GCSeg *sp, PRWord *p)
|
|||
#define OutputDebugString(msg)
|
||||
#endif
|
||||
|
||||
#if !defined(WIN16)
|
||||
#define IN_SEGMENT(_sp, _p) \
|
||||
((((char *)(_p)) >= (_sp)->base) && \
|
||||
(((char *)(_p)) < (_sp)->limit))
|
||||
#else
|
||||
#define IN_SEGMENT(_sp, _p) \
|
||||
((((PRWord)(_p)) >= ((PRWord)(_sp)->base)) && \
|
||||
(((PRWord)(_p)) < ((PRWord)(_sp)->limit)))
|
||||
#endif
|
||||
|
||||
static GCSeg *InHeap(void *p)
|
||||
{
|
||||
|
@ -465,13 +394,6 @@ static GCSeg* DoGrowHeap(PRInt32 requestedSize, PRBool exactly)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(WIN16)
|
||||
if (requestedSize > segmentSize) {
|
||||
PR_DELETE(segInfo);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Get more memory from the OS */
|
||||
if (exactly) {
|
||||
allocSize = requestedSize;
|
||||
|
@ -493,9 +415,6 @@ static GCSeg* DoGrowHeap(PRInt32 requestedSize, PRBool exactly)
|
|||
* sizeof(PRWord);
|
||||
|
||||
/* Get bitmap memory from malloc heap */
|
||||
#if defined(WIN16)
|
||||
PR_ASSERT( nhbytes < MAX_ALLOC_SIZE );
|
||||
#endif
|
||||
hbits = (PRWord *) PR_CALLOC((PRUint32)nhbytes);
|
||||
if (!hbits) {
|
||||
/* Loser! */
|
||||
|
@ -801,16 +720,8 @@ static void PR_CALLBACK ProcessRootBlock(void **base, PRInt32 count)
|
|||
high = _pr_gcData.highSeg;
|
||||
while (--count >= 0) {
|
||||
p0 = (PRWord*) *base++;
|
||||
/*
|
||||
** XXX:
|
||||
** Until Win16 maintains lowSeg and highSeg correctly,
|
||||
** (ie. lowSeg=MIN(all segs) and highSeg = MAX(all segs))
|
||||
** Allways scan through the segment list
|
||||
*/
|
||||
#if !defined(WIN16)
|
||||
if (p0 < low) continue; /* below gc heap */
|
||||
if (p0 >= high) continue; /* above gc heap */
|
||||
#endif
|
||||
/* NOTE: inline expansion of InHeap */
|
||||
/* Find segment */
|
||||
sp = lastInHeap;
|
||||
|
@ -897,16 +808,8 @@ static void PR_CALLBACK ProcessRootPointer(void *ptr)
|
|||
|
||||
p0 = (PRWord*) ptr;
|
||||
|
||||
/*
|
||||
** XXX:
|
||||
** Until Win16 maintains lowSeg and highSeg correctly,
|
||||
** (ie. lowSeg=MIN(all segs) and highSeg = MAX(all segs))
|
||||
** Allways scan through the segment list
|
||||
*/
|
||||
#if !defined(WIN16)
|
||||
if (p0 < _pr_gcData.lowSeg) return; /* below gc heap */
|
||||
if (p0 >= _pr_gcData.highSeg) return; /* above gc heap */
|
||||
#endif
|
||||
|
||||
/* NOTE: inline expansion of InHeap */
|
||||
/* Find segment */
|
||||
|
@ -1858,16 +1761,8 @@ pr_ConservativeWalkPointer(void* ptr, PRWalkFun walkRootPointer, void* data)
|
|||
|
||||
p0 = (PRWord*) ptr;
|
||||
|
||||
/*
|
||||
** XXX:
|
||||
** Until Win16 maintains lowSeg and highSeg correctly,
|
||||
** (ie. lowSeg=MIN(all segs) and highSeg = MAX(all segs))
|
||||
** Allways scan through the segment list
|
||||
*/
|
||||
#if !defined(WIN16)
|
||||
if (p0 < _pr_gcData.lowSeg) return 0; /* below gc heap */
|
||||
if (p0 >= _pr_gcData.highSeg) return 0; /* above gc heap */
|
||||
#endif
|
||||
|
||||
/* NOTE: inline expansion of InHeap */
|
||||
/* Find segment */
|
||||
|
@ -2637,11 +2532,6 @@ static PRWord *BigAlloc(int cbix, PRInt32 bytes, int dub)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(WIN16)
|
||||
/* All memory MUST be aligned on 32bit boundaries */
|
||||
PR_ASSERT( (((PRWord)p) & (PR_BYTES_PER_WORD-1)) == 0 );
|
||||
#endif
|
||||
|
||||
/* Consume the *entire* segment with a single allocation */
|
||||
h = MAKE_HEADER(cbix, (chunkSize >> PR_BYTES_PER_WORD_LOG2));
|
||||
p[0] = h;
|
||||
|
@ -2802,7 +2692,6 @@ PR_IMPLEMENT(PRWord GCPTR *)PR_AllocMemory(
|
|||
**
|
||||
** MSVC 1.52 crashed on the ff. code because of the "complex" shifting :-(
|
||||
*/
|
||||
#if !defined(WIN16)
|
||||
/* Check for possible overflow of bytes before performing add */
|
||||
if ((MAX_INT - PR_BYTES_PER_WORD) < bytes ) return NULL;
|
||||
bytes = (bytes + PR_BYTES_PER_WORD - 1) >> PR_BYTES_PER_WORD_LOG2;
|
||||
|
@ -2810,25 +2699,6 @@ PR_IMPLEMENT(PRWord GCPTR *)PR_AllocMemory(
|
|||
/* Check for possible overflow of bytes before performing add */
|
||||
if ((MAX_INT - sizeof(PRWord)) < bytes ) return NULL;
|
||||
bytes += sizeof(PRWord);
|
||||
#else
|
||||
/*
|
||||
** For WIN16 the shifts have been broken out into separate statements
|
||||
** to prevent the compiler from crashing...
|
||||
*/
|
||||
{
|
||||
PRWord shiftVal;
|
||||
|
||||
/* Check for possible overflow of bytes before performing add */
|
||||
if ((MAX_INT - PR_BYTES_PER_WORD) < bytes ) return NULL;
|
||||
bytes += PR_BYTES_PER_WORD - 1L;
|
||||
shiftVal = PR_BYTES_PER_WORD_LOG2;
|
||||
bytes >>= shiftVal;
|
||||
bytes <<= shiftVal;
|
||||
/* Check for possible overflow of bytes before performing add */
|
||||
if ((MAX_INT - sizeof(PRWord)) < bytes ) return NULL;
|
||||
bytes += sizeof(PRWord);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Add in an extra word of memory for double-aligned memory. Some
|
||||
* percentage of the time this will waste a word of memory (too
|
||||
|
@ -3070,25 +2940,9 @@ PR_AllocSimpleMemory(PRWord requestedBytes, PRInt32 tix)
|
|||
**
|
||||
** MSVC 1.52 crashed on the ff. code because of the "complex" shifting :-(
|
||||
*/
|
||||
#if !defined(WIN16)
|
||||
bytes = (bytes + PR_BYTES_PER_WORD - 1) >> PR_BYTES_PER_WORD_LOG2;
|
||||
bytes <<= PR_BYTES_PER_WORD_LOG2;
|
||||
bytes += sizeof(PRWord);
|
||||
#else
|
||||
/*
|
||||
** For WIN16 the shifts have been broken out into separate statements
|
||||
** to prevent the compiler from crashing...
|
||||
*/
|
||||
{
|
||||
PRWord shiftVal;
|
||||
|
||||
bytes += PR_BYTES_PER_WORD - 1L;
|
||||
shiftVal = PR_BYTES_PER_WORD_LOG2;
|
||||
bytes >>= shiftVal;
|
||||
bytes <<= shiftVal;
|
||||
bytes += sizeof(PRWord);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Add in an extra word of memory for double-aligned memory. Some
|
||||
|
@ -3112,9 +2966,6 @@ PR_AllocSimpleMemory(PRWord requestedBytes, PRInt32 tix)
|
|||
bytes += sizeof(GCBlockEnd);
|
||||
#endif
|
||||
|
||||
#if defined(WIN16)
|
||||
PR_ASSERT( bytes < MAX_ALLOC_SIZE );
|
||||
#endif
|
||||
/* Java can ask for objects bigger than 4M, but it won't get them */
|
||||
/*
|
||||
* This check was added because there is a fundamental limit of
|
||||
|
@ -3288,10 +3139,6 @@ PR_IMPLEMENT(void) PR_InitGC(
|
|||
_pr_pageShift = PR_GetPageShift();
|
||||
_pr_pageSize = PR_GetPageSize();
|
||||
|
||||
#if defined(WIN16)
|
||||
PR_ASSERT( initialHeapSize < MAX_ALLOC_SIZE );
|
||||
#endif
|
||||
|
||||
/* Setup initial heap size and initial segment size */
|
||||
if (0 != segSize) segmentSize = segSize;
|
||||
#ifdef DEBUG
|
||||
|
@ -3343,19 +3190,6 @@ PR_IMPLEMENT(void) PR_InitGC(
|
|||
PR_RegisterRootFinder(ScanWeakFreeList, "scan weak free list", 0);
|
||||
}
|
||||
|
||||
#if defined(WIN16)
|
||||
/*
|
||||
** For WIN16 the GC_IN_HEAP() macro must call the private InHeap function.
|
||||
** This public wrapper function makes this possible...
|
||||
*/
|
||||
PR_IMPLEMENT(PRBool)
|
||||
PR_GC_In_Heap(void *object)
|
||||
{
|
||||
return InHeap( object ) != NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/** Added by Vishy for sanity checking a few GC structures **/
|
||||
/** Can use SanityCheckGC to debug corrupted GC Heap situations **/
|
||||
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#if defined(WIN16)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include "prtypes.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#define MAX_SEGMENT_SIZE (65536l - 4096l)
|
||||
|
||||
/************************************************************************/
|
||||
/*
|
||||
** Machine dependent GC Heap management routines:
|
||||
** _MD_GrowGCHeap
|
||||
*/
|
||||
/************************************************************************/
|
||||
|
||||
void _MD_InitGC(void) {}
|
||||
|
||||
extern void *
|
||||
_MD_GrowGCHeap(PRUint32 *sizep)
|
||||
{
|
||||
void *addr;
|
||||
|
||||
if( *sizep > MAX_SEGMENT_SIZE ) {
|
||||
*sizep = MAX_SEGMENT_SIZE;
|
||||
}
|
||||
|
||||
addr = malloc((size_t)*sizep);
|
||||
return addr;
|
||||
}
|
||||
|
||||
HINSTANCE _pr_hInstance;
|
||||
|
||||
int CALLBACK LibMain( HINSTANCE hInst, WORD wDataSeg,
|
||||
WORD cbHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
_pr_hInstance = hInst;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -46,11 +46,6 @@ include $(MOD_DEPTH)/config/autoconf.mk
|
|||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
ifeq ($(OS_TARGET), WIN16)
|
||||
OS_CFLAGS = $(OS_EXE_CFLAGS)
|
||||
W16STDIO = $(MOD_DEPTH)/pr/src/md/windows/$(OBJDIR)/w16stdio.$(OBJ_SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_TARGET), OS2)
|
||||
OS_CFLAGS = $(OS_EXE_CFLAGS)
|
||||
endif
|
||||
|
@ -79,17 +74,11 @@ LIBPLC = -lplc$(NSPR_VERSION)
|
|||
LIBGC = -lmsgc$(GC_VERSION)
|
||||
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
ifeq ($(OS_TARGET), WIN16)
|
||||
LIBPR = $(dist_libdir)/nspr$(NSPR_VERSION).lib
|
||||
LIBPLC = $(dist_libdir)/plc$(NSPR_VERSION).lib
|
||||
LIBGC= $(dist_libdir)/msgc$(GC_VERSION).lib
|
||||
else
|
||||
LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
|
||||
LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).$(LIB_SUFFIX)
|
||||
LIBPLC = $(dist_libdir)/libplc$(NSPR_VERSION).$(LIB_SUFFIX)
|
||||
LIBGC= $(dist_libdir)/libmsgc$(GC_VERSION).$(LIB_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
LDOPTS += -Zomf -Zlinker /PM:VIO
|
||||
|
@ -266,23 +255,6 @@ else
|
|||
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
|
||||
@$(MAKE_OBJDIR)
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
ifeq ($(OS_TARGET),WIN16)
|
||||
echo system windows >w16link
|
||||
echo name $@ >>w16link
|
||||
echo option map >>w16link
|
||||
# echo option CASEEXACT >>w16link
|
||||
echo option stack=16K >>w16link
|
||||
echo debug $(DEBUGTYPE) all >>w16link
|
||||
echo file >>w16link
|
||||
echo $< , >>w16link
|
||||
echo $(W16STDIO) >>w16link
|
||||
echo library >>w16link
|
||||
echo $(LIBPR), >>w16link
|
||||
echo $(LIBPLC), >>w16link
|
||||
echo $(LIBGC), >>w16link
|
||||
echo winsock.lib >>w16link
|
||||
wlink @w16link.
|
||||
else
|
||||
link $(LDOPTS) $< $(LIBGC) $(LIBPLC) $(LIBPR) wsock32.lib -out:$@
|
||||
else
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
|
|
|
@ -46,10 +46,6 @@ include $(MOD_DEPTH)/config/autoconf.mk
|
|||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
ifeq ($(OS_TARGET), WIN16)
|
||||
OS_CFLAGS = $(OS_EXE_CFLAGS)
|
||||
endif
|
||||
|
||||
CXXSRCS = \
|
||||
testprstrm.cpp \
|
||||
$(NULL)
|
||||
|
@ -75,10 +71,6 @@ LIBPR = -lnspr$(MOD_MAJOR_VERSION)
|
|||
LIBPRSTRMS = -lprstrms$(MOD_MAJOR_VERSION)
|
||||
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
ifeq ($(OS_TARGET), WIN16)
|
||||
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
|
||||
LIBPRSTRMS = $(dist_libdir)/prstrms$(MOD_MAJOR_VERSION).lib
|
||||
else
|
||||
LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
|
||||
ifeq ($(OS_TARGET), WIN95)
|
||||
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
|
||||
|
@ -88,7 +80,6 @@ else
|
|||
LIBPRSTRMS = $(dist_libdir)/libprstrms$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
LDOPTS += -Zomf -Zlinker /PM:VIO -lstdcpp
|
||||
|
@ -211,23 +202,7 @@ else
|
|||
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
|
||||
@$(MAKE_OBJDIR)
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
ifeq ($(OS_TARGET),WIN16)
|
||||
echo system windows >w16link
|
||||
echo option map >>w16link
|
||||
echo option stack=10K >>w16link
|
||||
echo option heapsize=32K >>w16link
|
||||
echo debug $(DEBUGTYPE) all >>w16link
|
||||
echo name $@ >>w16link
|
||||
echo file >>w16link
|
||||
echo $< >>w16link
|
||||
echo library >>w16link
|
||||
echo $(LIBPR), >>w16link
|
||||
echo $(LIBPRSTRMS), >>w16link
|
||||
echo winsock.lib >>w16link
|
||||
wlink @w16link.
|
||||
else
|
||||
link $(LDOPTS) $< $(LIBPR) $(LIBPRSTRMS) wsock32.lib -out:$@
|
||||
endif
|
||||
else
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
$(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPR) $(LIBPRSTRMS) $(OS_LIBS) $(EXTRA_LIBS)
|
||||
|
|
|
@ -46,10 +46,6 @@ include $(MOD_DEPTH)/config/autoconf.mk
|
|||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
ifeq ($(OS_TARGET), WIN16)
|
||||
OS_CFLAGS = $(OS_EXE_CFLAGS)
|
||||
endif
|
||||
|
||||
CSRCS = \
|
||||
arena.c \
|
||||
base64t.c \
|
||||
|
@ -80,11 +76,6 @@ LIBPLC = -lplc$(MOD_MAJOR_VERSION)
|
|||
LIBPLDS = -lplds$(MOD_MAJOR_VERSION)
|
||||
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
ifeq ($(OS_TARGET), WIN16)
|
||||
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
|
||||
LIBPLC= $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
|
||||
LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).lib
|
||||
else
|
||||
LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
|
||||
ifeq ($(OS_TARGET), WIN95)
|
||||
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
|
||||
|
@ -96,7 +87,6 @@ else
|
|||
LIBPLDS= $(dist_libdir)/libplds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
LDOPTS += -Zomf -Zlinker /PM:VIO
|
||||
|
@ -214,23 +204,7 @@ $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
|
|||
@$(MAKE_OBJDIR)
|
||||
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
ifeq ($(OS_TARGET),WIN16)
|
||||
echo system windows >w16link
|
||||
echo option map >>w16link
|
||||
echo option stack=10K >>w16link
|
||||
echo option heapsize=32K >>w16link
|
||||
echo debug $(DEBUGTYPE) all >>w16link
|
||||
echo name $@ >>w16link
|
||||
echo file >>w16link
|
||||
echo $< >>w16link
|
||||
echo library >>w16link
|
||||
echo $(LIBPR), >>w16link
|
||||
echo $(LIBPLC), >>w16link
|
||||
echo winsock.lib >>w16link
|
||||
wlink @w16link.
|
||||
else
|
||||
link $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) wsock32.lib -out:$@
|
||||
endif
|
||||
else
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
$(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
|
||||
|
@ -243,6 +217,3 @@ endif
|
|||
export:: $(TARGETS)
|
||||
clean::
|
||||
rm -f $(TARGETS)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -46,12 +46,6 @@
|
|||
#define DIRECTORY_SEPARATOR_STR "\\"
|
||||
#define PATH_SEPARATOR ';'
|
||||
|
||||
#ifdef WIN16
|
||||
#define GCPTR __far
|
||||
#else
|
||||
#define GCPTR
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Routines for processing command line arguments
|
||||
*/
|
||||
|
|
|
@ -92,7 +92,6 @@
|
|||
#define PR_DIRECTORY_SEPARATOR_STR "/"
|
||||
#define PR_PATH_SEPARATOR ':'
|
||||
#define PR_PATH_SEPARATOR_STR ":"
|
||||
#define GCPTR
|
||||
typedef int (*FARPROC)();
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,177 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
** _win16.cfg -- prcpucfg.h for win16
|
||||
**
|
||||
**
|
||||
** lth. 14-Apr-1997. New. Made from _win95.cfg
|
||||
*/
|
||||
|
||||
#ifndef nspr_cpucfg___
|
||||
#define nspr_cpucfg___
|
||||
|
||||
#ifndef XP_PC
|
||||
#define XP_PC
|
||||
#endif
|
||||
|
||||
#ifndef WIN16
|
||||
#define WIN16
|
||||
#undef WIN32
|
||||
#endif
|
||||
|
||||
#if defined(_M_IX86) || defined(_X86_)
|
||||
|
||||
#define IS_LITTLE_ENDIAN 1
|
||||
#undef IS_BIG_ENDIAN
|
||||
|
||||
#define PR_BYTES_PER_BYTE 1
|
||||
#define PR_BYTES_PER_SHORT 2
|
||||
#define PR_BYTES_PER_INT 2
|
||||
#define PR_BYTES_PER_INT64 8
|
||||
#define PR_BYTES_PER_LONG 4
|
||||
#define PR_BYTES_PER_FLOAT 4
|
||||
#define PR_BYTES_PER_WORD 4
|
||||
#define PR_BYTES_PER_DWORD 8
|
||||
#define PR_BYTES_PER_DOUBLE 8
|
||||
|
||||
#define PR_BITS_PER_BYTE 8
|
||||
#define PR_BITS_PER_SHORT 16
|
||||
#define PR_BITS_PER_INT 16
|
||||
#define PR_BITS_PER_INT64 64
|
||||
#define PR_BITS_PER_LONG 32
|
||||
#define PR_BITS_PER_FLOAT 32
|
||||
#define PR_BITS_PER_WORD 32
|
||||
#define PR_BITS_PER_DWORD 64
|
||||
#define PR_BITS_PER_DOUBLE 64
|
||||
|
||||
#define PR_BITS_PER_BYTE_LOG2 3
|
||||
#define PR_BITS_PER_SHORT_LOG2 4
|
||||
#define PR_BITS_PER_INT_LOG2 4
|
||||
#define PR_BITS_PER_INT64_LOG2 6
|
||||
#define PR_BITS_PER_LONG_LOG2 5
|
||||
#define PR_BITS_PER_FLOAT_LOG2 5
|
||||
#define PR_BITS_PER_WORD_LOG2 4
|
||||
#define PR_BITS_PER_DWORD_LOG2 6
|
||||
#define PR_BITS_PER_DOUBLE_LOG2 6
|
||||
|
||||
#define PR_ALIGN_OF_SHORT 2
|
||||
#define PR_ALIGN_OF_INT 2
|
||||
#define PR_ALIGN_OF_LONG 4
|
||||
#define PR_ALIGN_OF_INT64 8
|
||||
#define PR_ALIGN_OF_FLOAT 4
|
||||
#define PR_ALIGN_OF_WORD 2
|
||||
#define PR_ALIGN_OF_DWORD 8
|
||||
#define PR_ALIGN_OF_DOUBLE 4
|
||||
#define PR_ALIGN_OF_POINTER 4
|
||||
|
||||
#define PR_BYTES_PER_WORD_LOG2 2
|
||||
#define PR_BYTES_PER_DWORD_LOG2 2
|
||||
|
||||
#else /* defined(_M_IX86) || defined(_X86_) */
|
||||
|
||||
#error unknown processor architecture
|
||||
|
||||
#endif /* defined(_M_IX86) || defined(_X86_) */
|
||||
|
||||
#ifndef NO_NSPR_10_SUPPORT
|
||||
|
||||
#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
|
||||
#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
|
||||
#define BYTES_PER_INT PR_BYTES_PER_INT
|
||||
#define BYTES_PER_INT64 PR_BYTES_PER_INT64
|
||||
#define BYTES_PER_LONG PR_BYTES_PER_LONG
|
||||
#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
|
||||
#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
|
||||
#define BYTES_PER_WORD PR_BYTES_PER_WORD
|
||||
#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
|
||||
|
||||
#define BITS_PER_BYTE PR_BITS_PER_BYTE
|
||||
#define BITS_PER_SHORT PR_BITS_PER_SHORT
|
||||
#define BITS_PER_INT PR_BITS_PER_INT
|
||||
#define BITS_PER_INT64 PR_BITS_PER_INT64
|
||||
#define BITS_PER_LONG PR_BITS_PER_LONG
|
||||
#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
|
||||
#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
|
||||
#define BITS_PER_WORD PR_BITS_PER_WORD
|
||||
|
||||
#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
|
||||
#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
|
||||
#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
|
||||
#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
|
||||
#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
|
||||
#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
|
||||
#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
|
||||
#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
|
||||
|
||||
#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
|
||||
#define ALIGN_OF_INT PR_ALIGN_OF_INT
|
||||
#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
|
||||
#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
|
||||
#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
|
||||
#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
|
||||
#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
|
||||
#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
|
||||
|
||||
#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
|
||||
#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
|
||||
#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
|
||||
|
||||
#endif /* NO_NSPR_10_SUPPORT */
|
||||
|
||||
#undef HAVE_LONG_LONG
|
||||
|
||||
/*
|
||||
** HAVE_WATCOM_BUG_1
|
||||
** When HAVE_WATCOM_BUG_1 is defined, special case code is
|
||||
** used to circumvent the bug.
|
||||
** Functions declared __cdecl in DLLs returning floating point types
|
||||
** generate bad return code and will not return the intended result.
|
||||
*/
|
||||
#define HAVE_WATCOM_BUG_1
|
||||
|
||||
/*
|
||||
** HAVE_WATCOM_BUG_2
|
||||
** When HAVE_WATCOM_BUG_2 is defined, special case code is
|
||||
** used to circumvent the bug.
|
||||
** Functions declared __cdecl in DLLs returning a structure by value
|
||||
** generate bad return values.
|
||||
** Yes, similar to Watcom Bug 1.
|
||||
*/
|
||||
#define HAVE_WATCOM_BUG_2
|
||||
|
||||
#endif /* nspr_cpucfg___ */
|
|
@ -1,568 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nspr_win16_defs_h___
|
||||
#define nspr_win16_defs_h___
|
||||
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
#include <errno.h>
|
||||
#include <direct.h>
|
||||
|
||||
#include "nspr.h"
|
||||
/* $$ fix this */
|
||||
#define Remind(x)
|
||||
|
||||
/*
|
||||
* Internal configuration macros
|
||||
*/
|
||||
|
||||
#define PR_LINKER_ARCH "win16"
|
||||
#define _PR_SI_SYSNAME "WIN16"
|
||||
#define _PR_SI_ARCHITECTURE "x86" /* XXXMB hardcode for now */
|
||||
|
||||
#define HAVE_DLL
|
||||
#define _PR_NO_PREEMPT
|
||||
#define _PR_LOCAL_THREADS_ONLY
|
||||
#undef _PR_GLOBAL_THREADS_ONLY
|
||||
#undef HAVE_THREAD_AFFINITY
|
||||
#define _PR_HAVE_ATOMIC_OPS
|
||||
|
||||
/* --- Common User-Thread/Native-Thread Definitions --------------------- */
|
||||
|
||||
extern struct PRLock *_pr_schedLock;
|
||||
extern char * _pr_top_of_task_stack;
|
||||
|
||||
|
||||
/* --- Typedefs --- */
|
||||
|
||||
#define PR_NUM_GCREGS 9
|
||||
typedef PRInt32 PR_CONTEXT_TYPE[PR_NUM_GCREGS];
|
||||
|
||||
#define _MD_MAGIC_THREAD 0x22222222
|
||||
#define _MD_MAGIC_THREADSTACK 0x33333333
|
||||
#define _MD_MAGIC_SEGMENT 0x44444444
|
||||
#define _MD_MAGIC_DIR 0x55555555
|
||||
#define _MD_MAGIC_CV 0x66666666
|
||||
|
||||
|
||||
typedef struct _PRWin16PollDesc
|
||||
{
|
||||
PRInt32 osfd;
|
||||
PRInt16 in_flags;
|
||||
PRInt16 out_flags;
|
||||
} _PRWin16PollDesc;
|
||||
|
||||
typedef struct PRPollQueue
|
||||
{
|
||||
PRCList links; /* for linking PRPollQueue's together */
|
||||
_PRWin16PollDesc *pds; /* array of poll descriptors */
|
||||
PRUintn npds; /* length of the array */
|
||||
PRPackedBool on_ioq; /* is this on the async i/o work q? */
|
||||
PRIntervalTime timeout; /* timeout, in ticks */
|
||||
struct PRThread *thr;
|
||||
} PRPollQueue;
|
||||
|
||||
#define _PR_POLLQUEUE_PTR(_qp) \
|
||||
((PRPollQueue *) ((char*) (_qp) - offsetof(PRPollQueue,links)))
|
||||
|
||||
NSPR_API(PRInt32) _PR_WaitForFD(PRInt32 osfd, PRUintn how,
|
||||
PRIntervalTime timeout);
|
||||
NSPR_API(void) _PR_Unblock_IO_Wait(struct PRThread *thr);
|
||||
|
||||
#define _PR_MD_MAX_OSFD FD_SETSIZE
|
||||
#define _PR_IOQ(_cpu) ((_cpu)->md.ioQ)
|
||||
#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
|
||||
#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.fd_read_set)
|
||||
#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.fd_read_cnt)
|
||||
#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.fd_write_set)
|
||||
#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.fd_write_cnt)
|
||||
#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.fd_exception_set)
|
||||
#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.fd_exception_cnt)
|
||||
#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.ioq_timeout)
|
||||
#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.ioq_max_osfd)
|
||||
|
||||
struct _MDCPU {
|
||||
PRCList ioQ;
|
||||
fd_set fd_read_set, fd_write_set, fd_exception_set;
|
||||
PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
|
||||
fd_exception_cnt[_PR_MD_MAX_OSFD];
|
||||
PRUint32 ioq_timeout;
|
||||
PRInt32 ioq_max_osfd;
|
||||
};
|
||||
|
||||
struct _MDThread {
|
||||
/* The overlapped structure must be first! */
|
||||
HANDLE blocked_sema; /* Threads block on this when waiting
|
||||
* for IO or CondVar.
|
||||
*/
|
||||
PRInt32 errcode; /* preserved errno for this thread */
|
||||
CATCHBUF context; /* thread context for Throw() */
|
||||
void *SP; /* Stack pointer, used only by GarbColl */
|
||||
int threadNumber; /* instrumentation: order of creation */
|
||||
_PRWin16PollDesc thr_pd; /* poll descriptor for i/o */
|
||||
PRPollQueue thr_pq; /* i/o parameters */
|
||||
void *exceptionContext; /* mfc exception context */
|
||||
char guardBand[24]; /* don't overwrite this */
|
||||
PRUint32 magic; /* self identifier, for debug */
|
||||
};
|
||||
|
||||
struct _MDThreadStack {
|
||||
PRUint32 magic; /* for debugging */
|
||||
PRIntn cxByteCount; /* number of stack bytes to move */
|
||||
char * stackTop; /* high address on stack */
|
||||
};
|
||||
|
||||
struct _MDSegment {
|
||||
PRUint32 magic; /* for debugging */
|
||||
};
|
||||
|
||||
|
||||
struct _MDLock {
|
||||
PRUint32 magic; /* for debugging */
|
||||
PRUint32 mutex;
|
||||
};
|
||||
|
||||
struct _MDDir {
|
||||
PRUint32 magic; /* for debugging */
|
||||
struct dirent *dir;
|
||||
};
|
||||
|
||||
struct _MDCVar {
|
||||
PRUint32 magic;
|
||||
};
|
||||
|
||||
struct _MDSemaphore {
|
||||
PRInt32 unused;
|
||||
};
|
||||
|
||||
struct _MDFileDesc {
|
||||
PRInt32 osfd;
|
||||
};
|
||||
|
||||
struct _MDProcess {
|
||||
HANDLE handle;
|
||||
DWORD id;
|
||||
};
|
||||
|
||||
/*
|
||||
** Microsoft 'struct _stat'
|
||||
** ... taken directly from msvc 1.52c's header file sys/stat.h
|
||||
** see PR_Stat() implemented in w16io.c
|
||||
** See BugSplat: 98516
|
||||
*/
|
||||
#pragma pack(push)
|
||||
#pragma pack(2)
|
||||
|
||||
typedef unsigned short _ino_t;
|
||||
typedef short _dev_t;
|
||||
typedef long _off_t;
|
||||
|
||||
typedef struct _MDMSStat {
|
||||
_dev_t st_dev;
|
||||
_ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
_dev_t st_rdev;
|
||||
_off_t st_size;
|
||||
time_t st_atime;
|
||||
time_t st_mtime;
|
||||
time_t st_ctime;
|
||||
} _MDMSStat;
|
||||
#pragma pack(pop)
|
||||
|
||||
/* --- Errors --- */
|
||||
/* These are NSPR generated error codes which need to be unique from
|
||||
* OS error codes.
|
||||
*/
|
||||
#define _MD_UNIQUEBASE 50000
|
||||
#define _MD_EINTERRUPTED _MD_UNIQUEBASE + 1
|
||||
#define _MD_ETIMEDOUT _MD_UNIQUEBASE + 2
|
||||
#define _MD_EIO _MD_UNIQUEBASE + 3
|
||||
|
||||
struct PRProcess;
|
||||
struct PRProcessAttr;
|
||||
|
||||
/* --- Create a new process --- */
|
||||
#define _MD_CREATE_PROCESS _PR_CreateWindowsProcess
|
||||
extern struct PRProcess * _PR_CreateWindowsProcess(
|
||||
const char *path,
|
||||
char *const *argv,
|
||||
char *const *envp,
|
||||
const struct PRProcessAttr *attr
|
||||
);
|
||||
|
||||
#define _MD_DETACH_PROCESS _PR_DetachWindowsProcess
|
||||
extern PRStatus _PR_DetachWindowsProcess(struct PRProcess *process);
|
||||
|
||||
/* --- Wait for a child process to terminate --- */
|
||||
#define _MD_WAIT_PROCESS _PR_WaitWindowsProcess
|
||||
extern PRStatus _PR_WaitWindowsProcess(struct PRProcess *process,
|
||||
PRInt32 *exitCode);
|
||||
|
||||
#define _MD_KILL_PROCESS _PR_KillWindowsProcess
|
||||
extern PRStatus _PR_KillWindowsProcess(struct PRProcess *process);
|
||||
|
||||
|
||||
/* --- Misc stuff --- */
|
||||
|
||||
#define MD_ASSERTINT( x ) PR_ASSERT( (x) < 65535 )
|
||||
|
||||
/* --- IO stuff --- */
|
||||
#define MAX_PATH 256
|
||||
#define _MD_ERRNO() errno
|
||||
#define GetLastError() errno
|
||||
|
||||
#define _MD_GET_FILE_ERROR() errno
|
||||
#define _MD_SET_FILE_ERROR(_err) errno = (_err)
|
||||
|
||||
#define _MD_OPEN _PR_MD_OPEN
|
||||
#define _MD_READ _PR_MD_READ
|
||||
#define _MD_WRITE _PR_MD_WRITE
|
||||
#define _MD_WRITEV _PR_MD_WRITEV
|
||||
#define _MD_LSEEK _PR_MD_LSEEK
|
||||
#define _MD_LSEEK64 _PR_MD_LSEEK64
|
||||
#define _MD_CLOSE_FILE _PR_MD_CLOSE_FILE
|
||||
#define _MD_GETFILEINFO _PR_MD_GETFILEINFO
|
||||
#define _MD_GETOPENFILEINFO _PR_MD_GETOPENFILEINFO
|
||||
#define _MD_STAT _PR_MD_STAT
|
||||
#define _MD_RENAME _PR_MD_RENAME
|
||||
#define _MD_ACCESS _PR_MD_ACCESS
|
||||
#define _MD_DELETE _PR_MD_DELETE
|
||||
#define _MD_MKDIR _PR_MD_MKDIR
|
||||
#define _MD_RMDIR _PR_MD_RMDIR
|
||||
#define _MD_LOCKFILE _PR_MD_LOCKFILE
|
||||
#define _MD_TLOCKFILE _PR_MD_TLOCKFILE
|
||||
#define _MD_UNLOCKFILE _PR_MD_UNLOCKFILE
|
||||
|
||||
|
||||
/* --- Socket IO stuff --- */
|
||||
#define _MD_EACCES WSAEACCES
|
||||
#define _MD_EADDRINUSE WSAEADDRINUSE
|
||||
#define _MD_EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#define _MD_EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#define _MD_EAGAIN WSAEWOULDBLOCK
|
||||
#define _MD_EALREADY WSAEALREADY
|
||||
#define _MD_EBADF WSAEBADF
|
||||
#define _MD_ECONNREFUSED WSAECONNREFUSED
|
||||
#define _MD_ECONNRESET WSAECONNRESET
|
||||
#define _MD_EFAULT WSAEFAULT
|
||||
#define _MD_EINPROGRESS WSAEINPROGRESS
|
||||
#define _MD_EINTR WSAEINTR
|
||||
#define _MD_EINVAL EINVAL
|
||||
#define _MD_EISCONN WSAEISCONN
|
||||
#define _MD_ENETUNREACH WSAENETUNREACH
|
||||
#define _MD_ENOENT ENOENT
|
||||
#define _MD_ENOTCONN WSAENOTCONN
|
||||
#define _MD_ENOTSOCK WSAENOTSOCK
|
||||
#define _MD_EOPNOTSUPP WSAEOPNOTSUPP
|
||||
#define _MD_EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define _MD_GET_SOCKET_ERROR() WSAGetLastError()
|
||||
#define _MD_SET_SOCKET_ERROR(_err) WSASetLastError(_err)
|
||||
|
||||
#define _MD_INIT_FILEDESC(fd)
|
||||
#define _MD_MAKE_NONBLOCK _PR_MD_MAKE_NONBLOCK
|
||||
#define _MD_SHUTDOWN _PR_MD_SHUTDOWN
|
||||
#define _MD_LISTEN _PR_MD_LISTEN
|
||||
#define _MD_CLOSE_SOCKET _PR_MD_CLOSE_SOCKET
|
||||
#define _MD_SENDTO _PR_MD_SENDTO
|
||||
#define _MD_RECVFROM _PR_MD_RECVFROM
|
||||
#define _MD_SOCKETPAIR(s, type, proto, sv) -1
|
||||
#define _MD_GETSOCKNAME _PR_MD_GETSOCKNAME
|
||||
#define _MD_GETPEERNAME _PR_MD_GETPEERNAME
|
||||
#define _MD_GETSOCKOPT _PR_MD_GETSOCKOPT
|
||||
#define _MD_SETSOCKOPT _PR_MD_SETSOCKOPT
|
||||
#define _MD_SELECT select
|
||||
#define _MD_FSYNC _PR_MD_FSYNC
|
||||
#define _MD_SOCKETAVAILABLE _PR_MD_SOCKETAVAILABLE
|
||||
|
||||
#define _MD_INIT_ATOMIC()
|
||||
#define _MD_ATOMIC_INCREMENT(x) (*x++)
|
||||
#define _MD_ATOMIC_ADD(ptr, val) ((*x) += val)
|
||||
#define _MD_ATOMIC_DECREMENT(x) (*x--)
|
||||
#define _MD_ATOMIC_SET(x,y) (*x, y)
|
||||
|
||||
#define _MD_INIT_IO _PR_MD_INIT_IO
|
||||
|
||||
/* win95 doesn't have async IO */
|
||||
#define _MD_SOCKET _PR_MD_SOCKET
|
||||
#define _MD_CONNECT _PR_MD_CONNECT
|
||||
#define _MD_ACCEPT _PR_MD_ACCEPT
|
||||
#define _MD_BIND _PR_MD_BIND
|
||||
#define _MD_RECV _PR_MD_RECV
|
||||
#define _MD_SEND _PR_MD_SEND
|
||||
|
||||
#define _MD_CHECK_FOR_EXIT()
|
||||
|
||||
/* --- Scheduler stuff --- */
|
||||
#define _MD_PAUSE_CPU _PR_MD_PAUSE_CPU
|
||||
|
||||
/* --- DIR stuff --- */
|
||||
#define PR_DIRECTORY_SEPARATOR '\\'
|
||||
#define PR_DIRECTORY_SEPARATOR_STR "\\"
|
||||
#define PR_PATH_SEPARATOR ';'
|
||||
#define PR_PATH_SEPARATOR_STR ";"
|
||||
#define _MD_OPEN_DIR _PR_MD_OPEN_DIR
|
||||
#define _MD_CLOSE_DIR _PR_MD_CLOSE_DIR
|
||||
#define _MD_READ_DIR _PR_MD_READ_DIR
|
||||
|
||||
/* --- Segment stuff --- */
|
||||
#define _MD_INIT_SEGS()
|
||||
#define _MD_ALLOC_SEGMENT _MD_AllocSegment
|
||||
#define _MD_FREE_SEGMENT _MD_FreeSegment
|
||||
|
||||
/* --- Environment Stuff --- */
|
||||
#define _MD_GET_ENV _PR_MD_GET_ENV
|
||||
#define _MD_PUT_ENV _PR_MD_PUT_ENV
|
||||
|
||||
/* --- Threading Stuff --- */
|
||||
#define _MD_DEFAULT_STACK_SIZE 32767L
|
||||
#define _MD_INIT_THREAD _PR_MD_INIT_THREAD
|
||||
#define _MD_CREATE_THREAD(t,f,p,sc,st,stsiz) (PR_SUCCESS)
|
||||
#define _MD_YIELD _PR_MD_YIELD
|
||||
#define _MD_SET_PRIORITY(t,p)
|
||||
#define _MD_CLEAN_THREAD(t)
|
||||
#define _MD_SETTHREADAFFINITYMASK _PR_MD_SETTHREADAFFINITYMASK
|
||||
#define _MD_GETTHREADAFFINITYMASK _PR_MD_GETTHREADAFFINITYMASK
|
||||
#define _MD_EXIT_THREAD
|
||||
#define _MD_SUSPEND_THREAD _PR_MD_SUSPEND_THREAD
|
||||
#define _MD_RESUME_THREAD _PR_MD_RESUME_THREAD
|
||||
#define _MD_SUSPEND_CPU _PR_MD_SUSPEND_CPU
|
||||
#define _MD_RESUME_CPU _PR_MD_RESUME_CPU
|
||||
#define _MD_BEGIN_SUSPEND_ALL()
|
||||
#define _MD_BEGIN_RESUME_ALL()
|
||||
#define _MD_END_SUSPEND_ALL()
|
||||
#define _MD_END_RESUME_ALL()
|
||||
|
||||
/* --- Lock stuff --- */
|
||||
/*
|
||||
** Win16 does not need MD locks.
|
||||
*/
|
||||
#define _PR_LOCK _MD_LOCK
|
||||
#define _PR_UNLOCK _MD_UNLOCK
|
||||
|
||||
#define _MD_NEW_LOCK(l) (PR_SUCCESS)
|
||||
#define _MD_FREE_LOCK(l)
|
||||
#define _MD_LOCK(l)
|
||||
#define _MD_TEST_AND_LOCK(l) (-1)
|
||||
#define _MD_UNLOCK(l)
|
||||
|
||||
/* --- lock and cv waiting --- */
|
||||
#define _MD_WAIT _PR_MD_WAIT
|
||||
#define _MD_WAKEUP_WAITER(a)
|
||||
#define _MD_WAKEUP_CPUS _PR_MD_WAKEUP_CPUS
|
||||
|
||||
/* --- CVar ------------------- */
|
||||
#define _MD_WAIT_CV _PR_MD_WAIT_CV
|
||||
#define _MD_NEW_CV _PR_MD_NEW_CV
|
||||
#define _MD_FREE_CV _PR_MD_FREE_CV
|
||||
#define _MD_NOTIFY_CV _PR_MD_NOTIFY_CV
|
||||
#define _MD_NOTIFYALL_CV _PR_MD_NOTIFYALL_CV
|
||||
|
||||
/* XXXMB- the IOQ stuff is certainly not working correctly yet. */
|
||||
#define _MD_IOQ_LOCK()
|
||||
#define _MD_IOQ_UNLOCK()
|
||||
|
||||
|
||||
/* --- Initialization stuff --- */
|
||||
NSPR_API(void) _MD_INIT_RUNNING_CPU(struct _PRCPU *cpu );
|
||||
#define _MD_START_INTERRUPTS()
|
||||
#define _MD_STOP_INTERRUPTS()
|
||||
#define _MD_DISABLE_CLOCK_INTERRUPTS()
|
||||
#define _MD_ENABLE_CLOCK_INTERRUPTS()
|
||||
#define _MD_BLOCK_CLOCK_INTERRUPTS()
|
||||
#define _MD_UNBLOCK_CLOCK_INTERRUPTS()
|
||||
#define _MD_EARLY_INIT _PR_MD_EARLY_INIT
|
||||
#define _MD_FINAL_INIT _PR_MD_FINAL_INIT
|
||||
#define _MD_INIT_CPUS()
|
||||
|
||||
/* --- User Threading stuff --- */
|
||||
#define _MD_EXIT
|
||||
|
||||
#define _MD_CLEANUP_BEFORE_EXIT _PR_MD_CLEANUP_BEFORE_EXIT
|
||||
|
||||
/* --- Intervals --- */
|
||||
#define _MD_INTERVAL_INIT _PR_MD_INTERVAL_INIT
|
||||
#define _MD_GET_INTERVAL _PR_MD_GET_INTERVAL
|
||||
#define _MD_INTERVAL_PER_SEC _PR_MD_INTERVAL_PER_SEC
|
||||
#define _MD_INTERVAL_PER_MILLISEC() (_PR_MD_INTERVAL_PER_SEC() / 1000)
|
||||
#define _MD_INTERVAL_PER_MICROSEC() (_PR_MD_INTERVAL_PER_SEC() / 1000000)
|
||||
|
||||
/* --- Scheduler stuff --- */
|
||||
#define LOCK_SCHEDULER() 0
|
||||
#define UNLOCK_SCHEDULER() 0
|
||||
#define _PR_LockSched() 0
|
||||
#define _PR_UnlockSched() 0
|
||||
|
||||
/* --- Initialization stuff --- */
|
||||
#define _MD_INIT_LOCKS()
|
||||
|
||||
/* --- Stack stuff --- */
|
||||
#define _MD_INIT_STACK _PR_MD_INIT_STACK
|
||||
#define _MD_CLEAR_STACK(stack)
|
||||
|
||||
/*
|
||||
** Watcom needs to see this to make the linker work.
|
||||
**
|
||||
*/
|
||||
NSPR_API(void) _PR_NativeDestroyThread(PRThread *thread);
|
||||
NSPR_API(void) _PR_UserDestroyThread(PRThread *thread);
|
||||
|
||||
|
||||
/*
|
||||
** If thread emulation is used, then setjmp/longjmp stores the register
|
||||
** state of each thread.
|
||||
**
|
||||
** CatchBuf layout:
|
||||
** context[0] - IP
|
||||
** context[1] - CS
|
||||
** context[2] - SP
|
||||
** context[3] - BP
|
||||
** context[4] - SI
|
||||
** context[5] - DI
|
||||
** context[6] - DS
|
||||
** context[7] - ?? (maybe flags)
|
||||
** context[8] - SS
|
||||
*/
|
||||
#define PR_CONTEXT_TYPE CATCHBUF
|
||||
#define PR_NUM_GCREGS 9
|
||||
|
||||
#define _MD_GET_SP(thread) ((thread)->md.SP)
|
||||
#define CONTEXT(_t) ((_t)->md.context)
|
||||
|
||||
/*
|
||||
** Initialize a thread context to run "e(o,a)" when started
|
||||
*/
|
||||
#define _MD_INIT_CONTEXT(_t, sp, epa, stat ) \
|
||||
{ \
|
||||
*(stat) = PR_TRUE; \
|
||||
Catch((_t)->md.context ); \
|
||||
(_t)->md.context[0] = OFFSETOF(epa); \
|
||||
(_t)->md.context[1] = SELECTOROF(epa); \
|
||||
(_t)->md.context[2] = OFFSETOF(_pr_top_of_task_stack - 64); \
|
||||
(_t)->md.context[3] = 0; \
|
||||
}
|
||||
|
||||
#define _MD_SWITCH_CONTEXT(_t) \
|
||||
if (!Catch((_t)->md.context)) { \
|
||||
int garbCollPlaceHolder; \
|
||||
(_t)->md.errcode = errno; \
|
||||
(_t)->md.SP = &garbCollPlaceHolder; \
|
||||
_PR_Schedule(); \
|
||||
}
|
||||
|
||||
#define _MD_SAVE_CONTEXT(_t) \
|
||||
{ \
|
||||
int garbCollPlaceHolder; \
|
||||
Catch((_t)->md.context); \
|
||||
(_t)->md.errcode = errno; \
|
||||
(_t)->md.SP = &garbCollPlaceHolder; \
|
||||
}
|
||||
|
||||
/*
|
||||
** Restore a thread context, saved by _MD_SWITCH_CONTEXT
|
||||
*/
|
||||
#define _PR_MD_RESTORE_CONTEXT _MD_RESTORE_CONTEXT
|
||||
|
||||
/*
|
||||
* Memory-mapped files
|
||||
*/
|
||||
|
||||
struct _MDFileMap {
|
||||
PRInt8 unused;
|
||||
};
|
||||
|
||||
extern PRStatus _MD_CreateFileMap(struct PRFileMap *fmap, PRInt64 size);
|
||||
#define _MD_CREATE_FILE_MAP _MD_CreateFileMap
|
||||
|
||||
extern PRInt32 _MD_GetMemMapAlignment(void);
|
||||
#define _MD_GET_MEM_MAP_ALIGNMENT _MD_GetMemMapAlignment
|
||||
|
||||
extern void * _MD_MemMap(struct PRFileMap *fmap, PRInt64 offset,
|
||||
PRUint32 len);
|
||||
#define _MD_MEM_MAP _MD_MemMap
|
||||
|
||||
extern PRStatus _MD_MemUnmap(void *addr, PRUint32 size);
|
||||
#define _MD_MEM_UNMAP _MD_MemUnmap
|
||||
|
||||
extern PRStatus _MD_CloseFileMap(struct PRFileMap *fmap);
|
||||
#define _MD_CLOSE_FILE_MAP _MD_CloseFileMap
|
||||
|
||||
|
||||
/* --- Error mapping ----------------------------------- */
|
||||
extern void _PR_MD_map_error( int err );
|
||||
|
||||
#define _PR_MD_MAP_OPENDIR_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_CLOSEDIR_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_READDIR_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_DELETE_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_STAT_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_FSTAT_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_RENAME_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_ACCESS_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_MKDIR_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_RMDIR_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_READ_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_TRANSMITFILE_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_WRITE_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_LSEEK_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_FSYNC_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_CLOSE_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_SOCKET_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_RECV_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_RECVFROM_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_SEND_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_SENDTO_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_ACCEPT_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_ACCEPTEX_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_CONNECT_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_BIND_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_LISTEN_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_SHUTDOWN_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_GETSOCKNAME_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_GETPEERNAME_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_GETSOCKOPT_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_SETSOCKOPT_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_OPEN_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_GETHOSTNAME_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_SELECT_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_LOCKF_ERROR _PR_MD_map_error
|
||||
#define _PR_MD_MAP_WSASTARTUP_ERROR _PR_MD_map_error
|
||||
|
||||
#endif /* nspr_win16_defs_h___ */
|
|
@ -54,8 +54,6 @@ PR_BEGIN_EXTERN_C
|
|||
#elif defined(WIN95) || defined(WINCE)
|
||||
#include "md/_win95.h"
|
||||
#include "md/_win32_errors.h"
|
||||
#elif defined(WIN16)
|
||||
#include "md/_win16.h"
|
||||
#elif defined(OS2)
|
||||
#include "md/_os2.h"
|
||||
#include "md/_os2_errors.h"
|
||||
|
|
|
@ -53,14 +53,7 @@ PR_BEGIN_EXTERN_C
|
|||
** to by se. If no number can be formed, se is set to s00, and
|
||||
** zero is returned.
|
||||
*/
|
||||
#if defined(HAVE_WATCOM_BUG_1)
|
||||
/* this is a hack to circumvent a bug in the Watcom C/C++ 11.0 compiler
|
||||
** When Watcom fixes the bug, remove the special case for Win16
|
||||
*/
|
||||
PRFloat64 __pascal __loadds __export
|
||||
#else
|
||||
NSPR_API(PRFloat64)
|
||||
#endif
|
||||
PR_strtod(const char *s00, char **se);
|
||||
|
||||
/*
|
||||
|
|
|
@ -118,10 +118,6 @@ struct sockaddr_dl;
|
|||
* an unfortunate inconsistency with other platforms.
|
||||
*/
|
||||
|
||||
#elif defined(WIN16)
|
||||
|
||||
#include <winsock.h>
|
||||
|
||||
#else
|
||||
|
||||
#error Unknown platform
|
||||
|
|
|
@ -78,6 +78,9 @@ typedef PRUint32 PRIntervalTime;
|
|||
** Two reserved constants are defined in the PRIntervalTime namespace.
|
||||
** They are used to indicate that the process should wait no time (return
|
||||
** immediately) or wait forever (never time out), respectively.
|
||||
** Note: PR_INTERVAL_NO_TIMEOUT passed as input to PR_Connect is
|
||||
** interpreted as use the OS's connect timeout.
|
||||
**
|
||||
***********************************************************************/
|
||||
#define PR_INTERVAL_NO_WAIT 0UL
|
||||
#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
|
||||
|
|
|
@ -1265,7 +1265,11 @@ NSPR_API(PRFileDesc*) PR_OpenTCPSocket(PRIntn af);
|
|||
* Specifies the address of the socket in its own communication
|
||||
* space.
|
||||
* PRIntervalTime timeout
|
||||
* Time limit for completion of the connect operation.
|
||||
* The function uses the lesser of the provided timeout and
|
||||
* the OS's connect timeout. In particular, if you specify
|
||||
* PR_INTERVAL_NO_TIMEOUT as the timeout, the OS's connection
|
||||
* time limit will be used.
|
||||
*
|
||||
* OUTPUTS:
|
||||
* None
|
||||
* RETURN: PRStatus
|
||||
|
|
|
@ -116,6 +116,26 @@ NSPR_API(void) PR_Lock(PRLock *lock);
|
|||
***********************************************************************/
|
||||
NSPR_API(PRStatus) PR_Unlock(PRLock *lock);
|
||||
|
||||
/***********************************************************************
|
||||
** MACRO: PR_ASSERT_CURRENT_THREAD_OWNS_LOCK
|
||||
** DESCRIPTION:
|
||||
** If the current thread owns |lock|, this assertion is guaranteed to
|
||||
** succeed. Otherwise, the behavior of this function is undefined.
|
||||
** INPUTS: PRLock *lock
|
||||
** Lock to assert ownership of.
|
||||
** OUTPUTS: void
|
||||
** RETURN: None
|
||||
***********************************************************************/
|
||||
#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
|
||||
#define PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(/* PrLock* */ lock) \
|
||||
PR_AssertCurrentThreadOwnsLock(lock)
|
||||
#else
|
||||
#define PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(/* PrLock* */ lock)
|
||||
#endif
|
||||
|
||||
/* Don't call this function directly. */
|
||||
NSPR_API(void) PR_AssertCurrentThreadOwnsLock(PRLock *lock);
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* prlock_h___ */
|
||||
|
|
|
@ -189,11 +189,7 @@ NSPR_API(void) PR_LogPrint(const char *fmt, ...);
|
|||
*/
|
||||
NSPR_API(void) PR_LogFlush(void);
|
||||
|
||||
/*
|
||||
** Windoze 16 can't support a large static string space for all of the
|
||||
** various debugging strings so logging is not enabled for it.
|
||||
*/
|
||||
#if (defined(DEBUG) || defined(FORCE_PR_LOG)) && !defined(WIN16)
|
||||
#if defined(DEBUG) || defined(FORCE_PR_LOG)
|
||||
#define PR_LOGGING 1
|
||||
|
||||
#define PR_LOG_TEST(_module,_level) \
|
||||
|
@ -213,13 +209,13 @@ NSPR_API(void) PR_LogFlush(void);
|
|||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
#else /* (defined(DEBUG) || defined(FORCE_PR_LOG)) && !defined(WIN16) */
|
||||
#else /* defined(DEBUG) || defined(FORCE_PR_LOG) */
|
||||
|
||||
#undef PR_LOGGING
|
||||
#define PR_LOG_TEST(module,level) 0
|
||||
#define PR_LOG(module,level,args)
|
||||
|
||||
#endif /* (defined(DEBUG) || defined(FORCE_PR_LOG)) && !defined(WIN16) */
|
||||
#endif /* defined(DEBUG) || defined(FORCE_PR_LOG) */
|
||||
|
||||
#ifndef NO_NSPR_10_SUPPORT
|
||||
|
||||
|
|
|
@ -59,21 +59,10 @@ PR_BEGIN_EXTERN_C
|
|||
** Various interesting constants and static variable
|
||||
** initializer
|
||||
***********************************************************************/
|
||||
#if defined(HAVE_WATCOM_BUG_2)
|
||||
PRInt64 __pascal __loadds __export
|
||||
LL_MaxInt(void);
|
||||
PRInt64 __pascal __loadds __export
|
||||
LL_MinInt(void);
|
||||
PRInt64 __pascal __loadds __export
|
||||
LL_Zero(void);
|
||||
PRUint64 __pascal __loadds __export
|
||||
LL_MaxUint(void);
|
||||
#else
|
||||
NSPR_API(PRInt64) LL_MaxInt(void);
|
||||
NSPR_API(PRInt64) LL_MinInt(void);
|
||||
NSPR_API(PRInt64) LL_Zero(void);
|
||||
NSPR_API(PRUint64) LL_MaxUint(void);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LONG_LONG)
|
||||
|
||||
|
@ -83,7 +72,7 @@ NSPR_API(PRUint64) LL_MaxUint(void);
|
|||
#define LL_ZERO 0L
|
||||
#define LL_MAXUINT 18446744073709551615UL
|
||||
#define LL_INIT(hi, lo) ((hi ## L << 32) + lo ## L)
|
||||
#elif (defined(WIN32) || defined(WIN16)) && !defined(__GNUC__)
|
||||
#elif defined(WIN32) && !defined(__GNUC__)
|
||||
#define LL_MAXINT 9223372036854775807i64
|
||||
#define LL_MININT (-LL_MAXINT - 1i64)
|
||||
#define LL_ZERO 0i64
|
||||
|
|
|
@ -108,6 +108,21 @@ NSPR_API(PRStatus) PR_Notify(PRMonitor *mon);
|
|||
*/
|
||||
NSPR_API(PRStatus) PR_NotifyAll(PRMonitor *mon);
|
||||
|
||||
/*
|
||||
** PR_ASSERT_CURRENT_THREAD_IN_MONITOR
|
||||
** If the current thread is in |mon|, this assertion is guaranteed to
|
||||
** succeed. Otherwise, the behavior of this function is undefined.
|
||||
*/
|
||||
#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
|
||||
#define PR_ASSERT_CURRENT_THREAD_IN_MONITOR(/* PRMonitor* */ mon) \
|
||||
PR_AssertCurrentThreadInMonitor(mon)
|
||||
#else
|
||||
#define PR_ASSERT_CURRENT_THREAD_IN_MONITOR(/* PRMonitor* */ mon)
|
||||
#endif
|
||||
|
||||
/* Don't call this function directly. */
|
||||
NSPR_API(void) PR_AssertCurrentThreadInMonitor(PRMonitor *mon);
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* prmon_h___ */
|
||||
|
|
|
@ -68,7 +68,7 @@ NSPR_API(PRStatus) PR_NetAddrToString(
|
|||
typedef struct PRHostEnt {
|
||||
char *h_name; /* official name of host */
|
||||
char **h_aliases; /* alias list */
|
||||
#if defined(WIN32) || defined(WIN16)
|
||||
#ifdef WIN32
|
||||
PRInt16 h_addrtype; /* host address type */
|
||||
PRInt16 h_length; /* length of address */
|
||||
#else
|
||||
|
@ -354,7 +354,7 @@ NSPR_API(void) PR_ConvertIPv4AddrToIPv6(PRUint32 v4addr, PRIPv6Addr *v6addr);
|
|||
typedef struct PRProtoEnt {
|
||||
char *p_name; /* official protocol name */
|
||||
char **p_aliases; /* alias list */
|
||||
#if defined(WIN32) || defined(WIN16)
|
||||
#ifdef WIN32
|
||||
PRInt16 p_num; /* protocol # */
|
||||
#else
|
||||
PRInt32 p_num; /* protocol # */
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#define prthread_h___
|
||||
|
||||
/*
|
||||
** API for NSPR threads. On some architectures (MAC and WIN16
|
||||
** API for NSPR threads. On some architectures (Mac OS Classic
|
||||
** notably) pre-emptibility is not guaranteed. Hard priority scheduling
|
||||
** is not guaranteed, so programming using priority based synchronization
|
||||
** is a no-no.
|
||||
|
|
|
@ -115,7 +115,7 @@ typedef struct PRTimeParameters {
|
|||
typedef struct PRExplodedTime {
|
||||
PRInt32 tm_usec; /* microseconds past tm_sec (0-99999) */
|
||||
PRInt32 tm_sec; /* seconds past tm_min (0-61, accomodating
|
||||
up to two leap seconds) */
|
||||
up to two leap seconds) */
|
||||
PRInt32 tm_min; /* minutes past tm_hour (0-59) */
|
||||
PRInt32 tm_hour; /* hours past tm_day (0-23) */
|
||||
PRInt32 tm_mday; /* days past tm_mon (1-31, note that it
|
||||
|
@ -126,7 +126,7 @@ typedef struct PRExplodedTime {
|
|||
|
||||
PRInt8 tm_wday; /* calculated day of the week
|
||||
(0-6, Sun = 0) */
|
||||
PRInt16 tm_yday; /* calculated day of the year
|
||||
PRInt16 tm_yday; /* calculated day of the year
|
||||
(0-365, Jan 1 = 0) */
|
||||
|
||||
PRTimeParameters tm_params; /* time parameters used by conversion */
|
||||
|
@ -174,11 +174,7 @@ typedef PRTimeParameters (PR_CALLBACK *PRTimeParamFn)(const PRExplodedTime *gmt)
|
|||
* The implementation is machine dependent.
|
||||
* Cf. time_t time(time_t *tp) in ANSI C.
|
||||
*/
|
||||
#if defined(HAVE_WATCOM_BUG_2)
|
||||
PRTime __pascal __export __loadds
|
||||
#else
|
||||
NSPR_API(PRTime)
|
||||
#endif
|
||||
NSPR_API(PRTime)
|
||||
PR_Now(void);
|
||||
|
||||
/*
|
||||
|
@ -195,11 +191,7 @@ NSPR_API(void) PR_ExplodeTime(
|
|||
PRTime usecs, PRTimeParamFn params, PRExplodedTime *exploded);
|
||||
|
||||
/* Reverse operation of PR_ExplodeTime */
|
||||
#if defined(HAVE_WATCOM_BUG_2)
|
||||
PRTime __pascal __export __loadds
|
||||
#else
|
||||
NSPR_API(PRTime)
|
||||
#endif
|
||||
NSPR_API(PRTime)
|
||||
PR_ImplodeTime(const PRExplodedTime *exploded);
|
||||
|
||||
/*
|
||||
|
@ -298,7 +290,7 @@ NSPR_API(PRStatus) PR_ParseTimeString (
|
|||
#ifndef NO_NSPR_10_SUPPORT
|
||||
|
||||
/* Format a time value into a buffer. Same semantics as strftime() */
|
||||
NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
|
||||
NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
|
||||
const PRExplodedTime *tm);
|
||||
|
||||
/* Format a time value into a buffer. Time is always in US English format, regardless
|
||||
|
|
|
@ -112,39 +112,6 @@
|
|||
#define PR_CALLBACK_DECL
|
||||
#define PR_STATIC_CALLBACK(__x) static __x
|
||||
|
||||
#elif defined(WIN16)
|
||||
|
||||
#define PR_CALLBACK_DECL __cdecl
|
||||
|
||||
#if defined(_WINDLL)
|
||||
#define PR_EXPORT(__type) extern __type _cdecl _export _loadds
|
||||
#define PR_IMPORT(__type) extern __type _cdecl _export _loadds
|
||||
#define PR_EXPORT_DATA(__type) extern __type _export
|
||||
#define PR_IMPORT_DATA(__type) extern __type _export
|
||||
|
||||
#define PR_EXTERN(__type) extern __type _cdecl _export _loadds
|
||||
#define PR_IMPLEMENT(__type) __type _cdecl _export _loadds
|
||||
#define PR_EXTERN_DATA(__type) extern __type _export
|
||||
#define PR_IMPLEMENT_DATA(__type) __type _export
|
||||
|
||||
#define PR_CALLBACK __cdecl __loadds
|
||||
#define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
|
||||
|
||||
#else /* this must be .EXE */
|
||||
#define PR_EXPORT(__type) extern __type _cdecl _export
|
||||
#define PR_IMPORT(__type) extern __type _cdecl _export
|
||||
#define PR_EXPORT_DATA(__type) extern __type _export
|
||||
#define PR_IMPORT_DATA(__type) extern __type _export
|
||||
|
||||
#define PR_EXTERN(__type) extern __type _cdecl _export
|
||||
#define PR_IMPLEMENT(__type) __type _cdecl _export
|
||||
#define PR_EXTERN_DATA(__type) extern __type _export
|
||||
#define PR_IMPLEMENT_DATA(__type) __type _export
|
||||
|
||||
#define PR_CALLBACK __cdecl __loadds
|
||||
#define PR_STATIC_CALLBACK(__x) __x PR_CALLBACK
|
||||
#endif /* _WINDLL */
|
||||
|
||||
#elif defined(XP_MAC)
|
||||
|
||||
#define PR_EXPORT(__type) extern __declspec(export) __type
|
||||
|
@ -387,12 +354,14 @@ typedef long PRInt32;
|
|||
** the LL_ macros (see prlong.h).
|
||||
************************************************************************/
|
||||
#ifdef HAVE_LONG_LONG
|
||||
#if PR_BYTES_PER_LONG == 8
|
||||
/*
|
||||
* On 64-bit Mac OS X, uint64 needs to be defined as unsigned long long to
|
||||
* match uint64_t, otherwise our uint64 typedef conflicts with the uint64
|
||||
* typedef in cssmconfig.h, which CoreServices.h includes indirectly.
|
||||
*/
|
||||
#if PR_BYTES_PER_LONG == 8 && !defined(__APPLE__)
|
||||
typedef long PRInt64;
|
||||
typedef unsigned long PRUint64;
|
||||
#elif defined(WIN16)
|
||||
typedef __int64 PRInt64;
|
||||
typedef unsigned __int64 PRUint64;
|
||||
#elif defined(WIN32) && !defined(__GNUC__)
|
||||
typedef __int64 PRInt64;
|
||||
typedef unsigned __int64 PRUint64;
|
||||
|
|
|
@ -114,3 +114,10 @@ PR_IMPLEMENT(PRStatus)
|
|||
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(void)
|
||||
PR_AssertCurrentThreadOwnsLock(PRLock *lock)
|
||||
{
|
||||
PR_ASSERT(lock != NULL);
|
||||
PR_ASSERT(lock->owner == find_thread( NULL ));
|
||||
}
|
||||
|
|
|
@ -211,9 +211,23 @@ PR_IMPLEMENT(PRStatus)
|
|||
return( PR_SUCCESS );
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the number of times that the current thread has entered the
|
||||
** lock. Returns zero if the current thread has not entered the lock.
|
||||
*/
|
||||
PR_IMPLEMENT(PRIntn)
|
||||
PR_GetMonitorEntryCount(PRMonitor *mon)
|
||||
{
|
||||
return( mon->entryCount );
|
||||
return( (mon->cvar->lock->owner == find_thread( NULL )) ?
|
||||
mon->entryCount : 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
** If the current thread is in |mon|, this assertion is guaranteed to
|
||||
** succeed. Otherwise, the behavior of this function is undefined.
|
||||
*/
|
||||
PR_IMPLEMENT(void)
|
||||
PR_AssertCurrentThreadInMonitor(PRMonitor *mon)
|
||||
{
|
||||
PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(mon->cvar->lock);
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ struct _imcb *IAC$GL_IMAGE_LIST = NULL;
|
|||
* On these platforms, symbols have a leading '_'.
|
||||
*/
|
||||
#if defined(SUNOS4) || (defined(DARWIN) && defined(USE_MACH_DYLD)) \
|
||||
|| defined(NEXTSTEP) || defined(WIN16) || defined(XP_OS2) \
|
||||
|| defined(NEXTSTEP) || defined(XP_OS2) \
|
||||
|| ((defined(OPENBSD) || defined(NETBSD)) && !defined(__ELF__))
|
||||
#define NEED_LEADING_UNDERSCORE
|
||||
#endif
|
||||
|
@ -314,39 +314,11 @@ void _PR_InitLinker(void)
|
|||
PR_ExitMonitor(pr_linker_lock);
|
||||
}
|
||||
|
||||
#if defined(WIN16)
|
||||
/*
|
||||
* _PR_ShutdownLinker unloads all dlls loaded by the application via
|
||||
* calls to PR_LoadLibrary
|
||||
*/
|
||||
void _PR_ShutdownLinker(void)
|
||||
{
|
||||
PR_EnterMonitor(pr_linker_lock);
|
||||
|
||||
while (pr_loadmap) {
|
||||
if (pr_loadmap->refCount > 1) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "# Forcing library to unload: %s (%d outstanding references)\n",
|
||||
pr_loadmap->name, pr_loadmap->refCount);
|
||||
#endif
|
||||
pr_loadmap->refCount = 1;
|
||||
}
|
||||
PR_UnloadLibrary(pr_loadmap);
|
||||
}
|
||||
|
||||
PR_ExitMonitor(pr_linker_lock);
|
||||
|
||||
PR_DestroyMonitor(pr_linker_lock);
|
||||
pr_linker_lock = NULL;
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* _PR_ShutdownLinker was originally only used on WIN16 (see above),
|
||||
* but I think it should also be used on other platforms. However,
|
||||
* I disagree with the original implementation's unloading the dlls
|
||||
* for the application. Any dlls that still remain on the pr_loadmap
|
||||
* list when NSPR shuts down are application programming errors. The
|
||||
* only exception is pr_exe_loadmap, which was added to the list by
|
||||
* _PR_ShutdownLinker does not unload the dlls loaded by the application
|
||||
* via calls to PR_LoadLibrary. Any dlls that still remain on the
|
||||
* pr_loadmap list when NSPR shuts down are application programming errors.
|
||||
* The only exception is pr_exe_loadmap, which was added to the list by
|
||||
* NSPR and hence should be cleaned up by NSPR.
|
||||
*/
|
||||
void _PR_ShutdownLinker(void)
|
||||
|
@ -361,7 +333,6 @@ void _PR_ShutdownLinker(void)
|
|||
_pr_currentLibPath = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
@ -905,7 +876,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
|
|||
#else
|
||||
int dl_flags = 0;
|
||||
#endif
|
||||
void *h;
|
||||
void *h = NULL;
|
||||
|
||||
if (flags & PR_LD_LAZY) {
|
||||
dl_flags |= RTLD_LAZY;
|
||||
|
@ -919,7 +890,17 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
|
|||
if (flags & PR_LD_LOCAL) {
|
||||
dl_flags |= RTLD_LOCAL;
|
||||
}
|
||||
#if defined(DARWIN)
|
||||
/* ensure the file exists if it contains a slash character i.e. path */
|
||||
/* DARWIN's dlopen ignores the provided path and checks for the */
|
||||
/* plain filename in DYLD_LIBRARY_PATH */
|
||||
if (strchr(name, PR_DIRECTORY_SEPARATOR) == NULL ||
|
||||
PR_Access(name, PR_ACCESS_EXISTS) == PR_SUCCESS) {
|
||||
h = dlopen(name, dl_flags);
|
||||
}
|
||||
#else
|
||||
h = dlopen(name, dl_flags);
|
||||
#endif
|
||||
#elif defined(USE_HPSHL)
|
||||
int shl_flags = 0;
|
||||
shl_t h;
|
||||
|
@ -1213,9 +1194,9 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name)
|
|||
#endif
|
||||
#endif /* XP_OS2 */
|
||||
|
||||
#if defined(WIN32) || defined(WIN16)
|
||||
#ifdef WIN32
|
||||
f = GetProcAddress(lm->dlh, name);
|
||||
#endif /* WIN32 || WIN16 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
#if defined(XP_MACOSX) && defined(USE_MACH_DYLD)
|
||||
/* add this offset to skip the leading underscore in name */
|
||||
|
|
|
@ -46,22 +46,6 @@ include $(MOD_DEPTH)/config/autoconf.mk
|
|||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
ifeq ($(OS_TARGET), WIN16)
|
||||
CSRCS = \
|
||||
w16null.c \
|
||||
w16thred.c \
|
||||
w16proc.c \
|
||||
w16fmem.c \
|
||||
w16sock.c \
|
||||
w16mem.c \
|
||||
w16io.c \
|
||||
w16gc.c \
|
||||
w16error.c \
|
||||
w16stdio.c \
|
||||
w16callb.c \
|
||||
ntinrval.c \
|
||||
$(NULL)
|
||||
else
|
||||
ifeq (,$(filter-out WIN95 WINCE, $(OS_TARGET)))
|
||||
CSRCS = \
|
||||
ntmisc.c \
|
||||
|
@ -97,7 +81,6 @@ CSRCS = \
|
|||
w32shm.c \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
TARGETS = $(OBJS)
|
||||
|
||||
|
|
|
@ -68,20 +68,6 @@ CSRCS = ntmisc.c \
|
|||
w32shm.c \
|
||||
w95dllmain.c
|
||||
else
|
||||
ifeq ($(OS_TARGET),WIN16)
|
||||
CSRCS = w16null.c \
|
||||
w16thred.c \
|
||||
w16proc.c \
|
||||
w16fmem.c \
|
||||
w16sock.c \
|
||||
w16mem.c \
|
||||
w16io.c \
|
||||
w16gc.c \
|
||||
w16error.c \
|
||||
w16stdio.c \
|
||||
w16callb.c \
|
||||
ntinrval.c
|
||||
endif # win16
|
||||
endif # win95
|
||||
endif # winnt
|
||||
|
||||
|
|
|
@ -1,262 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
** w16callb.c -- Implement Win16 Callback functions
|
||||
**
|
||||
** Functions here are to replace functions normally in
|
||||
** LIBC which are not implemented in MSVC's LIBC.
|
||||
** Some clients of NSPR expect to statically link
|
||||
** to NSPR and get these functions.
|
||||
**
|
||||
** Some are implemented as callbacks to the .EXE
|
||||
** some are implemented directly in this module.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "primpl.h"
|
||||
#include "windowsx.h"
|
||||
|
||||
/*
|
||||
** _pr_callback_funcs -- This is where clients register the
|
||||
** callback function structure.
|
||||
*/
|
||||
struct PRMethodCallbackStr * _pr_callback_funcs;
|
||||
|
||||
/*
|
||||
** PR_MDInitWin16() -- Register the PRMethodCallback table pointer
|
||||
**
|
||||
*/
|
||||
void PR_MDRegisterCallbacks(struct PRMethodCallbackStr *f)
|
||||
{
|
||||
_pr_callback_funcs = f;
|
||||
}
|
||||
|
||||
/*
|
||||
** NSPR re-implenentations of various C runtime functions:
|
||||
*/
|
||||
|
||||
/*
|
||||
** PR_MD_printf() -- exported as printf()
|
||||
**
|
||||
*/
|
||||
int PR_MD_printf(const char *fmt, ...)
|
||||
{
|
||||
char buffer[1024];
|
||||
int ret = 0;
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
|
||||
#ifdef DEBUG
|
||||
PR_vsnprintf(buffer, sizeof(buffer), fmt, args);
|
||||
{
|
||||
if (_pr_callback_funcs != NULL && _pr_callback_funcs->auxOutput != NULL) {
|
||||
(* _pr_callback_funcs->auxOutput)(buffer);
|
||||
} else {
|
||||
OutputDebugString(buffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
** PR_MD_sscanf() -- exported as sscanf()
|
||||
**
|
||||
*/
|
||||
int PR_MD_sscanf(const char *buf, const char *fmt, ...)
|
||||
{
|
||||
int retval;
|
||||
va_list arglist;
|
||||
|
||||
va_start(arglist, fmt);
|
||||
retval = vsscanf((const unsigned char *)buf, (const unsigned char *)fmt, arglist);
|
||||
va_end(arglist);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
** PR_MD_strftime() -- exported as strftime
|
||||
**
|
||||
*/
|
||||
size_t PR_MD_strftime(char *s, size_t len, const char *fmt, const struct tm *p)
|
||||
{
|
||||
if( _pr_callback_funcs ) {
|
||||
return (*_pr_callback_funcs->strftime)(s, len, fmt, p);
|
||||
} else {
|
||||
PR_ASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** PR_MD_malloc() -- exported as malloc()
|
||||
**
|
||||
*/
|
||||
void *PR_MD_malloc( size_t size )
|
||||
{
|
||||
if( _pr_callback_funcs ) {
|
||||
return (*_pr_callback_funcs->malloc)( size );
|
||||
} else {
|
||||
return GlobalAllocPtr(GPTR, (DWORD)size);
|
||||
}
|
||||
} /* end malloc() */
|
||||
|
||||
/*
|
||||
** PR_MD_calloc() -- exported as calloc()
|
||||
**
|
||||
*/
|
||||
void *PR_MD_calloc( size_t n, size_t size )
|
||||
{
|
||||
void *p;
|
||||
size_t sz;
|
||||
|
||||
if( _pr_callback_funcs ) {
|
||||
return (*_pr_callback_funcs->calloc)( n, size );
|
||||
} else {
|
||||
sz = n * size;
|
||||
p = GlobalAllocPtr(GPTR, (DWORD)sz );
|
||||
memset( p, 0x00, sz );
|
||||
return p;
|
||||
}
|
||||
} /* end calloc() */
|
||||
|
||||
/*
|
||||
** PR_MD_realloc() -- exported as realloc()
|
||||
**
|
||||
*/
|
||||
void *PR_MD_realloc( void* old_blk, size_t size )
|
||||
{
|
||||
if( _pr_callback_funcs ) {
|
||||
return (*_pr_callback_funcs->realloc)( old_blk, size );
|
||||
} else {
|
||||
return GlobalReAllocPtr( old_blk, (DWORD)size, GPTR);
|
||||
}
|
||||
} /* end realloc */
|
||||
|
||||
/*
|
||||
** PR_MD_free() -- exported as free()
|
||||
**
|
||||
*/
|
||||
void PR_MD_free( void *ptr )
|
||||
{
|
||||
if( _pr_callback_funcs ) {
|
||||
(*_pr_callback_funcs->free)( ptr );
|
||||
return;
|
||||
} else {
|
||||
GlobalFreePtr( ptr );
|
||||
return;
|
||||
}
|
||||
} /* end free() */
|
||||
|
||||
/*
|
||||
** PR_MD_getenv() -- exported as getenv()
|
||||
**
|
||||
*/
|
||||
char *PR_MD_getenv( const char *name )
|
||||
{
|
||||
if( _pr_callback_funcs ) {
|
||||
return (*_pr_callback_funcs->getenv)( name );
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} /* end getenv() */
|
||||
|
||||
|
||||
/*
|
||||
** PR_MD_perror() -- exported as perror()
|
||||
**
|
||||
** well, not really (lth. 12/5/97).
|
||||
** XXX hold this thought.
|
||||
**
|
||||
*/
|
||||
void PR_MD_perror( const char *prefix )
|
||||
{
|
||||
return;
|
||||
} /* end perror() */
|
||||
|
||||
/*
|
||||
** PR_MD_putenv() -- exported as putenv()
|
||||
**
|
||||
*/
|
||||
int PR_MD_putenv(const char *assoc)
|
||||
{
|
||||
if( _pr_callback_funcs ) {
|
||||
return (*_pr_callback_funcs->putenv)(assoc);
|
||||
} else {
|
||||
PR_ASSERT(0);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** PR_MD_fprintf() -- exported as fprintf()
|
||||
**
|
||||
*/
|
||||
int PR_MD_fprintf(FILE *fPtr, const char *fmt, ...)
|
||||
{
|
||||
char buffer[1024];
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
PR_vsnprintf(buffer, sizeof(buffer), fmt, args);
|
||||
|
||||
if (fPtr == NULL)
|
||||
{
|
||||
if (_pr_callback_funcs != NULL && _pr_callback_funcs->auxOutput != NULL)
|
||||
{
|
||||
(* _pr_callback_funcs->auxOutput)(buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
OutputDebugString(buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite(buffer, 1, strlen(buffer), fPtr); /* XXX Is this a sec. hole? */
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* end w16callb.c */
|
|
@ -1,252 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
** Note: A single error mapping function is provided.
|
||||
**
|
||||
*/
|
||||
#include "prerror.h"
|
||||
#include <errno.h>
|
||||
#include <winsock.h>
|
||||
|
||||
|
||||
void _PR_MD_map_error( int err )
|
||||
{
|
||||
|
||||
switch ( err )
|
||||
{
|
||||
case ENOENT: /* No such file or directory */
|
||||
PR_SetError(PR_FILE_NOT_FOUND_ERROR, err);
|
||||
break;
|
||||
case E2BIG: /* Argument list too big */
|
||||
PR_SetError( PR_INVALID_ARGUMENT_ERROR, err );
|
||||
break;
|
||||
case ENOEXEC: /* Exec format error */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EBADF: /* Bad file number */
|
||||
PR_SetError( PR_BAD_DESCRIPTOR_ERROR, err );
|
||||
break;
|
||||
case ENOMEM: /* Not enough Memory */
|
||||
PR_SetError( PR_OUT_OF_MEMORY_ERROR, err );
|
||||
break;
|
||||
case EACCES: /* Permission denied */
|
||||
PR_SetError( PR_NO_ACCESS_RIGHTS_ERROR, err );
|
||||
break;
|
||||
case EEXIST: /* File exists */
|
||||
|
||||
/* RESTART here */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EXDEV: /* Cross device link */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EINVAL: /* Invalid argument */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENFILE: /* File table overflow */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EMFILE: /* Too many open files */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENOSPC: /* No space left on device */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
/* math errors */
|
||||
case EDOM: /* Argument too large */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ERANGE: /* Result too large */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
/* file locking error */
|
||||
case EDEADLK: /* Resource deadlock would occur */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EINTR: /* Interrupt */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ECHILD: /* Child does not exist */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
/* POSIX errors */
|
||||
case EAGAIN: /* Resource unavailable, try again */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EBUSY: /* Device or Resource is busy */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EFBIG: /* File too large */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EIO: /* I/O error */
|
||||
PR_SetError( PR_IO_ERROR, err );
|
||||
break;
|
||||
case EISDIR: /* Is a directory */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENOTDIR: /* Not a directory */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EMLINK: /* Too many links */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENOTBLK: /* Block device required */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENOTTY: /* Not a character device */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENXIO: /* No such device or address */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EPERM: /* Not owner */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EPIPE: /* Broken pipe */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EROFS: /* Read only file system */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ESPIPE: /* Illegal seek */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ESRCH: /* No such process */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ETXTBSY: /* Text file busy */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case EFAULT: /* Bad address */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENAMETOOLONG: /* Name too long */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENODEV: /* No such device */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENOLCK: /* No locks available on system */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENOSYS: /* Unknown system call */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
case ENOTEMPTY: /* Directory not empty */
|
||||
/* Normative Addendum error */
|
||||
case EILSEQ: /* Multibyte/widw character encoding error */
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
|
||||
/* WinSock errors */
|
||||
case WSAEACCES:
|
||||
PR_SetError(PR_NO_ACCESS_RIGHTS_ERROR, err);
|
||||
break;
|
||||
case WSAEADDRINUSE:
|
||||
PR_SetError(PR_ADDRESS_IN_USE_ERROR, err);
|
||||
break;
|
||||
case WSAEADDRNOTAVAIL:
|
||||
PR_SetError(PR_ADDRESS_NOT_AVAILABLE_ERROR, err);
|
||||
break;
|
||||
case WSAEAFNOSUPPORT:
|
||||
PR_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR, err);
|
||||
break;
|
||||
case WSAEBADF:
|
||||
PR_SetError(PR_BAD_DESCRIPTOR_ERROR, err);
|
||||
break;
|
||||
case WSAECONNREFUSED:
|
||||
PR_SetError(PR_CONNECT_REFUSED_ERROR, err);
|
||||
break;
|
||||
case WSAEFAULT:
|
||||
PR_SetError(PR_ACCESS_FAULT_ERROR, err);
|
||||
break;
|
||||
case WSAEINVAL:
|
||||
PR_SetError(PR_BUFFER_OVERFLOW_ERROR, err);
|
||||
break;
|
||||
case WSAEISCONN:
|
||||
PR_SetError(PR_IS_CONNECTED_ERROR, err);
|
||||
break;
|
||||
case WSAEMFILE:
|
||||
PR_SetError(PR_PROC_DESC_TABLE_FULL_ERROR, err);
|
||||
break;
|
||||
case WSAENETDOWN:
|
||||
case WSAENETUNREACH:
|
||||
PR_SetError(PR_NETWORK_UNREACHABLE_ERROR, err);
|
||||
break;
|
||||
case WSAENOBUFS:
|
||||
PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, err);
|
||||
break;
|
||||
case WSAENOPROTOOPT:
|
||||
case WSAEMSGSIZE:
|
||||
PR_SetError(PR_INVALID_ARGUMENT_ERROR, err);
|
||||
break;
|
||||
case WSAENOTCONN:
|
||||
PR_SetError(PR_NOT_CONNECTED_ERROR, err);
|
||||
break;
|
||||
case WSAENOTSOCK:
|
||||
PR_SetError(PR_NOT_SOCKET_ERROR, err);
|
||||
break;
|
||||
case WSAEOPNOTSUPP:
|
||||
PR_SetError(PR_NOT_TCP_SOCKET_ERROR, err);
|
||||
break;
|
||||
case WSAEPROTONOSUPPORT:
|
||||
PR_SetError(PR_PROTOCOL_NOT_SUPPORTED_ERROR, err);
|
||||
break;
|
||||
case WSAETIMEDOUT:
|
||||
PR_SetError(PR_IO_TIMEOUT_ERROR, err);
|
||||
break;
|
||||
case WSAEINTR:
|
||||
PR_SetError(PR_PENDING_INTERRUPT_ERROR, err );
|
||||
break;
|
||||
case WSASYSNOTREADY:
|
||||
case WSAVERNOTSUPPORTED:
|
||||
PR_SetError(PR_PROTOCOL_NOT_SUPPORTED_ERROR, err);
|
||||
break;
|
||||
case WSAEWOULDBLOCK:
|
||||
PR_SetError(PR_WOULD_BLOCK_ERROR, err);
|
||||
break;
|
||||
|
||||
default:
|
||||
PR_SetError( PR_UNKNOWN_ERROR, err );
|
||||
break;
|
||||
}
|
||||
return;
|
||||
} /* end _MD_map_win16_error() */
|
||||
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "primpl.h"
|
||||
|
||||
/*
|
||||
**********************************************************************
|
||||
*
|
||||
* Memory-mapped files are not implemented on Win16.
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
PRStatus _MD_CreateFileMap(PRFileMap *fmap, PRInt64 size)
|
||||
{
|
||||
PR_ASSERT(!"Not implemented");
|
||||
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
|
||||
return PR_FAILURE;
|
||||
}
|
||||
|
||||
PRInt32 _MD_GetMemMapAlignment(void)
|
||||
{
|
||||
PR_ASSERT(!"Not implemented");
|
||||
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void * _MD_MemMap(
|
||||
PRFileMap *fmap,
|
||||
PRInt64 offset,
|
||||
PRUint32 len)
|
||||
{
|
||||
PR_ASSERT(!"Not implemented");
|
||||
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRStatus _MD_MemUnmap(void *addr, PRUint32 len)
|
||||
{
|
||||
PR_ASSERT(!"Not implemented");
|
||||
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
|
||||
return PR_FAILURE;
|
||||
}
|
||||
|
||||
PRStatus _MD_CloseFileMap(PRFileMap *fmap)
|
||||
{
|
||||
PR_ASSERT(!"Not implemented");
|
||||
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
|
||||
return PR_FAILURE;
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "primpl.h"
|
||||
#include <sys/timeb.h>
|
||||
|
||||
PRWord *
|
||||
_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
|
||||
{
|
||||
if (isCurrent)
|
||||
{
|
||||
_MD_SAVE_CONTEXT(t);
|
||||
}
|
||||
/*
|
||||
** In Win16 because the premption is "cooperative" it can never be the
|
||||
** case that a register holds the sole reference to an object. It
|
||||
** will always have been pushed onto the stack before the thread
|
||||
** switch... So don't bother to scan the registers...
|
||||
*/
|
||||
*np = 0;
|
||||
|
||||
return (PRWord *) CONTEXT(t);
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifndef SPORT_MODEL
|
||||
|
||||
#define MAX_SEGMENT_SIZE (65536l - 4096l)
|
||||
|
||||
/************************************************************************/
|
||||
/*
|
||||
** Machine dependent GC Heap management routines:
|
||||
** _MD_GrowGCHeap
|
||||
*/
|
||||
/************************************************************************/
|
||||
|
||||
extern void *
|
||||
_MD_GrowGCHeap(uint32 *sizep)
|
||||
{
|
||||
void *addr;
|
||||
|
||||
if( *sizep > MAX_SEGMENT_SIZE ) {
|
||||
*sizep = MAX_SEGMENT_SIZE;
|
||||
}
|
||||
|
||||
addr = malloc((size_t)*sizep);
|
||||
return addr;
|
||||
}
|
||||
|
||||
#endif /* SPORT_MODEL */
|
||||
#endif /* 0 */
|
||||
|
|
@ -1,855 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "primpl.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <share.h>
|
||||
#include <sys/locking.h>
|
||||
|
||||
|
||||
/*
|
||||
** Sleep this many milliseconds on each I/O operation
|
||||
** to cause an intentional thread switch.
|
||||
*/
|
||||
#define _PR_MD_WIN16_DELAY 1
|
||||
|
||||
|
||||
/*
|
||||
** PR_MD_RegisterW16StdioCallbacks() -- Register Win16 stdio callback functions
|
||||
**
|
||||
** This public function call is unique to Win16.
|
||||
** ... Sigh ... So much for platform independence.
|
||||
**
|
||||
** To get stdio to work from a command line executable, the stdio stream
|
||||
** calls must be issued from the .EXE file; calling them from the .DLL
|
||||
** sends the output to the bit-bucket. Therefore, the .EXE wanting to
|
||||
** do stdio to the console window (must be built as a "quickwin" application)
|
||||
** must have the wrapper functions defined in this module statically linked
|
||||
** into the .EXE.
|
||||
**
|
||||
** There appears to be nothing you can do to get stdio to work from a
|
||||
** Win16 GUI application. Oh Well!
|
||||
**
|
||||
*/
|
||||
PRStdinRead _pr_md_read_stdin = 0;
|
||||
PRStdoutWrite _pr_md_write_stdout = 0;
|
||||
PRStderrWrite _pr_md_write_stderr = 0;
|
||||
|
||||
PRStatus
|
||||
PR_MD_RegisterW16StdioCallbacks( PRStdinRead inReadf, PRStdoutWrite outWritef, PRStderrWrite errWritef )
|
||||
{
|
||||
_pr_md_write_stdout = outWritef;
|
||||
_pr_md_write_stderr = errWritef;
|
||||
_pr_md_read_stdin = inReadf;
|
||||
|
||||
return(PR_SUCCESS);
|
||||
} /* end PR_MD_RegisterW16StdioCallbacks() */
|
||||
|
||||
|
||||
/*
|
||||
** _PR_MD_OPEN() -- Open a file
|
||||
**
|
||||
** Returns: a fileHandle or -1
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_OPEN(const char *name, PRIntn osflags, int mode)
|
||||
{
|
||||
PRInt32 file;
|
||||
int access = O_BINARY;
|
||||
int rights = 0;
|
||||
|
||||
|
||||
/*
|
||||
** Map NSPR open flags to os open flags
|
||||
*/
|
||||
if (osflags & PR_RDONLY )
|
||||
access |= O_RDONLY;
|
||||
if (osflags & PR_WRONLY )
|
||||
access |= O_WRONLY;
|
||||
if (osflags & PR_RDWR )
|
||||
access |= O_RDWR;
|
||||
if (osflags & PR_CREATE_FILE )
|
||||
{
|
||||
access |= O_CREAT;
|
||||
rights |= S_IRWXU;
|
||||
}
|
||||
if (osflags & PR_TRUNCATE)
|
||||
access |= O_TRUNC;
|
||||
if (osflags & PR_APPEND)
|
||||
access |= O_APPEND;
|
||||
else
|
||||
access |= O_RDONLY;
|
||||
|
||||
/*
|
||||
** Open the file
|
||||
*/
|
||||
file = (PRInt32) sopen( name, access, SH_DENYNO, rights );
|
||||
if ( -1 == (PRInt32)file )
|
||||
{
|
||||
_PR_MD_MAP_OPEN_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return file;
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_READ() - Read something
|
||||
**
|
||||
** Returns: bytes read or -1
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
if ( (PR_GetDescType(fd) == PR_DESC_FILE) &&
|
||||
( fd->secret->md.osfd == PR_StandardInput ) &&
|
||||
( _pr_md_write_stdout ))
|
||||
{
|
||||
rv = (*_pr_md_read_stdin)( buf, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = read( fd->secret->md.osfd, buf, len );
|
||||
}
|
||||
|
||||
if ( rv == -1)
|
||||
{
|
||||
_PR_MD_MAP_READ_ERROR( errno );
|
||||
}
|
||||
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_WRITE() - Write something
|
||||
**
|
||||
** Returns: bytes written or -1
|
||||
**
|
||||
** Note: for file handles 1 and 2 (stdout and stderr)
|
||||
** call the Win16 NSPR stdio callback functions, if they are
|
||||
** registered.
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_WRITE(PRFileDesc *fd, const void *buf, PRInt32 len)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
if ( (PR_GetDescType(fd) == PR_DESC_FILE))
|
||||
{
|
||||
switch ( fd->secret->md.osfd )
|
||||
{
|
||||
case PR_StandardOutput :
|
||||
if ( _pr_md_write_stdout )
|
||||
rv = (*_pr_md_write_stdout)( (void *)buf, len);
|
||||
else
|
||||
rv = len; /* fake success */
|
||||
break;
|
||||
|
||||
case PR_StandardError :
|
||||
if ( _pr_md_write_stderr )
|
||||
rv = (*_pr_md_write_stderr)( (void *)buf, len);
|
||||
else
|
||||
rv = len; /* fake success */
|
||||
break;
|
||||
|
||||
default:
|
||||
rv = write( fd->secret->md.osfd, buf, len );
|
||||
if ( rv == -1 )
|
||||
{
|
||||
_PR_MD_MAP_WRITE_ERROR( errno );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = write( fd->secret->md.osfd, buf, len );
|
||||
if ( rv == -1 )
|
||||
{
|
||||
_PR_MD_MAP_WRITE_ERROR( errno );
|
||||
}
|
||||
}
|
||||
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return rv;
|
||||
} /* --- end _PR_MD_WRITE() --- */
|
||||
|
||||
/*
|
||||
** _PR_MD_LSEEK() - Seek to position in a file
|
||||
**
|
||||
** Note: 'whence' maps directly to PR_...
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_LSEEK(PRFileDesc *fd, PRInt32 offset, int whence)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
rv = lseek( fd->secret->md.osfd, offset, whence );
|
||||
if ( rv == -1 )
|
||||
{
|
||||
_PR_MD_MAP_LSEEK_ERROR( errno );
|
||||
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return( rv );
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_LSEEK64() -- Seek to position in file, 64bit offset.
|
||||
**
|
||||
*/
|
||||
PRInt64
|
||||
_PR_MD_LSEEK64( PRFileDesc *fd, PRInt64 offset, int whence )
|
||||
{
|
||||
PRInt64 test;
|
||||
PRInt32 rv, off;
|
||||
LL_SHR(test, offset, 32);
|
||||
if (!LL_IS_ZERO(test))
|
||||
{
|
||||
PR_SetError(PR_FILE_TOO_BIG_ERROR, 0);
|
||||
LL_I2L(test, -1);
|
||||
return test;
|
||||
}
|
||||
LL_L2I(off, offset);
|
||||
rv = _PR_MD_LSEEK(fd, off, whence);
|
||||
LL_I2L(test, rv);
|
||||
return test;
|
||||
} /* end _PR_MD_LSEEK64() */
|
||||
|
||||
/*
|
||||
** _PR_MD_FSYNC() - Flush file buffers.
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_FSYNC(PRFileDesc *fd)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
rv = (PRInt32) fsync( fd->secret->md.osfd );
|
||||
if ( rv == -1 )
|
||||
{
|
||||
_PR_MD_MAP_FSYNC_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return(rv);
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_CLOSE() - Close an open file handle
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_CLOSE_FILE(PRInt32 osfd)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
rv = (PRInt32) close( osfd );
|
||||
if ( rv == -1 )
|
||||
{
|
||||
_PR_MD_MAP_CLOSE_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return(rv);
|
||||
} /* --- end _MD_CloseFile() --- */
|
||||
|
||||
|
||||
/* --- DIR IO ------------------------------------------------------------ */
|
||||
#define GetFileFromDIR(d) (d)->d_entry.cFileName
|
||||
|
||||
/*
|
||||
** FlipSlashes() - Make forward slashes ('/') into backslashes
|
||||
**
|
||||
** Returns: void
|
||||
**
|
||||
**
|
||||
*/
|
||||
void FlipSlashes(char *cp, int len)
|
||||
{
|
||||
while (--len >= 0) {
|
||||
if (cp[0] == '/') {
|
||||
cp[0] = PR_DIRECTORY_SEPARATOR;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** _PR_MD_OPEN_DIR() - Open a Directory.
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRStatus
|
||||
_PR_MD_OPEN_DIR(_MDDir *d, const char *name)
|
||||
{
|
||||
d->dir = opendir( name );
|
||||
|
||||
if ( d->dir == NULL )
|
||||
{
|
||||
_PR_MD_MAP_OPENDIR_ERROR( errno );
|
||||
return( PR_FAILURE );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return( PR_SUCCESS );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** _PR_MD_READ_DIR() - read next directory entry
|
||||
**
|
||||
**
|
||||
*/
|
||||
char *
|
||||
_PR_MD_READ_DIR(_MDDir *d, PRIntn flags)
|
||||
{
|
||||
struct dirent *de;
|
||||
int err;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
de = readdir( d->dir );
|
||||
if ( de == NULL ) {
|
||||
_PR_MD_MAP_READDIR_ERROR( errno);
|
||||
return 0;
|
||||
}
|
||||
if ((flags & PR_SKIP_DOT) &&
|
||||
(de->d_name[0] == '.') && (de->d_name[1] == 0))
|
||||
continue;
|
||||
if ((flags & PR_SKIP_DOT_DOT) &&
|
||||
(de->d_name[0] == '.') && (de->d_name[1] == '.') &&
|
||||
(de->d_name[2] == 0))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return de->d_name;
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_CLOSE_DIR() - Close a directory.
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_CLOSE_DIR(_MDDir *d)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
if ( d->dir )
|
||||
{
|
||||
rv = closedir( d->dir );
|
||||
if (rv != 0)
|
||||
{
|
||||
_PR_MD_MAP_CLOSEDIR_ERROR( errno );
|
||||
}
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** _PR_MD_DELETE() - Delete a file.
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_DELETE(const char *name)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
rv = (PRInt32) remove( name );
|
||||
if ( rv != 0 )
|
||||
{
|
||||
_PR_MD_MAP_DELETE_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return(rv);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** _PR_MD_STAT() - Get file attributes by filename
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_STAT(const char *fn, struct stat *info)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
rv = _stat(fn, (struct _stat *)info);
|
||||
if ( rv == -1 )
|
||||
{
|
||||
_PR_MD_MAP_STAT_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return( rv );
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_GETFILEINFO() - Get file attributes by filename
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_GETFILEINFO(const char *fn, PRFileInfo *info)
|
||||
{
|
||||
struct _stat sb;
|
||||
PRInt32 rv;
|
||||
|
||||
if ( (rv = _stat(fn, &sb)) == 0 ) {
|
||||
if (info) {
|
||||
if (S_IFREG & sb.st_mode)
|
||||
info->type = PR_FILE_FILE ;
|
||||
else if (S_IFDIR & sb.st_mode)
|
||||
info->type = PR_FILE_DIRECTORY;
|
||||
else
|
||||
info->type = PR_FILE_OTHER;
|
||||
info->size = sb.st_size;
|
||||
LL_I2L(info->modifyTime, sb.st_mtime);
|
||||
LL_I2L(info->creationTime, sb.st_ctime);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_PR_MD_MAP_STAT_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
_PR_MD_GETFILEINFO64(const char *fn, PRFileInfo64 *info)
|
||||
{
|
||||
PRFileInfo info32;
|
||||
|
||||
PRInt32 rv = _PR_MD_GETFILEINFO(fn, &info32);
|
||||
if (0 == rv)
|
||||
{
|
||||
info->type = info32.type;
|
||||
info->modifyTime = info32.modifyTime;
|
||||
info->creationTime = info32.creationTime;
|
||||
LL_I2L(info->size, info32.size);
|
||||
}
|
||||
return(rv);
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_GETOPENFILEINFO() - Get file attributes from an open file handle
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_GETOPENFILEINFO(const PRFileDesc *fd, PRFileInfo *info)
|
||||
{
|
||||
struct stat statBuf;
|
||||
PRInt32 rv = PR_SUCCESS;
|
||||
|
||||
rv = fstat( fd->secret->md.osfd, &statBuf );
|
||||
if ( rv == 0)
|
||||
{
|
||||
if (statBuf.st_mode & S_IFREG )
|
||||
info->type = PR_FILE_FILE;
|
||||
else if ( statBuf.st_mode & S_IFDIR )
|
||||
info->type = PR_FILE_DIRECTORY;
|
||||
else
|
||||
info->type = PR_FILE_OTHER;
|
||||
info->size = statBuf.st_size;
|
||||
LL_I2L(info->modifyTime, statBuf.st_mtime);
|
||||
LL_I2L(info->creationTime, statBuf.st_ctime);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_PR_MD_MAP_FSTAT_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return(rv);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
_PR_MD_GETOPENFILEINFO64(const PRFileDesc *fd, PRFileInfo64 *info)
|
||||
{
|
||||
PRFileInfo info32;
|
||||
|
||||
PRInt32 rv = _PR_MD_GETOPENFILEINFO(fd, &info32);
|
||||
if (0 == rv)
|
||||
{
|
||||
info->type = info32.type;
|
||||
info->modifyTime = info32.modifyTime;
|
||||
info->creationTime = info32.creationTime;
|
||||
LL_I2L(info->size, info32.size);
|
||||
}
|
||||
return(rv);
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_RENAME() - Rename a file
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_RENAME(const char *from, const char *to)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
rv = rename( from, to );
|
||||
if ( rv == -1 )
|
||||
{
|
||||
_PR_MD_MAP_RENAME_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return( rv );
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_ACCESS() - Return file acesss attribute.
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_ACCESS(const char *name, PRIntn how)
|
||||
{
|
||||
PRInt32 rv;
|
||||
int mode = 0;
|
||||
|
||||
if ( how & PR_ACCESS_WRITE_OK )
|
||||
mode |= W_OK;
|
||||
if ( how & PR_ACCESS_READ_OK )
|
||||
mode |= R_OK;
|
||||
|
||||
rv = (PRInt32) access( name, mode );
|
||||
if ( rv == -1 )
|
||||
{
|
||||
_PR_MD_MAP_ACCESS_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return(rv);
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_MKDIR() - Make a directory
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_MKDIR(const char *name, PRIntn mode)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
rv = mkdir( name );
|
||||
if ( rv == 0 )
|
||||
{
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
_PR_MD_MAP_MKDIR_ERROR( errno );
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return PR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_RMDIR() - Delete a directory
|
||||
**
|
||||
** Returns:
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PR_MD_RMDIR(const char *name)
|
||||
{
|
||||
PRInt32 rv;
|
||||
|
||||
rv = (PRInt32) rmdir( name );
|
||||
if ( rv == -1 )
|
||||
{
|
||||
_PR_MD_MAP_RMDIR_ERROR( errno );
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return(rv);
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_LOCKFILE() - Lock a file.
|
||||
**
|
||||
** The _locking() call locks relative to the current file pointer.
|
||||
** This function is required to lock all of the file, so,
|
||||
** 1. Seek to the beginning of the file, preserving the original position.
|
||||
** 2. Lock the file, pausing if it is locked by someone else, and
|
||||
** try again.
|
||||
** 3. Re-position to the original position in the file.
|
||||
**
|
||||
** For unlocking, a similar protocol of positioning is required.
|
||||
**
|
||||
*/
|
||||
PRStatus
|
||||
_PR_MD_LOCKFILE(PRInt32 f)
|
||||
{
|
||||
PRInt32 rv = PR_SUCCESS; /* What we return to our caller */
|
||||
long seekOrigin; /* original position in file */
|
||||
PRInt32 rc; /* what the system call returns to us */
|
||||
|
||||
/*
|
||||
** Seek to beginning of file, saving original position.
|
||||
*/
|
||||
seekOrigin = lseek( f, 0l, SEEK_SET );
|
||||
if ( rc == -1 )
|
||||
{
|
||||
_PR_MD_MAP_LSEEK_ERROR( errno );
|
||||
return( PR_FAILURE );
|
||||
}
|
||||
|
||||
/*
|
||||
** Attempt to lock the file.
|
||||
** If someone else has it, Sleep-a-while and try again.
|
||||
*/
|
||||
for( rc = -1; rc != 0; )
|
||||
{
|
||||
rc = _locking( f, _LK_NBLCK , 0x7fffffff );
|
||||
if ( rc == -1 )
|
||||
{
|
||||
if ( errno == EACCES )
|
||||
{
|
||||
PR_Sleep( 100 );
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
_PR_MD_MAP_LOCKF_ERROR( errno );
|
||||
rv = PR_FAILURE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} /* end for() */
|
||||
|
||||
/*
|
||||
** Now that the file is locked, re-position to
|
||||
** the original file position.
|
||||
**
|
||||
*/
|
||||
rc = lseek( f, seekOrigin, SEEK_SET );
|
||||
if ( rc == -1 )
|
||||
{
|
||||
_PR_MD_MAP_LSEEK_ERROR( errno );
|
||||
rv = PR_FAILURE;
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return PR_SUCCESS;
|
||||
} /* end _PR_MD_LOCKFILE() */
|
||||
|
||||
/*
|
||||
** _PR_MD_TLOCKFILE() - Test and Lock file.
|
||||
**
|
||||
** The _locking() call locks relative to the current file pointer.
|
||||
** This function is required to lock all of the file, so,
|
||||
** 1. Seek to the beginning of the file, preserving the original position.
|
||||
** 2. Attempt to Lock the file.
|
||||
** If the file is locked by someone else, try NO MORE.
|
||||
** 3. Re-position to the original position in the file.
|
||||
**
|
||||
** See the discussion of _PR_MD_LOCKFILE
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRStatus
|
||||
_PR_MD_TLOCKFILE(PRInt32 f)
|
||||
{
|
||||
PRInt32 rv = PR_SUCCESS; /* What we return */
|
||||
long seekOrigin; /* original position in file */
|
||||
PRInt32 rc; /* return value from system call */
|
||||
|
||||
/*
|
||||
** Seek to beginning of file, saving original position.
|
||||
*/
|
||||
seekOrigin = lseek( f, 0l, SEEK_SET );
|
||||
if ( rc == -1 )
|
||||
{
|
||||
_PR_MD_MAP_LSEEK_ERROR( errno );
|
||||
return( PR_FAILURE );
|
||||
}
|
||||
|
||||
/*
|
||||
** Attempt to lock the file. One ping; one ping only, Vasily.
|
||||
** If someone else has it, Reposition and return failure.
|
||||
*/
|
||||
rc = _locking( f, _LK_NBLCK , 0x7fffffff );
|
||||
if ( rc == -1 )
|
||||
{
|
||||
if ( errno != EACCES )
|
||||
_PR_MD_MAP_LOCKF_ERROR( errno );
|
||||
rv = PR_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
** Now that the file is locked, maybe, re-position to
|
||||
** the original file position.
|
||||
*/
|
||||
rc = lseek( f, seekOrigin, SEEK_SET );
|
||||
if ( rc == -1 )
|
||||
{
|
||||
_PR_MD_MAP_LSEEK_ERROR( errno );
|
||||
rv = PR_FAILURE;
|
||||
}
|
||||
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return rv;
|
||||
} /* end _PR_MD_TLOCKFILE() */
|
||||
|
||||
|
||||
/*
|
||||
** _PR_MD_UNLOCKFILE() - Unlock a file.
|
||||
**
|
||||
** See the discussion of _PR_MD_LOCKFILE
|
||||
**
|
||||
*/
|
||||
PRStatus
|
||||
_PR_MD_UNLOCKFILE(PRInt32 f)
|
||||
{
|
||||
PRInt32 rv = PR_SUCCESS; /* What we return */
|
||||
long seekOrigin; /* original position in file */
|
||||
PRInt32 rc; /* return value from system call */
|
||||
|
||||
/*
|
||||
** Seek to beginning of file, saving original position.
|
||||
*/
|
||||
seekOrigin = lseek( f, 0l, SEEK_SET );
|
||||
if ( rc == -1 )
|
||||
{
|
||||
_PR_MD_MAP_LSEEK_ERROR( errno );
|
||||
return( PR_FAILURE );
|
||||
}
|
||||
|
||||
/*
|
||||
** Unlock the file.
|
||||
*/
|
||||
rc = _locking( f, _LK_UNLCK , 0x7fffffff );
|
||||
if ( rc == -1 )
|
||||
{
|
||||
_PR_MD_MAP_LOCKF_ERROR( errno );
|
||||
rv = PR_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
** Now that the file is unlocked, re-position to
|
||||
** the original file position.
|
||||
*/
|
||||
rc = lseek( f, seekOrigin, SEEK_SET );
|
||||
if ( rc == -1 )
|
||||
{
|
||||
_PR_MD_MAP_LSEEK_ERROR( errno );
|
||||
rv = PR_FAILURE;
|
||||
}
|
||||
PR_Sleep( _PR_MD_WIN16_DELAY );
|
||||
return rv;
|
||||
} /* end _PR_MD_UNLOCKFILE() */
|
||||
|
||||
/*
|
||||
** PR_Stat() -- Return status on a file
|
||||
**
|
||||
** This is a hack! ... See BugSplat: 98516
|
||||
** Basically, this hack takes a name and stat buffer as input.
|
||||
** The input stat buffer is presumed to be a Microsoft stat buffer.
|
||||
** The functions does a Watcom stat() then maps the result to
|
||||
** the MS stat buffer. ...
|
||||
**
|
||||
*/
|
||||
PR_IMPLEMENT(PRInt32) PR_Stat(const char *name, struct stat *buf)
|
||||
{
|
||||
PRInt32 rv;
|
||||
_MDMSStat *mssb = (_MDMSStat*) buf; /* this is Microsoft's stat buffer */
|
||||
struct stat statBuf; /* this is Watcom's stat buffer */
|
||||
|
||||
/* First, get Watcom's idea of stat
|
||||
** then reformat it into a Microsoft idea of stat
|
||||
*/
|
||||
rv = (PRInt32) _stat( name, &statBuf);
|
||||
if (rv == 0l )
|
||||
{
|
||||
mssb->st_dev = statBuf.st_dev;
|
||||
mssb->st_ino = statBuf.st_ino; /* not used, really */
|
||||
mssb->st_mode = statBuf.st_mode;
|
||||
mssb->st_nlink = 1; /* always 1, says MS */
|
||||
mssb->st_uid = statBuf.st_uid;
|
||||
mssb->st_gid = statBuf.st_gid;
|
||||
mssb->st_rdev = statBuf.st_rdev; /* please Gh0d! Let these be the same */
|
||||
mssb->st_size = statBuf.st_size;
|
||||
mssb->st_atime = statBuf.st_atime;
|
||||
mssb->st_mtime = statBuf.st_mtime;
|
||||
mssb->st_ctime = statBuf.st_ctime;
|
||||
}
|
||||
return rv;
|
||||
} /* end PR_Stat() */
|
||||
|
||||
|
||||
|
||||
/* $$ end W16io.c */
|
|
@ -1,84 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*******************************************************************
|
||||
** w16mem.c -- Implement memory segment functions.
|
||||
**
|
||||
**
|
||||
********************************************************************
|
||||
*/
|
||||
#include "primpl.h"
|
||||
|
||||
|
||||
/*
|
||||
** Allocate a new memory segment.
|
||||
**
|
||||
** Return the segment's access rights and size.
|
||||
*/
|
||||
PRStatus _MD_AllocSegment(PRSegment *seg, PRUint32 size, void *vaddr)
|
||||
{
|
||||
PR_ASSERT(seg != 0);
|
||||
PR_ASSERT(size != 0);
|
||||
PR_ASSERT(vaddr == 0);
|
||||
|
||||
/*
|
||||
** Take the actual memory for the segment out of our Figment heap.
|
||||
*/
|
||||
|
||||
seg->vaddr = (char *)malloc(size);
|
||||
|
||||
if (seg->vaddr == NULL) {
|
||||
return PR_FAILURE;
|
||||
}
|
||||
|
||||
seg->size = size;
|
||||
|
||||
return PR_SUCCESS;
|
||||
} /* --- end _MD_AllocSegment() --- */
|
||||
|
||||
|
||||
/*
|
||||
** Free previously allocated memory segment.
|
||||
*/
|
||||
void _MD_FreeSegment(PRSegment *seg)
|
||||
{
|
||||
PR_ASSERT((seg->flags & _PR_SEG_VM) == 0);
|
||||
|
||||
if (seg->vaddr != NULL)
|
||||
free( seg->vaddr );
|
||||
return;
|
||||
} /* --- end _MD_FreeSegment() --- */
|
|
@ -1,116 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "primpl.h"
|
||||
#include <sys/timeb.h>
|
||||
|
||||
|
||||
struct _MDLock _pr_ioq_lock;
|
||||
HINSTANCE _pr_hInstance = NULL;
|
||||
char * _pr_top_of_task_stack;
|
||||
_PRInterruptTable _pr_interruptTable[] = { { 0 } };
|
||||
|
||||
/*
|
||||
*-----------------------------------------------------------------------
|
||||
*
|
||||
* PR_Now --
|
||||
*
|
||||
* Returns the current time in microseconds since the epoch.
|
||||
* The epoch is midnight January 1, 1970 GMT.
|
||||
* The implementation is machine dependent. This is the
|
||||
* implementation for Windows.
|
||||
* Cf. time_t time(time_t *tp)
|
||||
*
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if defined(HAVE_WATCOM_BUG_2)
|
||||
PRTime __pascal __export __loadds
|
||||
#else
|
||||
PR_IMPLEMENT(PRTime)
|
||||
#endif
|
||||
PR_Now(void)
|
||||
{
|
||||
PRInt64 s, ms, ms2us, s2us;
|
||||
struct timeb b;
|
||||
|
||||
ftime(&b);
|
||||
LL_I2L(ms2us, PR_USEC_PER_MSEC);
|
||||
LL_I2L(s2us, PR_USEC_PER_SEC);
|
||||
LL_I2L(s, b.time);
|
||||
LL_I2L(ms, (PRInt32)b.millitm);
|
||||
LL_MUL(ms, ms, ms2us);
|
||||
LL_MUL(s, s, s2us);
|
||||
LL_ADD(s, s, ms);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *_PR_MD_GET_ENV(const char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIntn
|
||||
_PR_MD_PUT_ENV(const char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int CALLBACK LibMain( HINSTANCE hInst, WORD wDataSeg,
|
||||
WORD cbHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
_pr_hInstance = hInst;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_PR_MD_EARLY_INIT()
|
||||
{
|
||||
_tzset();
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_PR_MD_WAKEUP_CPUS( void )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "primpl.h"
|
||||
#include <sys/timeb.h>
|
||||
|
||||
|
||||
/*
|
||||
** Create Process.
|
||||
*/
|
||||
PRProcess * _PR_CreateWindowsProcess(
|
||||
const char *path,
|
||||
char *const *argv,
|
||||
char *const *envp,
|
||||
const PRProcessAttr *attr)
|
||||
{
|
||||
PR_ASSERT(!"Not implemented");
|
||||
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRStatus _PR_DetachWindowsProcess(PRProcess *process)
|
||||
{
|
||||
PR_ASSERT(!"Not implemented");
|
||||
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
|
||||
return PR_FAILURE;
|
||||
}
|
||||
|
||||
PRStatus _PR_WaitWindowsProcess(PRProcess *process,
|
||||
PRInt32 *exitCode)
|
||||
{
|
||||
PR_ASSERT(!"Not implemented");
|
||||
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
|
||||
return PR_FAILURE;
|
||||
}
|
||||
|
||||
PRStatus _PR_KillWindowsProcess(PRProcess *process)
|
||||
{
|
||||
PR_ASSERT(!"Not implemented");
|
||||
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
|
||||
return PR_FAILURE;
|
||||
}
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,169 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
** w16stdio.c -- Callback functions for Win16 stdio read/write.
|
||||
**
|
||||
**
|
||||
*/
|
||||
#include "primpl.h"
|
||||
|
||||
/*
|
||||
** _PL_MDStdioWrite() -- Win16 hackery to get console output
|
||||
**
|
||||
** Returns: number of bytes written.
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PL_W16StdioWrite( void *buf, PRInt32 amount )
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = fputs( buf, stdout );
|
||||
if ( rc == EOF )
|
||||
{
|
||||
// something about errno
|
||||
return(PR_FAILURE);
|
||||
}
|
||||
return( strlen(buf));
|
||||
} /* end _PL_fputs() */
|
||||
|
||||
/*
|
||||
** _PL_W16StdioRead() -- Win16 hackery to get console input
|
||||
**
|
||||
*/
|
||||
PRInt32
|
||||
_PL_W16StdioRead( void *buf, PRInt32 amount )
|
||||
{
|
||||
char *bp;
|
||||
|
||||
bp = fgets( buf, (int) amount, stdin );
|
||||
if ( bp == NULL )
|
||||
{
|
||||
// something about errno
|
||||
return(PR_FAILURE);
|
||||
}
|
||||
|
||||
return( strlen(buf));
|
||||
} /* end _PL_fgets() */
|
||||
/* --- end w16stdio.c --- */
|
||||
|
||||
/*
|
||||
** Wrappers, linked into the client, that call
|
||||
** functions in LibC
|
||||
**
|
||||
*/
|
||||
|
||||
/*
|
||||
** _PL_W16CallBackPuts() -- Wrapper for puts()
|
||||
**
|
||||
*/
|
||||
int PR_CALLBACK _PL_W16CallBackPuts( const char *outputString )
|
||||
{
|
||||
return( puts( outputString ));
|
||||
} /* end _PL_W16CallBackPuts() */
|
||||
|
||||
/*
|
||||
** _PL_W16CallBackStrftime() -- Wrapper for strftime()
|
||||
**
|
||||
*/
|
||||
size_t PR_CALLBACK _PL_W16CallBackStrftime(
|
||||
char *s,
|
||||
size_t len,
|
||||
const char *fmt,
|
||||
const struct tm *p )
|
||||
{
|
||||
return( strftime( s, len, fmt, p ));
|
||||
} /* end _PL_W16CallBackStrftime() */
|
||||
|
||||
/*
|
||||
** _PL_W16CallBackMalloc() -- Wrapper for malloc()
|
||||
**
|
||||
*/
|
||||
void * PR_CALLBACK _PL_W16CallBackMalloc( size_t size )
|
||||
{
|
||||
return( malloc( size ));
|
||||
} /* end _PL_W16CallBackMalloc() */
|
||||
|
||||
/*
|
||||
** _PL_W16CallBackCalloc() -- Wrapper for calloc()
|
||||
**
|
||||
*/
|
||||
void * PR_CALLBACK _PL_W16CallBackCalloc( size_t n, size_t size )
|
||||
{
|
||||
return( calloc( n, size ));
|
||||
} /* end _PL_W16CallBackCalloc() */
|
||||
|
||||
/*
|
||||
** _PL_W16CallBackRealloc() -- Wrapper for realloc()
|
||||
**
|
||||
*/
|
||||
void * PR_CALLBACK _PL_W16CallBackRealloc(
|
||||
void *old_blk,
|
||||
size_t size )
|
||||
{
|
||||
return( realloc( old_blk, size ));
|
||||
} /* end _PL_W16CallBackRealloc() */
|
||||
|
||||
/*
|
||||
** _PL_W16CallBackFree() -- Wrapper for free()
|
||||
**
|
||||
*/
|
||||
void PR_CALLBACK _PL_W16CallBackFree( void *ptr )
|
||||
{
|
||||
free( ptr );
|
||||
return;
|
||||
} /* end _PL_W16CallBackFree() */
|
||||
|
||||
/*
|
||||
** _PL_W16CallBackGetenv() -- Wrapper for getenv()
|
||||
**
|
||||
*/
|
||||
void * PR_CALLBACK _PL_W16CallBackGetenv( const char *name )
|
||||
{
|
||||
return( getenv( name ));
|
||||
} /* end _PL_W16CallBackGetenv */
|
||||
|
||||
|
||||
/*
|
||||
** _PL_W16CallBackPutenv() -- Wrapper for putenv()
|
||||
**
|
||||
*/
|
||||
int PR_CALLBACK _PL_W16CallBackPutenv( const char *assoc )
|
||||
{
|
||||
return( putenv( assoc ));
|
||||
} /* end _PL_W16CallBackGetenv */
|
|
@ -1,426 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape Portable Runtime (NSPR).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "primpl.h"
|
||||
#include <sys/timeb.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
** DispatchTrace -- define a thread dispatch trace entry
|
||||
**
|
||||
** The DispatchTrace oject(s) are instantiated in a single
|
||||
** array. Think of the array as a push-down stack; entry
|
||||
** zero is the most recent, entry one the next most recent, etc.
|
||||
** For each time PR_MD_RESTORE_CONTEXT() is called, the array
|
||||
** is Pushed down and entry zero is overwritten with data
|
||||
** for the newly dispatched thread.
|
||||
**
|
||||
** Function TraceDispatch() manages the DispatchTrace array.
|
||||
**
|
||||
*/
|
||||
typedef struct DispatchTrace
|
||||
{
|
||||
PRThread * thread;
|
||||
PRUint32 state;
|
||||
PRInt16 mdThreadNumber;
|
||||
PRInt16 unused;
|
||||
PRThreadPriority priority;
|
||||
|
||||
} DispatchTrace, *DispatchTracePtr ;
|
||||
|
||||
static void TraceDispatch( PRThread *thread );
|
||||
|
||||
|
||||
PRThread *_pr_primordialThread;
|
||||
|
||||
/*
|
||||
** Note: the static variables must be on the data-segment because
|
||||
** the stack is destroyed during shadow-stack copy operations.
|
||||
**
|
||||
*/
|
||||
static char * pSource; /* ptr to sourc of a "shadow-stack" copy */
|
||||
static char * pTarget; /* ptr to target of a "shadow-stack" copy */
|
||||
static int cxByteCount; /* number of bytes for "shadow-stack" copy */
|
||||
static int bytesMoved; /* instrumentation: WRT "shadow-stack" copy */
|
||||
static FILE * file1 = 0; /* instrumentation: WRT debug */
|
||||
|
||||
#define NUM_DISPATCHTRACE_OBJECTS 24
|
||||
static DispatchTrace dt[NUM_DISPATCHTRACE_OBJECTS] = {0}; /* instrumentation: WRT dispatch */
|
||||
static PRUint32 dispatchCount = 0; /* instrumentation: number of thread dispatches */
|
||||
|
||||
static int OldPriorityOfPrimaryThread = -1;
|
||||
static int TimeSlicesOnNonPrimaryThread = 0;
|
||||
static PRUint32 threadNumber = 1; /* Instrumentation: monotonically increasing number */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** _PR_MD_FINAL_INIT() -- Final MD Initialization
|
||||
**
|
||||
** Poultry Problems! ... The stack, as allocated by PR_NewStack()
|
||||
** is called from here, late in initialization, because PR_NewStack()
|
||||
** requires lots of things working. When some elements of the
|
||||
** primordial thread are created, early in initialization, the
|
||||
** shadow stack is not one of these things. The "shadow stack" is
|
||||
** created here, late in initiailization using PR_NewStack(), to
|
||||
** ensure consistency in creation of the related objects.
|
||||
**
|
||||
** A new ThreadStack, and all its affiliated structures, is allocated
|
||||
** via the call to PR_NewStack(). The PRThread structure in the
|
||||
** new stack is ignored; the old PRThread structure is used (why?).
|
||||
** The old PRThreadStack structure is abandoned.
|
||||
**
|
||||
*/
|
||||
void
|
||||
_PR_MD_FINAL_INIT()
|
||||
{
|
||||
PRThreadStack * stack = 0;
|
||||
PRInt32 stacksize = 0;
|
||||
PRThread * me = _PR_MD_CURRENT_THREAD();
|
||||
|
||||
_PR_ADJUST_STACKSIZE( stacksize );
|
||||
stack = _PR_NewStack( stacksize );
|
||||
|
||||
me->stack = stack;
|
||||
stack->thr = me;
|
||||
|
||||
return;
|
||||
} /* --- end _PR_MD_FINAL_INIT() --- */
|
||||
|
||||
|
||||
void
|
||||
_MD_INIT_RUNNING_CPU( struct _PRCPU *cpu )
|
||||
{
|
||||
PR_INIT_CLIST(&(cpu->md.ioQ));
|
||||
cpu->md.ioq_max_osfd = -1;
|
||||
cpu->md.ioq_timeout = PR_INTERVAL_NO_TIMEOUT;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_PR_MD_YIELD( void )
|
||||
{
|
||||
PR_ASSERT(0);
|
||||
}
|
||||
|
||||
/*
|
||||
** _PR_MD_INIT_STACK() -- Win16 specific Stack initialization.
|
||||
**
|
||||
**
|
||||
*/
|
||||
|
||||
void
|
||||
_PR_MD_INIT_STACK( PRThreadStack *ts, PRIntn redzone )
|
||||
{
|
||||
ts->md.stackTop = ts->stackTop - sizeof(PRThread);
|
||||
ts->md.cxByteCount = 0;
|
||||
|
||||
return;
|
||||
} /* --- end _PR_MD_INIT_STACK() --- */
|
||||
|
||||
/*
|
||||
** _PR_MD_INIT_THREAD() -- Win16 specific Thread initialization.
|
||||
**
|
||||
*/
|
||||
PRStatus
|
||||
_PR_MD_INIT_THREAD(PRThread *thread)
|
||||
{
|
||||
if ( thread->flags & _PR_PRIMORDIAL)
|
||||
{
|
||||
_pr_primordialThread = thread;
|
||||
thread->md.threadNumber = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
thread->md.threadNumber = ++threadNumber;
|
||||
}
|
||||
|
||||
thread->md.magic = _MD_MAGIC_THREAD;
|
||||
strcpy( thread->md.guardBand, "GuardBand" );
|
||||
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
PRStatus
|
||||
_PR_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
|
||||
{
|
||||
_MD_SWITCH_CONTEXT( thread );
|
||||
|
||||
return( PR_SUCCESS );
|
||||
}
|
||||
|
||||
void *PR_W16GetExceptionContext(void)
|
||||
{
|
||||
return _MD_CURRENT_THREAD()->md.exceptionContext;
|
||||
}
|
||||
|
||||
void
|
||||
PR_W16SetExceptionContext(void *context)
|
||||
{
|
||||
_MD_CURRENT_THREAD()->md.exceptionContext = context;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** _MD_RESTORE_CONTEXT() -- Resume execution of thread 't'.
|
||||
**
|
||||
** Win16 threading is based on the NSPR 2.0 general model of
|
||||
** user threads. It differs from the general model in that a
|
||||
** single "real" stack segment is used for execution of all
|
||||
** threads. The context of the suspended threads is preserved
|
||||
** in the md.context [and related members] of the PRThread
|
||||
** structure. The stack context of the suspended thread is
|
||||
** preserved in a "shadow stack" object.
|
||||
**
|
||||
** _MD_RESTORE_CONTEXT() implements most of the thread switching
|
||||
** for NSPR's implementation of Win16 theads.
|
||||
**
|
||||
** Operations Notes:
|
||||
**
|
||||
** Function PR_NewStack() in prustack.c allocates a new
|
||||
** PRThreadStack, PRStack, PRSegment, and a "shadow" stack
|
||||
** for a thread. These structures are wired together to
|
||||
** form the basis of Win16 threads. The thread and shadow
|
||||
** stack structures are created as part of PR_CreateThread().
|
||||
**
|
||||
** Note! Some special "magic" is applied to the "primordial"
|
||||
** thread. The physical layout of the PRThread, PRThreadStack,
|
||||
** shadow stack, ... is somewhat different. Watch yourself when
|
||||
** mucking around with it. ... See _PR_MD_FINAL_INIT() for most
|
||||
** of the special treatment of the primordial thread.
|
||||
**
|
||||
** Function _PR_MD_INIT_STACK() initializes the value of
|
||||
** PRThreadStack member md.cxByteCount to zero; there
|
||||
** is no context to be restored for a thread's initial
|
||||
** dispatch. The value of member md.stackTop is set to
|
||||
** point to the highest usable address on the shadow stack.
|
||||
** This point corresponds to _pr_top_of_task_stack on the
|
||||
** system's operating stack.
|
||||
**
|
||||
** _pr_top_of_task_stack points to a place on the system stack
|
||||
** considered to be "close to the top". Stack context is preserved
|
||||
** relative to this point.
|
||||
**
|
||||
** Reminder: In x86 architecture, the stack grows "down".
|
||||
** That is: the stack pointer (SP register) is decremented
|
||||
** to push objects onto the stack or when a call is made.
|
||||
**
|
||||
** Function _PR_MD_WAIT() invokes macro _MD_SWITCH_CONTEXT();
|
||||
** this causes the hardware registers to be preserved in a
|
||||
** CATCHBUF structure using function Catch() [see _win16.h],
|
||||
** then calls PR_Schedule() to select a new thread for dispatch.
|
||||
** PR_Schedule() calls _MD_RESTORE_CONTEXT() to cause the thread
|
||||
** being suspended's stack to be preserved, to restore the
|
||||
** stack of the to-be-dispactched thread, and to restore the
|
||||
** to-be-dispactched thread's hardware registers.
|
||||
**
|
||||
** At the moment _PR_MD_RESTORE_CONTEXT() is called, the stack
|
||||
** pointer (SP) is less than the reference pointer
|
||||
** _pr_top_of_task_stack. The distance difference between the SP and
|
||||
** _pr_top_of_task_stack is the amount of stack that must be preserved.
|
||||
** This value, cxByteCount, is calculated then preserved in the
|
||||
** PRThreadStack.md.cxByteCount for later use (size of stack
|
||||
** context to restore) when this thread is dispatched again.
|
||||
**
|
||||
** A C language for() loop is used to copy, byte-by-byte, the
|
||||
** stack data being preserved starting at the "address of t"
|
||||
** [Note: 't' is the argument passed to _PR_MD_RESTORE_CONTEXT()]
|
||||
** for the length of cxByteCount.
|
||||
**
|
||||
** variables pSource and pTarget are the calculated source and
|
||||
** destination pointers for the stack copy operation. These
|
||||
** variables are static scope because they cannot be instantiated
|
||||
** on the stack itself, since the stack is clobbered by restoring
|
||||
** the to-be-dispatched thread's stack context.
|
||||
**
|
||||
** After preserving the suspended thread's stack and architectural
|
||||
** context, the to-be-dispatched thread's stack context is copied
|
||||
** from its shadow stack to the system operational stack. The copy
|
||||
** is done in a small fragment of in-line assembly language. Note:
|
||||
** In NSPR 1.0, a while() loop was used to do the copy; when compiled
|
||||
** with the MS C 1.52c compiler, the short while loop used no
|
||||
** stack variables. The Watcom compiler, specified for use on NSPR 2.0,
|
||||
** uses stack variables to implement the same while loop. This is
|
||||
** a no-no! The copy operation clobbers these variables making the
|
||||
** results of the copy ... unpredictable ... So, a short piece of
|
||||
** inline assembly language is used to effect the copy.
|
||||
**
|
||||
** Following the restoration of the to-be-dispatched thread's
|
||||
** stack context, another short inline piece of assemble language
|
||||
** is used to set the SP register to correspond to what it was
|
||||
** when the to-be-dispatched thread was suspended. This value
|
||||
** uses the thread's stack->md.cxByteCount as a negative offset
|
||||
** from _pr_top_of_task_stack as the new value of SP.
|
||||
**
|
||||
** Finally, Function Throw() is called to restore the architectural
|
||||
** context of the to-be-dispatched thread.
|
||||
**
|
||||
** At this point, the newly dispatched thread appears to resume
|
||||
** execution following the _PR_MD_SWITCH_CONTEXT() macro.
|
||||
**
|
||||
** OK, this ain't rocket-science, but it can confuse you easily.
|
||||
** If you have to work on this stuff, please take the time to
|
||||
** draw, on paper, the structures (PRThread, PRThreadStack,
|
||||
** PRSegment, the "shadow stack", the system stack and the related
|
||||
** global variables). Hand step it thru the debugger to make sure
|
||||
** you understand it very well before making any changes. ...
|
||||
** YMMV.
|
||||
**
|
||||
*/
|
||||
void _MD_RESTORE_CONTEXT(PRThread *t)
|
||||
{
|
||||
dispatchCount++;
|
||||
TraceDispatch( t );
|
||||
/*
|
||||
** This is a good opportunity to make sure that the main
|
||||
** mozilla thread actually gets some time. If interrupts
|
||||
** are on, then we know it is safe to check if the main
|
||||
** thread is being starved. If moz has not been scheduled
|
||||
** for a long time, then then temporarily bump the fe priority
|
||||
** up so that it gets to run at least one.
|
||||
*/
|
||||
// #if 0 // lth. condition off for debug.
|
||||
if (_pr_primordialThread == t) {
|
||||
if (OldPriorityOfPrimaryThread != -1) {
|
||||
PR_SetThreadPriority(_pr_primordialThread, OldPriorityOfPrimaryThread);
|
||||
OldPriorityOfPrimaryThread = -1;
|
||||
}
|
||||
TimeSlicesOnNonPrimaryThread = 0;
|
||||
} else {
|
||||
TimeSlicesOnNonPrimaryThread++;
|
||||
}
|
||||
|
||||
if ((TimeSlicesOnNonPrimaryThread >= 20) && (OldPriorityOfPrimaryThread == -1)) {
|
||||
OldPriorityOfPrimaryThread = PR_GetThreadPriority(_pr_primordialThread);
|
||||
PR_SetThreadPriority(_pr_primordialThread, 31);
|
||||
TimeSlicesOnNonPrimaryThread = 0;
|
||||
}
|
||||
// #endif
|
||||
/*
|
||||
** Save the Task Stack into the "shadow stack" of the current thread
|
||||
*/
|
||||
cxByteCount = (int) ((PRUint32) _pr_top_of_task_stack - (PRUint32) &t );
|
||||
pSource = (char *) &t;
|
||||
pTarget = (char *)((PRUint32)_pr_currentThread->stack->md.stackTop
|
||||
- (PRUint32)cxByteCount );
|
||||
_pr_currentThread->stack->md.cxByteCount = cxByteCount;
|
||||
|
||||
for( bytesMoved = 0; bytesMoved < cxByteCount; bytesMoved++ )
|
||||
*(pTarget + bytesMoved ) = *(pSource + bytesMoved );
|
||||
|
||||
/* Mark the new thread as the current thread */
|
||||
_pr_currentThread = t;
|
||||
|
||||
/*
|
||||
** Now copy the "shadow stack" of the new thread into the Task Stack
|
||||
**
|
||||
** REMEMBER:
|
||||
** After the stack has been copied, ALL local variables in this function
|
||||
** are invalid !!
|
||||
*/
|
||||
cxByteCount = t->stack->md.cxByteCount;
|
||||
pSource = t->stack->md.stackTop - cxByteCount;
|
||||
pTarget = _pr_top_of_task_stack - cxByteCount;
|
||||
|
||||
errno = (_pr_currentThread)->md.errcode;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov cx, cxByteCount
|
||||
mov si, WORD PTR [pSource]
|
||||
mov di, WORD PTR [pTarget]
|
||||
mov ax, WORD PTR [pTarget + 2]
|
||||
mov es, ax
|
||||
mov ax, WORD PTR [pSource + 2]
|
||||
mov bx, ds
|
||||
mov ds, ax
|
||||
rep movsb
|
||||
mov ds, bx
|
||||
}
|
||||
|
||||
/*
|
||||
** IMPORTANT:
|
||||
** ----------
|
||||
** SS:SP is now invalid :-( This means that all local variables and
|
||||
** function arguments are invalid and NO function calls can be
|
||||
** made !!! We must fix up SS:SP so that function calls can safely
|
||||
** be made...
|
||||
*/
|
||||
|
||||
__asm {
|
||||
mov ax, WORD PTR [_pr_top_of_task_stack]
|
||||
sub ax, cxByteCount
|
||||
mov sp, ax
|
||||
};
|
||||
|
||||
/*
|
||||
** Resume execution of thread: t by restoring the thread's context.
|
||||
**
|
||||
*/
|
||||
Throw((_pr_currentThread)->md.context, 1);
|
||||
} /* --- end MD_RESTORE_CONTEXT() --- */
|
||||
|
||||
|
||||
static void TraceDispatch( PRThread *thread )
|
||||
{
|
||||
int i;
|
||||
|
||||
/*
|
||||
** push all DispatchTrace objects to down one slot.
|
||||
** Note: the last entry is lost; last-1 becomes last, etc.
|
||||
*/
|
||||
for( i = NUM_DISPATCHTRACE_OBJECTS -2; i >= 0; i-- )
|
||||
{
|
||||
dt[i +1] = dt[i];
|
||||
}
|
||||
|
||||
/*
|
||||
** Build dt[0] from t
|
||||
*/
|
||||
dt->thread = thread;
|
||||
dt->state = thread->state;
|
||||
dt->mdThreadNumber = thread->md.threadNumber;
|
||||
dt->priority = thread->priority;
|
||||
|
||||
return;
|
||||
} /* --- end TraceDispatch() --- */
|
||||
|
||||
|
||||
/* $$ end W16thred.c */
|
|
@ -35,6 +35,16 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
* This file is based on the third-party code dtoa.c. We minimize our
|
||||
* modifications to third-party code to make it easy to merge new versions.
|
||||
* The author of dtoa.c was not willing to add the parentheses suggested by
|
||||
* GCC, so we suppress these warnings.
|
||||
*/
|
||||
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
|
||||
#pragma GCC diagnostic ignored "-Wparentheses"
|
||||
#endif
|
||||
|
||||
#include "primpl.h"
|
||||
|
||||
#define MULTIPLE_THREADS
|
||||
|
@ -217,11 +227,6 @@ void _PR_CleanupDtoa(void)
|
|||
* floating-point numbers and flushes underflows to zero rather
|
||||
* than implementing gradual underflow, then you must also #define
|
||||
* Sudden_Underflow.
|
||||
* #define YES_ALIAS to permit aliasing certain double values with
|
||||
* arrays of ULongs. This leads to slightly better code with
|
||||
* some compilers and was always used prior to 19990916, but it
|
||||
* is not strictly legal and can cause trouble with aggressively
|
||||
* optimizing compilers (e.g., gcc 2.95.1 under -O2).
|
||||
* #define USE_LOCALE to use the current locale's decimal_point value.
|
||||
* #define SET_INEXACT if IEEE arithmetic is being used and extra
|
||||
* computation should be done to set the inexact flag when the
|
||||
|
@ -358,24 +363,13 @@ Exactly one of IEEE_8087, IEEE_MC68k, IEEE_ARM, VAX, or IBM should be defined.
|
|||
|
||||
typedef union { double d; ULong L[2]; } U;
|
||||
|
||||
#ifdef YES_ALIAS
|
||||
#define dval(x) x
|
||||
#define dval(x) (x).d
|
||||
#ifdef IEEE_8087
|
||||
#define word0(x) ((ULong *)&x)[1]
|
||||
#define word1(x) ((ULong *)&x)[0]
|
||||
#define word0(x) (x).L[1]
|
||||
#define word1(x) (x).L[0]
|
||||
#else
|
||||
#define word0(x) ((ULong *)&x)[0]
|
||||
#define word1(x) ((ULong *)&x)[1]
|
||||
#endif
|
||||
#else
|
||||
#ifdef IEEE_8087
|
||||
#define word0(x) ((U*)&x)->L[1]
|
||||
#define word1(x) ((U*)&x)->L[0]
|
||||
#else
|
||||
#define word0(x) ((U*)&x)->L[0]
|
||||
#define word1(x) ((U*)&x)->L[1]
|
||||
#endif
|
||||
#define dval(x) ((U*)&x)->d
|
||||
#define word0(x) (x).L[0]
|
||||
#define word1(x) (x).L[1]
|
||||
#endif
|
||||
|
||||
/* The following definition of Storeinc is appropriate for MIPS processors.
|
||||
|
@ -1184,14 +1178,15 @@ diff
|
|||
static double
|
||||
ulp
|
||||
#ifdef KR_headers
|
||||
(x) double x;
|
||||
(dx) double dx;
|
||||
#else
|
||||
(double x)
|
||||
(double dx)
|
||||
#endif
|
||||
{
|
||||
register Long L;
|
||||
double a;
|
||||
U x, a;
|
||||
|
||||
dval(x) = dx;
|
||||
L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
|
||||
#ifndef Avoid_Underflow
|
||||
#ifndef Sudden_Underflow
|
||||
|
@ -1233,7 +1228,7 @@ b2d
|
|||
{
|
||||
ULong *xa, *xa0, w, y, z;
|
||||
int k;
|
||||
double d;
|
||||
U d;
|
||||
#ifdef VAX
|
||||
ULong d0, d1;
|
||||
#else
|
||||
|
@ -1296,11 +1291,12 @@ b2d
|
|||
static Bigint *
|
||||
d2b
|
||||
#ifdef KR_headers
|
||||
(d, e, bits) double d; int *e, *bits;
|
||||
(dd, e, bits) double dd; int *e, *bits;
|
||||
#else
|
||||
(double d, int *e, int *bits)
|
||||
(double dd, int *e, int *bits)
|
||||
#endif
|
||||
{
|
||||
U d;
|
||||
Bigint *b;
|
||||
int de, k;
|
||||
ULong *x, y, z;
|
||||
|
@ -1309,6 +1305,10 @@ d2b
|
|||
#endif
|
||||
#ifdef VAX
|
||||
ULong d0, d1;
|
||||
#endif
|
||||
|
||||
dval(d) = dd;
|
||||
#ifdef VAX
|
||||
d0 = word0(d) >> 16 | word0(d) << 16;
|
||||
d1 = word1(d) >> 16 | word1(d) << 16;
|
||||
#else
|
||||
|
@ -1439,7 +1439,7 @@ ratio
|
|||
(Bigint *a, Bigint *b)
|
||||
#endif
|
||||
{
|
||||
double da, db;
|
||||
U da, db;
|
||||
int k, ka, kb;
|
||||
|
||||
dval(da) = b2d(a, &ka);
|
||||
|
@ -1613,7 +1613,8 @@ PR_strtod
|
|||
int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
|
||||
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
|
||||
CONST char *s, *s0, *s1;
|
||||
double aadj, aadj1, adj, rv, rv0;
|
||||
double aadj, aadj1, adj;
|
||||
U aadj2, rv, rv0;
|
||||
Long L;
|
||||
ULong y, z;
|
||||
Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
|
||||
|
@ -2376,7 +2377,9 @@ PR_strtod
|
|||
aadj = z;
|
||||
aadj1 = dsign ? aadj : -aadj;
|
||||
}
|
||||
word0(aadj1) += (2*P+1)*Exp_msk1 - y;
|
||||
dval(aadj2) = aadj1;
|
||||
word0(aadj2) += (2*P+1)*Exp_msk1 - y;
|
||||
aadj1 = dval(aadj2);
|
||||
}
|
||||
adj = aadj1 * ulp(dval(rv));
|
||||
dval(rv) += adj;
|
||||
|
@ -2711,10 +2714,10 @@ freedtoa(char *s)
|
|||
static char *
|
||||
dtoa
|
||||
#ifdef KR_headers
|
||||
(d, mode, ndigits, decpt, sign, rve)
|
||||
double d; int mode, ndigits, *decpt, *sign; char **rve;
|
||||
(dd, mode, ndigits, decpt, sign, rve)
|
||||
double dd; int mode, ndigits, *decpt, *sign; char **rve;
|
||||
#else
|
||||
(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
|
||||
(double dd, int mode, int ndigits, int *decpt, int *sign, char **rve)
|
||||
#endif
|
||||
{
|
||||
/* Arguments ndigits, decpt, sign are similar to those
|
||||
|
@ -2760,7 +2763,8 @@ dtoa
|
|||
ULong x;
|
||||
#endif
|
||||
Bigint *b, *b1, *delta, *mlo, *mhi, *S;
|
||||
double d2, ds, eps;
|
||||
U d, d2, eps;
|
||||
double ds;
|
||||
char *s, *s0;
|
||||
#ifdef Honor_FLT_ROUNDS
|
||||
int rounding;
|
||||
|
@ -2776,6 +2780,7 @@ dtoa
|
|||
}
|
||||
#endif
|
||||
|
||||
dval(d) = dd;
|
||||
if (word0(d) & Sign_bit) {
|
||||
/* set sign for everything, including 0's and NaNs */
|
||||
*sign = 1;
|
||||
|
@ -3356,7 +3361,9 @@ dtoa
|
|||
++*s++;
|
||||
}
|
||||
else {
|
||||
#ifdef Honor_FLT_ROUNDS
|
||||
trimzeros:
|
||||
#endif
|
||||
while(*--s == '0');
|
||||
s++;
|
||||
}
|
||||
|
@ -3435,13 +3442,15 @@ PR_dtoa(PRFloat64 d, PRIntn mode, PRIntn ndigits,
|
|||
** '+' or '-' after the 'e' in scientific notation
|
||||
*/
|
||||
PR_IMPLEMENT(void)
|
||||
PR_cnvtf(char *buf,int bufsz, int prcsn,double fval)
|
||||
PR_cnvtf(char *buf, int bufsz, int prcsn, double dfval)
|
||||
{
|
||||
PRIntn decpt, sign, numdigits;
|
||||
char *num, *nump;
|
||||
char *bufp = buf;
|
||||
char *endnum;
|
||||
U fval;
|
||||
|
||||
dval(fval) = dfval;
|
||||
/* If anything fails, we store an empty string in 'buf' */
|
||||
num = (char*)PR_MALLOC(bufsz);
|
||||
if (num == NULL) {
|
||||
|
|
|
@ -42,21 +42,10 @@ static PRInt64 ll_maxint = LL_INIT( 0x7fffffff, 0xffffffff );
|
|||
static PRInt64 ll_minint = LL_INIT( 0x80000000, 0x00000000 );
|
||||
static PRUint64 ll_maxuint = LL_INIT( 0xffffffff, 0xffffffff );
|
||||
|
||||
#if defined(HAVE_WATCOM_BUG_2)
|
||||
PRInt64 __pascal __loadds __export
|
||||
LL_Zero(void) { return ll_zero; }
|
||||
PRInt64 __pascal __loadds __export
|
||||
LL_MaxInt(void) { return ll_maxint; }
|
||||
PRInt64 __pascal __loadds __export
|
||||
LL_MinInt(void) { return ll_minint; }
|
||||
PRUint64 __pascal __loadds __export
|
||||
LL_MaxUint(void) { return ll_maxuint; }
|
||||
#else
|
||||
PR_IMPLEMENT(PRInt64) LL_Zero(void) { return ll_zero; }
|
||||
PR_IMPLEMENT(PRInt64) LL_MaxInt(void) { return ll_maxint; }
|
||||
PR_IMPLEMENT(PRInt64) LL_MinInt(void) { return ll_minint; }
|
||||
PR_IMPLEMENT(PRUint64) LL_MaxUint(void) { return ll_maxuint; }
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LONG_LONG
|
||||
/*
|
||||
|
|
|
@ -50,10 +50,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef XP_MAC
|
||||
#include <errno.h> /* for EINVAL */
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The COUNT_LEAPS macro counts the number of leap years passed by
|
||||
|
@ -165,7 +163,7 @@ ComputeGMT(PRTime time, PRExplodedTime *gmt)
|
|||
}
|
||||
|
||||
/* Compute the time of day. */
|
||||
|
||||
|
||||
gmt->tm_hour = rem / 3600;
|
||||
rem %= 3600;
|
||||
gmt->tm_min = rem / 60;
|
||||
|
@ -178,7 +176,7 @@ ComputeGMT(PRTime time, PRExplodedTime *gmt)
|
|||
* Since numDays is originally the number of days since January 1, 1970,
|
||||
* we must change it to be the number of days from January 1, 0001.
|
||||
*/
|
||||
|
||||
|
||||
numDays += 719162; /* 719162 = days from year 1 up to 1970 */
|
||||
tmp = numDays / 146097; /* 146097 = days in 400 years */
|
||||
rem = numDays % 146097;
|
||||
|
@ -199,7 +197,7 @@ ComputeGMT(PRTime time, PRExplodedTime *gmt)
|
|||
tmp = rem / 1461; /* 1461 = days in 4 years */
|
||||
rem %= 1461;
|
||||
gmt->tm_year += tmp * 4;
|
||||
|
||||
|
||||
/* Compute which year in the 4. */
|
||||
|
||||
tmp = rem / 365;
|
||||
|
@ -259,11 +257,7 @@ PR_ExplodeTime(
|
|||
*
|
||||
*------------------------------------------------------------------------
|
||||
*/
|
||||
#if defined(HAVE_WATCOM_BUG_2)
|
||||
PRTime __pascal __export __loadds
|
||||
#else
|
||||
PR_IMPLEMENT(PRTime)
|
||||
#endif
|
||||
PR_ImplodeTime(const PRExplodedTime *exploded)
|
||||
{
|
||||
PRExplodedTime copy;
|
||||
|
@ -513,8 +507,6 @@ PR_NormalizeTime(PRExplodedTime *time, PRTimeParamFn params)
|
|||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if defined(HAVE_INT_LOCALTIME_R)
|
||||
|
||||
/*
|
||||
|
@ -1567,6 +1559,12 @@ PR_ParseTimeStringToExplodedTime(
|
|||
result->tm_year = year;
|
||||
if (dotw != TT_UNKNOWN)
|
||||
result->tm_wday = (((int)dotw) - ((int)TT_SUN));
|
||||
/*
|
||||
* Mainly to compute wday and yday, but normalized time is also required
|
||||
* by the check below that works around a Visual C++ 2005 mktime problem.
|
||||
*/
|
||||
PR_NormalizeTime(result, PR_GMTParameters);
|
||||
/* The remaining work is to set the gmt and dst offsets in tm_params. */
|
||||
|
||||
if (zone == TT_UNKNOWN && default_to_gmt)
|
||||
{
|
||||
|
@ -1616,7 +1614,32 @@ PR_ParseTimeStringToExplodedTime(
|
|||
date you are handing it is in daylight savings mode or not;
|
||||
and if you're wrong, it will "fix" it for you. */
|
||||
localTime.tm_isdst = -1;
|
||||
|
||||
#if _MSC_VER == 1400 /* 1400 = Visual C++ 2005 (8.0) */
|
||||
/*
|
||||
* mktime will return (time_t) -1 if the input is a date
|
||||
* after 23:59:59, December 31, 3000, US Pacific Time (not
|
||||
* UTC as documented):
|
||||
* http://msdn.microsoft.com/en-us/library/d1y53h2a(VS.80).aspx
|
||||
* But if the year is 3001, mktime also invokes the invalid
|
||||
* parameter handler, causing the application to crash. This
|
||||
* problem has been reported in
|
||||
* http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=266036.
|
||||
* We avoid this crash by not calling mktime if the date is
|
||||
* out of range. To use a simple test that works in any time
|
||||
* zone, we consider year 3000 out of range as well. (See
|
||||
* bug 480740.)
|
||||
*/
|
||||
if (result->tm_year >= 3000) {
|
||||
/* Emulate what mktime would have done. */
|
||||
errno = EINVAL;
|
||||
secs = (time_t) -1;
|
||||
} else {
|
||||
secs = mktime(&localTime);
|
||||
}
|
||||
#else
|
||||
secs = mktime(&localTime);
|
||||
#endif
|
||||
if (secs != (time_t) -1)
|
||||
{
|
||||
PRTime usecs64;
|
||||
|
@ -1638,8 +1661,6 @@ PR_ParseTimeStringToExplodedTime(
|
|||
+ 1440 * (localTime.tm_mday - 2);
|
||||
}
|
||||
|
||||
/* mainly to compute wday and yday */
|
||||
PR_NormalizeTime(result, PR_GMTParameters);
|
||||
result->tm_params.tp_gmt_offset = zone_offset * 60;
|
||||
result->tm_params.tp_dst_offset = dst_offset * 60;
|
||||
|
||||
|
|
|
@ -421,7 +421,7 @@ PR_IMPLEMENT(void)
|
|||
** so that the log thread could run.
|
||||
** I know, it perturbs the universe and may cause
|
||||
** funny things to happen in the optimized builds.
|
||||
** Take it out, loose data; leave it in risk Heisenberg.
|
||||
** Take it out, lose data; leave it in risk Heisenberg.
|
||||
*/
|
||||
/* PR_Sleep(0); */
|
||||
}
|
||||
|
|
|
@ -469,3 +469,8 @@ EXPORTS ;-
|
|||
;+ global:
|
||||
PR_ParseTimeStringToExplodedTime;
|
||||
;+} NSPR_4.6;
|
||||
;+NSPR_4.8 {
|
||||
;+ global:
|
||||
PR_AssertCurrentThreadOwnsLock;
|
||||
PR_AssertCurrentThreadInMonitor;
|
||||
;+} NSPR_4.7;
|
||||
|
|
|
@ -208,8 +208,12 @@ PR_IMPLEMENT(void) PR_Lock(PRLock *lock)
|
|||
PR_ASSERT(0 == lock->notified.length);
|
||||
PR_ASSERT(NULL == lock->notified.link);
|
||||
PR_ASSERT(PR_FALSE == lock->locked);
|
||||
lock->locked = PR_TRUE;
|
||||
/* Nb: the order of the next two statements is not critical to
|
||||
* the correctness of PR_AssertCurrentThreadOwnsLock(), but
|
||||
* this particular order makes the assertion more likely to
|
||||
* catch errors. */
|
||||
lock->owner = pthread_self();
|
||||
lock->locked = PR_TRUE;
|
||||
#if defined(DEBUG)
|
||||
pt_debug.locks_acquired += 1;
|
||||
#endif
|
||||
|
@ -241,6 +245,14 @@ PR_IMPLEMENT(PRStatus) PR_Unlock(PRLock *lock)
|
|||
return PR_SUCCESS;
|
||||
} /* PR_Unlock */
|
||||
|
||||
PR_IMPLEMENT(void) PR_AssertCurrentThreadOwnsLock(PRLock *lock)
|
||||
{
|
||||
/* Nb: the order of the |locked| and |owner==me| checks is not critical
|
||||
* to the correctness of PR_AssertCurrentThreadOwnsLock(), but
|
||||
* this particular order makes the assertion more likely to
|
||||
* catch errors. */
|
||||
PR_ASSERT(lock->locked && pthread_equal(lock->owner, pthread_self()));
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
/**************************************************************/
|
||||
|
@ -516,6 +528,11 @@ PR_IMPLEMENT(PRIntn) PR_GetMonitorEntryCount(PRMonitor *mon)
|
|||
return 0;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(void) PR_AssertCurrentThreadInMonitor(PRMonitor *mon)
|
||||
{
|
||||
PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(&mon->lock);
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(void) PR_EnterMonitor(PRMonitor *mon)
|
||||
{
|
||||
pthread_t self = pthread_self();
|
||||
|
|
|
@ -52,6 +52,13 @@
|
|||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef SYMBIAN
|
||||
/* In Open C sched_get_priority_min/max do not work properly, so we undefine
|
||||
* _POSIX_THREAD_PRIORITY_SCHEDULING here.
|
||||
*/
|
||||
#undef _POSIX_THREAD_PRIORITY_SCHEDULING
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Record whether or not we have the privilege to set the scheduling
|
||||
* policy and priority of threads. 0 means that privilege is available.
|
||||
|
|
|
@ -403,6 +403,16 @@ PR_IMPLEMENT(PRStatus) PR_Unlock(PRLock *lock)
|
|||
#endif /* _PR_GLOBAL_THREADS_ONLY */
|
||||
}
|
||||
|
||||
/*
|
||||
** If the current thread owns |lock|, this assertion is guaranteed to
|
||||
** succeed. Otherwise, the behavior of this function is undefined.
|
||||
*/
|
||||
PR_IMPLEMENT(void) PR_AssertCurrentThreadOwnsLock(PRLock *lock)
|
||||
{
|
||||
PRThread *me = _PR_MD_CURRENT_THREAD();
|
||||
PR_ASSERT(lock->owner == me);
|
||||
}
|
||||
|
||||
/*
|
||||
** Test and then lock the lock if it's not already locked by some other
|
||||
** thread. Return PR_FALSE if some other thread owned the lock at the
|
||||
|
|
|
@ -144,6 +144,15 @@ PR_IMPLEMENT(PRIntn) PR_GetMonitorEntryCount(PRMonitor *mon)
|
|||
mon->entryCount : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** If the current thread is in |mon|, this assertion is guaranteed to
|
||||
** succeed. Otherwise, the behavior of this function is undefined.
|
||||
*/
|
||||
PR_IMPLEMENT(void) PR_AssertCurrentThreadInMonitor(PRMonitor *mon)
|
||||
{
|
||||
PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(mon->cvar->lock);
|
||||
}
|
||||
|
||||
/*
|
||||
** Wait for a notify on the condition variable. Sleep for "ticks" amount
|
||||
** of time (if "tick" is 0 then the sleep is indefinite). While
|
||||
|
|
|
@ -125,6 +125,7 @@ CSRCS = \
|
|||
op_nofil.c \
|
||||
openfile.c \
|
||||
parent.c \
|
||||
parsetm.c \
|
||||
peek.c \
|
||||
perf.c \
|
||||
pipeping.c \
|
||||
|
@ -203,6 +204,12 @@ CSRCS = \
|
|||
zerolen.c \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH),WINCE)
|
||||
TESTPROGS = \
|
||||
wince_tester.cpp \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_TARGET),OS2)
|
||||
CSRCS += \
|
||||
sleep.c \
|
||||
|
@ -211,13 +218,19 @@ CSRCS += \
|
|||
$(NULL)
|
||||
endif
|
||||
|
||||
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
||||
ifeq (,$(filter-out WINCE WINNT OS2,$(OS_ARCH)))
|
||||
PROG_SUFFIX = .exe
|
||||
DLL_SUFFIX = .dll
|
||||
else
|
||||
PROG_SUFFIX =
|
||||
DLL_SUFFIX =
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINCE)
|
||||
PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(DLL_SUFFIX))) $(addprefix $(OBJDIR)/, $(TESTPROGS:.cpp=$(PROG_SUFFIX)))
|
||||
else
|
||||
PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
|
||||
endif
|
||||
|
||||
TARGETS = $(PROGS)
|
||||
|
||||
|
@ -229,12 +242,30 @@ ifdef NS_USE_GCC
|
|||
else
|
||||
EXTRA_LIBS += wsock32.lib
|
||||
LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
|
||||
ifdef PROFILE
|
||||
LDOPTS += -PROFILE -MAP
|
||||
ifdef PROFILE
|
||||
LDOPTS += -PROFILE -MAP
|
||||
endif # profile
|
||||
endif # NS_USE_GCC
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINCE)
|
||||
ifdef NS_USE_GCC
|
||||
EXTRA_LIBS += -lws2 -lcoredll
|
||||
else
|
||||
INCLUDES += -FInst_wince.h
|
||||
EXTRA_LIBS += ws2.lib coredll.lib
|
||||
LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO -PDB:$(@:.dll=.pdb)
|
||||
EXE_EXTRA_LDOPTS = -SUBSYSTEM:CONSOLE
|
||||
ifdef PROFILE
|
||||
LDOPTS += -PROFILE -MAP
|
||||
endif # profile
|
||||
endif # NS_USE_GCC
|
||||
|
||||
# Use CC to compile all CPP files / also use all CC flags
|
||||
CCC = $(CC)
|
||||
CXXFLAGS = $(CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
EXTRA_LIBS = $(OS_LIBS)
|
||||
LDOPTS = -Zomf -Zlinker /PM:VIO -Zlinker /ST:0x64000
|
||||
|
@ -485,11 +516,37 @@ ifdef MT
|
|||
rm -f $@.manifest; \
|
||||
fi
|
||||
endif
|
||||
else
|
||||
ifeq ($(OS_ARCH),WINCE)
|
||||
$(PURE) $(LD) $(XCFLAGS) $< $(LDOPTS:.exe=.pdb) $(EXE_EXTRA_LDOPTS) $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -OUT:$@
|
||||
else
|
||||
$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -o $@
|
||||
endif # wince
|
||||
endif # WINNT
|
||||
endif # AIX_PRE_4_2
|
||||
|
||||
|
||||
ifeq ($(OS_ARCH),WINCE)
|
||||
$(OBJS): $(OBJDIR)/%.$(OBJ_SUFFIX): nst_wince.h
|
||||
|
||||
# WinCE HAS to be different. Turns out that the OS swallows crashes
|
||||
# and returns a result code of zero -- an indication of success for
|
||||
# the shell script. AND, WinCE does not really have a good shell
|
||||
# to use for testing, anyway.
|
||||
#
|
||||
# To combat both issues, we need to build the tests as stand-alone
|
||||
# DLLs, then dynamically load the DLLs one at a time inside a test
|
||||
# program. Each DLL's test will be run inside a TRY/CATCH construct,
|
||||
# allowing the testing program to do what the shell script already
|
||||
# does naturally.
|
||||
#
|
||||
# This section builds DLLs instead of EXEs for each of the tests.
|
||||
# - wolfe@lobo.us
|
||||
$(OBJDIR)/%$(DLL_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
|
||||
@$(MAKE_OBJDIR)
|
||||
$(PURE) $(LD) $(XCFLAGS) $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -DLL -OUT:$@ $<
|
||||
endif # wince
|
||||
|
||||
export:: $(TARGETS)
|
||||
clean::
|
||||
rm -f $(TARGETS)
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
|
||||
#define SERVER_MAX_BIND_COUNT 100
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_OS2)
|
||||
#if defined(XP_MAC) || defined(XP_OS2) || defined(SYMBIAN)
|
||||
#define TIMEOUTSECS 10
|
||||
#else
|
||||
#define TIMEOUTSECS 2
|
||||
|
|
|
@ -65,7 +65,11 @@ static PRStatus PrintAddress(const PRNetAddr* address)
|
|||
static void ConnectingThread(void *arg)
|
||||
{
|
||||
PRInt32 nbytes;
|
||||
#ifdef SYMBIAN
|
||||
char buf[256];
|
||||
#else
|
||||
char buf[1024];
|
||||
#endif
|
||||
PRFileDesc *sock;
|
||||
PRNetAddr peer_addr, *addr;
|
||||
|
||||
|
@ -182,7 +186,7 @@ static void AcceptingThread(void *arg)
|
|||
PL_FPrintError(err_out, "PR_Close (server) failed");
|
||||
} /* AcceptingThread */
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRHostEnt he;
|
||||
PRStatus status;
|
||||
|
|
|
@ -80,7 +80,11 @@ static PRStatus PrintAddress(const PRNetAddr* address)
|
|||
static void ConnectingThread(void *arg)
|
||||
{
|
||||
PRInt32 nbytes;
|
||||
#ifdef SYMBIAN
|
||||
char buf[256];
|
||||
#else
|
||||
char buf[1024];
|
||||
#endif
|
||||
PRFileDesc *sock;
|
||||
PRNetAddr peer_addr, *addr;
|
||||
|
||||
|
@ -209,7 +213,7 @@ static void AcceptingThread(void *arg)
|
|||
PL_FPrintError(err_out, "PR_Close (server) failed");
|
||||
} /* AcceptingThread */
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRHostEnt he;
|
||||
PRStatus status;
|
||||
|
|
|
@ -71,7 +71,7 @@ const char *badaddrs[] = {
|
|||
|
||||
int failed_already = 0;
|
||||
|
||||
int main()
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char **nexttestaddr = testaddrs;
|
||||
const char **nextbadaddr = badaddrs;
|
||||
|
|
|
@ -287,7 +287,7 @@ static void ServerTwo( void )
|
|||
} /* end ServerTwo() */
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -62,7 +62,7 @@ const PRInt32 addedBytes = 1000;
|
|||
const PRInt32 buf = 1; /* constant written to fd, addedBytes times */
|
||||
PRInt32 inBuf; /* read it back into here */
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRStatus rc;
|
||||
PRInt32 rv;
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
* result |= !(EXPRESSION);
|
||||
*/
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRInt32 rv, oldval, test, result = 0;
|
||||
PRFileDesc *output = PR_GetSpecialFD(PR_StandardOutput);
|
||||
|
|
|
@ -129,7 +129,7 @@ static void PrintInfo(PRFileInfo64 *info, const char *filename)
|
|||
output, " creation: %s,\n modify: %s\n", ctime, mtime);
|
||||
} /* PrintInfo */
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRStatus rv;
|
||||
char *buffer;
|
||||
|
@ -183,8 +183,13 @@ PRIntn main(PRIntn argc, char **argv)
|
|||
if (0 == filesize) filesize = DEFAULT_FILESIZE;
|
||||
if (NULL == filename)
|
||||
{
|
||||
#ifdef SYMBIAN
|
||||
#define FILE_NAME "c:\\data\\bigfile.dat"
|
||||
#else
|
||||
#define FILE_NAME "bigfile.dat"
|
||||
#endif
|
||||
if (DEFAULT_FILESIZE != filesize) return Usage();
|
||||
else filename = "bigfile.dat";
|
||||
else filename = FILE_NAME;
|
||||
}
|
||||
|
||||
if (PR_FAILURE == DeleteIfFound(filename)) return 1;
|
||||
|
|
|
@ -45,6 +45,11 @@
|
|||
#endif
|
||||
|
||||
#define TEST_FILE_NAME "bigfile2.txt"
|
||||
#ifdef WINCE
|
||||
#define TEST_FILE_NAME_FOR_CREATEFILE L"bigfile2.txt"
|
||||
#else
|
||||
#define TEST_FILE_NAME_FOR_CREATEFILE TEST_FILE_NAME
|
||||
#endif
|
||||
|
||||
#define MESSAGE "Hello world!"
|
||||
#define MESSAGE_SIZE 13
|
||||
|
@ -89,7 +94,7 @@ int main(int argc, char **argv)
|
|||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
#ifdef _WIN32
|
||||
hFile = CreateFile(TEST_FILE_NAME, GENERIC_READ, 0, NULL,
|
||||
hFile = CreateFile(TEST_FILE_NAME_FOR_CREATEFILE, GENERIC_READ, 0, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
fprintf(stderr, "CreateFile failed\n");
|
||||
|
|
|
@ -45,6 +45,11 @@
|
|||
#endif
|
||||
|
||||
#define TEST_FILE_NAME "bigfile3.txt"
|
||||
#ifdef WINCE
|
||||
#define TEST_FILE_NAME_FOR_CREATEFILE L"bigfile3.txt"
|
||||
#else
|
||||
#define TEST_FILE_NAME_FOR_CREATEFILE TEST_FILE_NAME
|
||||
#endif
|
||||
|
||||
#define MESSAGE "Hello world!"
|
||||
#define MESSAGE_SIZE 13
|
||||
|
@ -64,7 +69,7 @@ int main(int argc, char **argv)
|
|||
LL_SHL(offset, offset, 32);
|
||||
|
||||
#ifdef _WIN32
|
||||
hFile = CreateFile(TEST_FILE_NAME, GENERIC_WRITE, 0, NULL,
|
||||
hFile = CreateFile(TEST_FILE_NAME_FOR_CREATEFILE, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
fprintf(stderr, "CreateFile failed\n");
|
||||
|
|
|
@ -246,7 +246,7 @@ static void padStack (int argc, char** argv)
|
|||
pseudoMain (argc, argv, pad);
|
||||
}
|
||||
|
||||
void main (int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
|
||||
PR_STDIO_INIT();
|
||||
|
|
|
@ -64,7 +64,7 @@ static void Help(void)
|
|||
PR_fprintf(err, "\t-h This message and nothing else\n");
|
||||
} /* Help */
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PLOptStatus os;
|
||||
PRBool cleanup = PR_FALSE;
|
||||
|
|
|
@ -921,7 +921,7 @@ static Verbosity IncrementVerbosity(void)
|
|||
return (Verbosity)verboge;
|
||||
} /* IncrementVerbosity */
|
||||
|
||||
PRIntn main(PRIntn argc, char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
PRUintn index;
|
||||
PRBool boolean;
|
||||
|
|
|
@ -184,7 +184,7 @@ PRIntn PR_CALLBACK Concur(PRIntn argc, char **argv)
|
|||
return 0;
|
||||
} /* Concur */
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PR_STDIO_INIT();
|
||||
return PR_Initialize(Concur, argc, argv, 0);
|
||||
|
|
|
@ -324,7 +324,7 @@ static PRIntn PR_CALLBACK RealMain(int argc, char **argv)
|
|||
}
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
|
@ -998,7 +998,7 @@ default_threads, default_threads*2, default_threads*3, default_threads*4);
|
|||
return 0;
|
||||
}
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
|
@ -235,12 +235,7 @@ test
|
|||
return;
|
||||
}
|
||||
|
||||
int
|
||||
main
|
||||
(
|
||||
int argc,
|
||||
char *argv[]
|
||||
)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int okay = 0;
|
||||
int multithread = 0;
|
||||
|
|
|
@ -117,12 +117,7 @@ r2
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
main
|
||||
(
|
||||
int argc,
|
||||
char *argv[]
|
||||
)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
/* main test */
|
||||
|
|
|
@ -54,15 +54,15 @@
|
|||
** Includes
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
#if defined(_PR_DCETHREADS)
|
||||
|
||||
#include "prlog.h"
|
||||
#include "prinit.h"
|
||||
#include "prpdce.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(_PR_DCETHREADS)
|
||||
|
||||
PRIntn failed_already=0;
|
||||
PRIntn debug_mode=0;
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
static int failed_already = 0;
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
double num;
|
||||
double num1;
|
||||
|
|
|
@ -67,7 +67,7 @@ static char * NewBuffer( size_t size )
|
|||
return(buf);
|
||||
} /* end NewBuffer() */
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *value;
|
||||
PRStatus rc;
|
||||
|
|
|
@ -130,8 +130,7 @@ struct errinfo errcodes[] = {
|
|||
{PR_HOST_UNREACHABLE_ERROR, "PR_HOST_UNREACHABLE_ERROR"}
|
||||
};
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
int count, errnum;
|
||||
|
|
|
@ -138,8 +138,7 @@ struct errinfo errcodes[] = {
|
|||
{PR_HOST_UNREACHABLE_ERROR, "PR_HOST_UNREACHABLE_ERROR"}
|
||||
};
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
int count, errnum;
|
||||
|
|
|
@ -127,7 +127,7 @@ static PRIntn PR_CALLBACK RealMain(PRIntn argc, char **argv)
|
|||
}
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ static PRUintn __stdcall windows_start(void *arg)
|
|||
} /* windows_start */
|
||||
#endif /* defined(WIN32) */
|
||||
|
||||
static PRStatus CreateThread(StartFn start, void *arg)
|
||||
static PRStatus NSPRPUB_TESTS_CreateThread(StartFn start, void *arg)
|
||||
{
|
||||
PRStatus rv;
|
||||
|
||||
|
@ -218,7 +218,7 @@ static PRStatus CreateThread(StartFn start, void *arg)
|
|||
rv = PR_FAILURE;
|
||||
}
|
||||
return rv;
|
||||
} /* CreateThread */
|
||||
} /* NSPRPUB_TESTS_CreateThread */
|
||||
|
||||
static void PR_CALLBACK lazyEntry(void *arg)
|
||||
{
|
||||
|
@ -281,7 +281,12 @@ static void OneShot(void *arg)
|
|||
break;
|
||||
|
||||
case 6:
|
||||
dir = PR_OpenDir("/tmp/");
|
||||
#ifdef SYMBIAN
|
||||
#define TEMP_DIR "c:\\data\\"
|
||||
#else
|
||||
#define TEMP_DIR "/tmp/"
|
||||
#endif
|
||||
dir = PR_OpenDir(TEMP_DIR);
|
||||
DPRINTF((output,"Thread[0x%x] called PR_OpenDir\n",
|
||||
PR_GetCurrentThread()));
|
||||
PR_CloseDir(dir);
|
||||
|
@ -325,7 +330,7 @@ static void OneShot(void *arg)
|
|||
}
|
||||
} /* OneShot */
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRStatus rv;
|
||||
PRInt32 thread_cnt = DEFAULT_THREAD_COUNT;
|
||||
|
@ -366,7 +371,7 @@ PRIntn main(PRIntn argc, char **argv)
|
|||
|
||||
while (thread_cnt-- > 0)
|
||||
{
|
||||
rv = CreateThread(OneShot, (void*)thread_cnt);
|
||||
rv = NSPRPUB_TESTS_CreateThread(OneShot, (void*)thread_cnt);
|
||||
PR_ASSERT(PR_SUCCESS == rv);
|
||||
PR_Sleep(PR_MillisecondsToInterval(5));
|
||||
}
|
||||
|
|
|
@ -273,10 +273,7 @@ pid_t PR_UnixFork1(void)
|
|||
|
||||
#endif /* PR_DCETHREADS */
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char *argv[]
|
||||
)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
pid_t pid;
|
||||
int rv;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char buffer[256];
|
||||
char small_buffer[8];
|
||||
|
|
|
@ -53,7 +53,7 @@ static void Fail(void)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
int main()
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int foo = 1;
|
||||
char *ptr = NULL;
|
||||
|
|
|
@ -55,7 +55,7 @@ static void Help(void)
|
|||
PR_fprintf(err, "\t-h This message and nothing else\n");
|
||||
} /* Help */
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRStatus rv;
|
||||
PLOptStatus os;
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRAddrInfo *ai;
|
||||
void *iter;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include "prnetdb.h"
|
||||
#include "prerror.h"
|
||||
|
||||
int main()
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRFileDesc *prstderr = PR_GetSpecialFD(PR_StandardError);
|
||||
PRBool failed = PR_FALSE;
|
||||
|
|
|
@ -121,7 +121,7 @@ static PRIntn PR_CALLBACK RealMain(PRIntn argc, char **argv)
|
|||
} /* main */
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ void ThreadFunc(void *arg)
|
|||
PR_Unlock(lock1);
|
||||
}
|
||||
|
||||
int main()
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRThread *thread;
|
||||
PRIntervalTime start, end;
|
||||
|
|
|
@ -231,7 +231,7 @@ static PRIntn PR_CALLBACK RealMain(int argc, char** argv)
|
|||
}
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
|
@ -432,7 +432,7 @@ static void OrderedLockTest( void )
|
|||
} /* end OrderedLockTest() */
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if defined(DEBUG) || defined(FORCE_NSPR_TRACE)
|
||||
PRUint32 counter;
|
||||
|
|
|
@ -146,7 +146,7 @@ static void Test(PRThreadScope scope1, PRThreadScope scope2)
|
|||
}
|
||||
}
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PR_STDIO_INIT();
|
||||
lock = PR_NewLock();
|
||||
|
|
|
@ -335,7 +335,7 @@ void PR_CALLBACK Intrupt(void *arg)
|
|||
PR_DestroyLock(ml);
|
||||
} /* Intrupt */
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRThread *intrupt;
|
||||
PLOptStatus os;
|
||||
|
|
|
@ -109,7 +109,7 @@ static PRStatus PrintAddress(const PRNetAddr* address)
|
|||
return rv;
|
||||
} /* PrintAddress */
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRStatus rv;
|
||||
PLOptStatus os;
|
||||
|
|
|
@ -254,7 +254,7 @@ static PRIntn PR_CALLBACK RealMain(int argc, char **argv)
|
|||
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char *argv[])
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ static PRIntn PR_CALLBACK RealMain( PRIntn argc, char **argv )
|
|||
|
||||
}
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ static PRIntn PR_CALLBACK RealMain( PRIntn argc, char **argv )
|
|||
}
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ static PRIntn PR_CALLBACK RealMain( PRIntn argc, char **argv )
|
|||
}
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ static PRIntn PR_CALLBACK RealMain( PRIntn argc, char **argv )
|
|||
}
|
||||
|
||||
|
||||
PRIntn main(PRIntn argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PRIntn rv;
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче