[OS/2] Bug 330720: remove support for the obsolete OS/2-VACPP from NSPR and use XP_OS2 instead of XP_OS2_EMX everywhere, p=mkaply/me, r=julien.pierre

This commit is contained in:
mozilla%weilbacher.org 2008-05-02 08:18:15 +00:00
Родитель cd93496238
Коммит 2065a27442
45 изменённых файлов: 105 добавлений и 642 удалений

Просмотреть файл

@ -102,16 +102,8 @@ ifeq ($(OS_ARCH), HP-UX)
endif
endif
ifeq ($(MOZ_OS2_TOOLS),EMX)
ifeq ($(OS_ARCH), OS2)
XCFLAGS = $(OS_CFLAGS)
ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
XLDOPTS = -Zlinker /PM:VIO
endif
endif
ifeq ($(MOZ_OS2_TOOLS),PGCC)
XCFLAGS = $(OS_CFLAGS)
XLDOPTS = -Zlinker /PM:VIO
endif
include $(topsrcdir)/config/rules.mk
@ -149,11 +141,7 @@ endif
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(LD) $(EXEFLAGS) $<
else
$(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@
endif
install:: nspr.m4
$(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal

Просмотреть файл

@ -40,12 +40,10 @@
#if defined(VMS)
#include <sys/timeb.h>
#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
#elif defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
#include <sys/time.h>
#elif defined(WIN32)
#include <windows.h>
#elif defined(XP_OS2_VACPP)
#include <sys/timeb.h>
#else
#error "Architecture not supported"
#endif
@ -72,7 +70,7 @@ int main(int argc, char **argv)
now *= 1000000;
now += (1000 * b.millitm);
fprintf(stdout, "%Ld", now);
#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
#elif defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
long long now;
struct timeval tv;
#ifdef HAVE_SVID_GETTOD
@ -106,32 +104,6 @@ int main(int argc, char **argv)
fprintf(stdout, "%I64d", now);
#endif
#elif defined(XP_OS2_VACPP)
/* no long long or i64 so we use a string */
#include <string.h>
char buf[24];
char tbuf[7];
time_t now;
long mtime;
int i;
struct timeb b;
ftime(&b);
now = b.time;
_ltoa(now, buf, 10);
mtime = b.millitm * 1000;
if (mtime == 0){
++now;
strcat(buf, "000000");
} else {
_ltoa(mtime, tbuf, 10);
for (i = strlen(tbuf); i < 6; ++i)
strcat(buf, "0");
strcat(buf, tbuf);
}
fprintf(stdout, "%s", buf);
#else
#error "Architecture not supported"
#endif

Просмотреть файл

@ -164,10 +164,6 @@ OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \
$(addprefix $(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX)))
endif
ifeq ($(MOZ_OS2_TOOLS),VACPP)
EXTRA_LIBS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(EXTRA_LIBS))
endif
ALL_TRASH = $(TARGETS) $(OBJS) $(RES) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
$(NOSUCHFILE) \
so_locations
@ -306,11 +302,7 @@ ifdef MT
fi
endif # MSVC with manifest tool
else # WINNT && !GCC
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CC) $(OBJS) -Fe$@ $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
else
$(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS)
endif
endif # WINNT && !GCC
ifdef ENABLE_STRIP
$(STRIP) $@
@ -319,11 +311,7 @@ endif
$(LIBRARY): $(OBJS)
@$(MAKE_OBJDIR)
rm -f $@
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(AR) $(subst /,\\,$(OBJS)) $(AR_FLAGS)
else
$(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
endif
$(RANLIB) $@
ifeq ($(OS_TARGET), OS2)
@ -353,9 +341,6 @@ ifdef MT
fi
endif # MSVC with manifest tool
else # WINNT && !GCC
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(MAPFILE)
else # !os2 vacpp
ifeq ($(OS_TARGET), OpenVMS)
@if test ! -f $(VMS_SYMVEC_FILE); then \
if test -f $(VMS_SYMVEC_FILE_MODULE); then \
@ -365,7 +350,6 @@ ifeq ($(OS_TARGET), OpenVMS)
fi
endif # OpenVMS
$(MKSHLIB) $(OBJS) $(RES) $(EXTRA_LIBS)
endif # OS2 vacpp
endif # WINNT && !GCC
endif # AIX 4.1
ifdef ENABLE_STRIP
@ -396,16 +380,11 @@ ifeq ($(OS_ARCH),OS2)
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
echo EXPORTS >> $@
ifeq ($(MOZ_OS2_TOOLS),VACPP)
grep -v ';+' $< | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' >> $@
else
grep -v ';+' $< | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \
awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@
$(ADD_TO_DEF_FILE)
endif
endif
#
# Translate source filenames to absolute paths. This is required for
@ -430,16 +409,12 @@ $(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CCC) -o $@ -c $(CCCFLAGS) $(call abspath,$<)
else
$(CCC) -o $@ -c $(CCCFLAGS) $<
endif
endif
endif
WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
@ -449,28 +424,18 @@ $(OBJDIR)/%.$(OBJ_SUFFIX): %.c
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
else
$(CC) -o $@ -c $(CFLAGS) $<
endif
endif
endif
$(OBJDIR)/%.$(OBJ_SUFFIX): %.s
@$(MAKE_OBJDIR)
$(AS) -o $@ $(ASFLAGS) -c $<
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(OBJDIR)/%.$(OBJ_SUFFIX): %.asm
@$(MAKE_OBJDIR)
$(AS) -Fdo:./$(OBJDIR) $(ASFLAGS) $<
endif
%.i: %.c
$(CC) -C -E $(CFLAGS) $< > $*.i

141
nsprpub/configure поставляемый
Просмотреть файл

@ -4978,92 +4978,37 @@ EOF
MDCPUCFG_H=_os2.cfg
RESOLVE_LINK_SYMBOLS=1
# EMX/GCC build
if test -n "$GNU_CC"; then
cat >> confdefs.h <<\EOF
#define XP_OS2_EMX 1
EOF
cat >> confdefs.h <<\EOF
cat >> confdefs.h <<\EOF
#define OS2 1
EOF
AR=emxomfar
AR_FLAGS='r $@'
CFLAGS="$CFLAGS -Wall -Zomf"
CXXFLAGS="$CFLAGS -Wall -Zomf"
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=
DSO_LDOPTS='-Zomf -Zdll -Zmap'
LDFLAGS='-Zmap'
_OPTIMIZE_FLAGS="-O2 -s"
_DEBUG_FLAGS="-g -fno-inline"
if test -n "$MOZ_OPTIMIZE"; then
DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
fi
OS_LIBS="-lsocket"
IMPLIB='emximp -o'
FILTER='emxexp -o'
if test -n "$MOZ_OS2_HIGH_MEMORY"; then
DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
LDFLAGS="$LDFLAGS -Zhigh-mem"
cat >> confdefs.h <<\EOF
AR=emxomfar
AR_FLAGS='r $@'
CFLAGS="$CFLAGS -Wall -Zomf"
CXXFLAGS="$CFLAGS -Wall -Zomf"
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=
DSO_LDOPTS='-Zomf -Zdll -Zmap'
LDFLAGS='-Zmap'
_OPTIMIZE_FLAGS="-O2 -s"
_DEBUG_FLAGS="-g -fno-inline"
if test -n "$MOZ_OPTIMIZE"; then
DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
fi
OS_LIBS="-lsocket"
IMPLIB='emximp -o'
FILTER='emxexp -o'
if test -n "$MOZ_OS2_HIGH_MEMORY"; then
DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
LDFLAGS="$LDFLAGS -Zhigh-mem"
cat >> confdefs.h <<\EOF
#define MOZ_OS2_HIGH_MEMORY 1
EOF
fi
# GCC for OS/2 currently predefines these, but we don't want them
DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
# Visual Age C++ build
elif test "$VACPP" = "yes"; then
cat >> confdefs.h <<\EOF
#define XP_OS2_VACPP 1
EOF
cat >> confdefs.h <<\EOF
#define OS2 4
EOF
cat >> confdefs.h <<\EOF
#define _X86_ 1
EOF
OBJ_SUFFIX=obj
AS=alp
ASFLAGS='-Mb'
ASM_SUFFIX=asm
AR=-ilib
AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
HOST_CFLAGS="$CFLAGS"
OS_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
OS_EXE_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
CXXFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
OS_LIBS='so32dll.lib tcp32dll.lib'
LD='-ilink'
MKSHLIB='$(LD) $(DSO_LDOPTS)'
IMPLIB='implib -nologo -noignorecase'
FILTER='cppfilt -q -B -P'
_OPTIMIZE_FLAGS='/O+ /Gl+ /qtune=pentium /qarch=pentium'
_DEBUG_FLAGS='/Ti+ '
LDFLAGS='/NOL /M /L'
DLLFLAGS="$DLLFLAGS /O:\$@ /DLL /INC:_dllentry /MAP:\$(@:.dll=.map) /L /NOL"
EXEFLAGS='/OUT:$@ /PMTYPE:VIO /MAP:$(@:.exe=.map) /L /NOL'
if test -n "$MOZ_DEBUG"; then
LDFLAGS="$LDFLAGS /DE"
DLLFLAGS="$DLLFLAGS /DE"
EXEFLAGS="$EXEFLAGS /DE"
fi
if test -n "$MOZ_OPTIMIZE"; then
LDFLAGS="$LDFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
DLLFLAGS="$DLLFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
EXEFLAGS="$EXEFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
fi
LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
fi
# GCC for OS/2 currently predefines these, but we don't want them
DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
;;
*)
@ -5084,7 +5029,7 @@ case $target in
;;
*)
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:5088: checking for dlopen in -ldl" >&5
echo "configure:5033: 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
@ -5092,7 +5037,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5096 "configure"
#line 5041 "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
@ -5103,7 +5048,7 @@ int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:5107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5052: \"$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
@ -5120,17 +5065,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:5124: checking for dlfcn.h" >&5
echo "configure:5069: 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 5129 "configure"
#line 5074 "configure"
#include "confdefs.h"
#include <dlfcn.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:5079: \"$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*
@ -5163,13 +5108,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:5167: checking whether ${CC-cc} needs -traditional" >&5
echo "configure:5112: 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 5173 "configure"
#line 5118 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@ -5187,7 +5132,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
#line 5191 "configure"
#line 5136 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@ -5211,12 +5156,12 @@ fi
for ac_func in lchown strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5215: checking for $ac_func" >&5
echo "configure:5160: 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 5220 "configure"
#line 5165 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -5239,7 +5184,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:5243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5188: \"$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
@ -5280,7 +5225,7 @@ hpux*)
if test -z "$GNU_CC"; then
echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
echo "configure:5284: checking for +Olit support" >&5
echo "configure:5229: 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
@ -5319,7 +5264,7 @@ darwin*)
*)
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
echo "configure:5323: checking for pthread_create in -lpthreads" >&5
echo "configure:5268: checking for pthread_create in -lpthreads" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@ -5341,7 +5286,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:5345: checking for pthread_create in -lpthread" >&5
echo "configure:5290: checking for pthread_create in -lpthread" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@ -5363,7 +5308,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
echo "configure:5367: checking for pthread_create in -lc_r" >&5
echo "configure:5312: checking for pthread_create in -lc_r" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@ -5385,7 +5330,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
echo "configure:5389: checking for pthread_create in -lc" >&5
echo "configure:5334: checking for pthread_create in -lc" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@ -5530,7 +5475,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:5534: checking whether ${CC-cc} accepts -pthread" >&5
echo "configure:5479: 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
@ -5553,7 +5498,7 @@ echo "configure:5534: 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:5557: checking whether ${CC-cc} accepts -pthreads" >&5
echo "configure:5502: 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

Просмотреть файл

@ -2138,74 +2138,31 @@ mips-sony-newsos*)
MDCPUCFG_H=_os2.cfg
RESOLVE_LINK_SYMBOLS=1
# EMX/GCC build
if test -n "$GNU_CC"; then
AC_DEFINE(XP_OS2_EMX)
AC_DEFINE(OS2)
AR=emxomfar
AR_FLAGS='r $@'
CFLAGS="$CFLAGS -Wall -Zomf"
CXXFLAGS="$CFLAGS -Wall -Zomf"
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=
DSO_LDOPTS='-Zomf -Zdll -Zmap'
LDFLAGS='-Zmap'
_OPTIMIZE_FLAGS="-O2 -s"
_DEBUG_FLAGS="-g -fno-inline"
if test -n "$MOZ_OPTIMIZE"; then
DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
fi
OS_LIBS="-lsocket"
IMPLIB='emximp -o'
FILTER='emxexp -o'
if test -n "$MOZ_OS2_HIGH_MEMORY"; then
DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
LDFLAGS="$LDFLAGS -Zhigh-mem"
AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
fi
# GCC for OS/2 currently predefines these, but we don't want them
DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
# Visual Age C++ build
elif test "$VACPP" = "yes"; then
AC_DEFINE(XP_OS2_VACPP)
AC_DEFINE(OS2,4)
AC_DEFINE(_X86_)
OBJ_SUFFIX=obj
AS=alp
ASFLAGS='-Mb'
ASM_SUFFIX=asm
AR=-ilib
AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
HOST_CFLAGS="$CFLAGS"
OS_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
OS_EXE_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
CXXFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
OS_LIBS='so32dll.lib tcp32dll.lib'
LD='-ilink'
MKSHLIB='$(LD) $(DSO_LDOPTS)'
IMPLIB='implib -nologo -noignorecase'
FILTER='cppfilt -q -B -P'
_OPTIMIZE_FLAGS='/O+ /Gl+ /qtune=pentium /qarch=pentium'
_DEBUG_FLAGS='/Ti+ '
LDFLAGS='/NOL /M /L'
DLLFLAGS="$DLLFLAGS /O:\$@ /DLL /INC:_dllentry /MAP:\$(@:.dll=.map) /L /NOL"
EXEFLAGS='/OUT:$@ /PMTYPE:VIO /MAP:$(@:.exe=.map) /L /NOL'
if test -n "$MOZ_DEBUG"; then
LDFLAGS="$LDFLAGS /DE"
DLLFLAGS="$DLLFLAGS /DE"
EXEFLAGS="$EXEFLAGS /DE"
fi
if test -n "$MOZ_OPTIMIZE"; then
LDFLAGS="$LDFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
DLLFLAGS="$DLLFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
EXEFLAGS="$EXEFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
fi
LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
AC_DEFINE(OS2)
AR=emxomfar
AR_FLAGS='r $@'
CFLAGS="$CFLAGS -Wall -Zomf"
CXXFLAGS="$CFLAGS -Wall -Zomf"
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=
DSO_LDOPTS='-Zomf -Zdll -Zmap'
LDFLAGS='-Zmap'
_OPTIMIZE_FLAGS="-O2 -s"
_DEBUG_FLAGS="-g -fno-inline"
if test -n "$MOZ_OPTIMIZE"; then
DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
fi
OS_LIBS="-lsocket"
IMPLIB='emximp -o'
FILTER='emxexp -o'
if test -n "$MOZ_OS2_HIGH_MEMORY"; then
DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
LDFLAGS="$LDFLAGS -Zhigh-mem"
AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
fi
# GCC for OS/2 currently predefines these, but we don't want them
DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
;;
*)

Просмотреть файл

@ -161,13 +161,9 @@ $(TINC):
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
ifeq ($(MOZ_OS2_TOOLS), VACPP)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
endif
endif
#
# Version information generation (end)
#

Просмотреть файл

@ -52,15 +52,8 @@ typedef PRUint32 PLHashNumber;
typedef PLHashNumber (PR_CALLBACK *PLHashFunction)(const void *key);
typedef PRIntn (PR_CALLBACK *PLHashComparator)(const void *v1, const void *v2);
#if defined(XP_OS2_VACPP) && defined(VACPP_FLIP) /* for nsSpaceManager.cpp */
PR_END_EXTERN_C /* and nsHTMLDocument.cpp */
#endif
typedef PRIntn (PR_CALLBACK *PLHashEnumerator)(PLHashEntry *he, PRIntn i, void *arg);
#if defined(XP_OS2_VACPP) && defined(VACPP_FLIP)
PR_BEGIN_EXTERN_C
#endif
/* Flag bits in PLHashEnumerator's return value */
#define HT_ENUMERATE_NEXT 0 /* continue enumerating entries */
#define HT_ENUMERATE_STOP 1 /* stop enumerating entries */

Просмотреть файл

@ -164,13 +164,9 @@ $(TINC):
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
ifeq ($(MOZ_OS2_TOOLS), VACPP)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
endif
endif
#
# Version information generation (end)
#

Просмотреть файл

@ -92,15 +92,8 @@ endif
endif
ifeq ($(OS_ARCH),OS2)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
LIBPR = $(dist_libdir)/nspr$(NSPR_VERSION).lib
LIBPLC = $(dist_libdir)/plc$(NSPR_VERSION).lib
LIBGC= $(dist_libdir)/msgc$(GC_VERSION).lib
else
LDOPTS += -Zomf -Zlinker /PM:VIO
endif
endif
ifneq ($(OS_ARCH), WINNT)
PWD = $(shell pwd)

Просмотреть файл

@ -93,9 +93,7 @@ ifeq ($(OS_ARCH), WINNT)
OS_LIBS = user32.lib
else
ifeq ($(OS_ARCH),OS2)
ifneq ($(MOZ_OS2_TOOLS),VACPP)
OS_LIBS = -lstdcpp
endif
OS_LIBS = -lstdcpp
else
ifeq ($(OS_ARCH), AIX)
ifeq ($(OS_RELEASE), 4.1)
@ -182,13 +180,9 @@ $(TINC):
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
ifeq ($(OS_ARCH), WINNT)
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
else
ifeq ($(MOZ_OS2_TOOLS), VACPP)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
endif
endif
#
# Version information generation (end)
#

Просмотреть файл

@ -91,13 +91,7 @@ endif
endif
ifeq ($(OS_ARCH),OS2)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO /S:32768
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
LIBPRSTRMS = $(dist_libdir)/prstrms$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
else
LDOPTS += -Zomf -Zlinker /PM:VIO -lstdcpp
endif
LDOPTS += -Zomf -Zlinker /PM:VIO -lstdcpp
endif
ifneq ($(OS_ARCH), WINNT)

Просмотреть файл

@ -40,7 +40,7 @@
#include "prio.h"
#include <string.h>
#include <stdio.h>
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
#include <sys/types.h>
#include <sys/stat.h>
#endif
@ -55,9 +55,6 @@ typedef struct threadarg {
} threadarg;
void
#ifdef XP_OS2_VACPP
_Optlink
#endif
threadmain(void *mytag)
{
threadarg arg;

Просмотреть файл

@ -99,14 +99,7 @@ endif
endif
ifeq ($(OS_ARCH),OS2)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO /S:32768
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
LIBPLC = $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
else
LDOPTS += -Zomf -Zlinker /PM:VIO
endif
LDOPTS += -Zomf -Zlinker /PM:VIO
endif
ifneq ($(OS_ARCH), WINNT)

Просмотреть файл

@ -53,34 +53,6 @@
#include <errno.h>
#ifdef XP_OS2_VACPP
/* TODO RAMSEMs need to be written for GCC/EMX */
#define USE_RAMSEM
#endif
#ifdef USE_RAMSEM
#pragma pack(4)
#pragma pack(2)
typedef struct _RAMSEM
{
ULONG ulTIDPID;
ULONG hevSem;
ULONG cLocks;
USHORT cWaiting;
USHORT cPosts;
} RAMSEM, *PRAMSEM;
typedef struct _CRITICAL_SECTION
{
ULONG ulReserved[4]; /* Same size as RAMSEM */
} CRITICAL_SECTION, *PCRITICAL_SECTION, *LPCRITICAL_SECTION;
#pragma pack(4)
APIRET _Optlink SemRequest486(PRAMSEM, ULONG);
APIRET _Optlink SemReleasex86(PRAMSEM, ULONG);
#endif
/*
* Internal configuration macros
*/
@ -187,11 +159,7 @@ struct _MDNotified {
};
struct _MDLock {
#ifdef USE_RAMSEM
CRITICAL_SECTION mutex; /* this is recursive on NT */
#else
HMTX mutex; /* this is recursive on NT */
#endif
/*
* When notifying cvars, there is no point in actually
@ -252,10 +220,6 @@ extern PRInt32 _MD_CloseFile(PRInt32 osfd);
/* --- Socket IO stuff --- */
/* The ones that don't map directly may need to be re-visited... */
#ifdef XP_OS2_VACPP
#define EPIPE EBADF
#define EIO ECONNREFUSED
#endif
#define _MD_EACCES EACCES
#define _MD_EADDRINUSE EADDRINUSE
#define _MD_EADDRNOTAVAIL EADDRNOTAVAIL
@ -292,11 +256,7 @@ extern PRInt32 _MD_CloseSocket(PRInt32 osfd);
#define _MD_CLOSE_SOCKET _MD_CloseSocket
#define _MD_SENDTO (_PR_MD_SENDTO)
#define _MD_RECVFROM (_PR_MD_RECVFROM)
#ifdef XP_OS2_VACPP
#define _MD_SOCKETPAIR(s, type, proto, sv) -1
#else
#define _MD_SOCKETPAIR (_PR_MD_SOCKETPAIR)
#endif
#define _MD_GETSOCKNAME (_PR_MD_GETSOCKNAME)
#define _MD_GETPEERNAME (_PR_MD_GETPEERNAME)
#define _MD_GETSOCKOPT (_PR_MD_GETSOCKOPT)
@ -376,26 +336,11 @@ extern PRInt32 _MD_Accept(PRFileDesc *fd, PRNetAddr *raddr, PRUint32 *rlen,
#define _PR_LOCK _MD_LOCK
#define _PR_UNLOCK _MD_UNLOCK
#ifdef USE_RAMSEM
#define _MD_NEW_LOCK (_PR_MD_NEW_LOCK)
#define _MD_FREE_LOCK(lock) (DosCloseEventSem(((PRAMSEM)(&((lock)->mutex)))->hevSem))
#define _MD_LOCK(lock) (SemRequest486(&((lock)->mutex), -1))
#define _MD_TEST_AND_LOCK(lock) (SemRequest486(&((lock)->mutex), -1),0)
#define _MD_UNLOCK(lock) \
PR_BEGIN_MACRO \
if (0 != (lock)->notified.length) { \
md_UnlockAndPostNotifies((lock), NULL, NULL); \
} else { \
SemReleasex86( &(lock)->mutex, 0 ); \
} \
PR_END_MACRO
#else
#define _MD_NEW_LOCK (_PR_MD_NEW_LOCK)
#define _MD_FREE_LOCK(lock) (DosCloseMutexSem((lock)->mutex))
#define _MD_LOCK(lock) (DosRequestMutexSem((lock)->mutex, SEM_INDEFINITE_WAIT))
#define _MD_TEST_AND_LOCK(lock) (DosRequestMutexSem((lock)->mutex, SEM_INDEFINITE_WAIT),0)
#define _MD_UNLOCK (_PR_MD_UNLOCK)
#endif
/* --- lock and cv waiting --- */
#define _MD_WAIT (_PR_MD_WAIT)

Просмотреть файл

@ -130,10 +130,8 @@ NSPR_API(void) _MD_os2_map_listen_error(PRInt32 err);
NSPR_API(void) _MD_os2_map_shutdown_error(PRInt32 err);
#define _PR_MD_MAP_SHUTDOWN_ERROR _MD_os2_map_shutdown_error
#ifndef XP_OS2_VACPP
NSPR_API(void) _MD_os2_map_socketpair_error(int err);
#define _PR_MD_MAP_SOCKETPAIR_ERROR _MD_os2_map_socketpair_error
#endif
NSPR_API(void) _MD_os2_map_getsockname_error(PRInt32 err);
#define _PR_MD_MAP_GETSOCKNAME_ERROR _MD_os2_map_getsockname_error

Просмотреть файл

@ -56,7 +56,7 @@
** Routines for processing command line arguments
*/
PR_BEGIN_EXTERN_C
#ifndef XP_OS2_EMX
#ifndef XP_OS2
extern char *optarg;
extern int optind;
extern int getopt(int argc, char **argv, char *spec);
@ -69,7 +69,7 @@ PR_END_EXTERN_C
** These definitions are from:
** <dirent.h>
*/
#ifdef XP_OS2_EMX
#ifdef XP_OS2
#include <sys/types.h>
#endif
#include <sys/stat.h>

Просмотреть файл

@ -197,7 +197,7 @@ union PRNetAddr {
PRIPv6Addr ip; /* the actual 128 bits of address */
PRUint32 scope_id; /* set of interfaces for a scope */
} ipv6;
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
struct { /* Unix domain socket address */
PRUint16 family; /* address family (AF_UNIX) */
#ifdef XP_OS2

Просмотреть файл

@ -1398,7 +1398,7 @@ extern PRUintn _PR_NetAddrSize(const PRNetAddr* addr);
** struct sockaddr_in6.
*/
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
#define PR_NETADDR_SIZE(_addr) \
((_addr)->raw.family == PR_AF_INET \
? sizeof((_addr)->inet) \
@ -1414,7 +1414,7 @@ extern PRUintn _PR_NetAddrSize(const PRNetAddr* addr);
#else
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
#define PR_NETADDR_SIZE(_addr) \
((_addr)->raw.family == PR_AF_INET \
? sizeof((_addr)->inet) \

Просмотреть файл

@ -177,21 +177,6 @@
#define PR_CALLBACK_DECL
#define PR_STATIC_CALLBACK(__x) static __x
#elif defined(XP_OS2_VACPP)
#define PR_EXPORT(__type) extern __type
#define PR_EXPORT_DATA(__type) extern __type
#define PR_IMPORT(__type) extern __type
#define PR_IMPORT_DATA(__type) extern __type
#define PR_EXTERN(__type) extern __type
#define PR_IMPLEMENT(__type) __type
#define PR_EXTERN_DATA(__type) extern __type
#define PR_IMPLEMENT_DATA(__type) __type
#define PR_CALLBACK _Optlink
#define PR_CALLBACK_DECL
#define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
#else /* Unix */
/* GCC 3.3 and later support the visibility attribute. */

Просмотреть файл

@ -48,11 +48,6 @@ include $(topsrcdir)/config/config.mk
DIRS = io linking malloc md memory misc threads
# For VAC++ 4 geticcdata rule in config/OS2.mk
ifeq ($(MOZ_OS2_TOOLS),VACPP)
CSRCS = prvrsion.c
endif
ifeq ($(USE_PTHREADS), 1)
DIRS += pthreads
endif
@ -260,6 +255,7 @@ OBJS = \
misc/$(OBJDIR)/pripc.$(OBJ_SUFFIX) \
misc/$(OBJDIR)/prlog2.$(OBJ_SUFFIX) \
misc/$(OBJDIR)/prlong.$(OBJ_SUFFIX) \
malloc/$(OBJDIR)/prmalloc.$(OBJ_SUFFIX) \
misc/$(OBJDIR)/prnetdb.$(OBJ_SUFFIX) \
misc/$(OBJDIR)/prolock.$(OBJ_SUFFIX) \
misc/$(OBJDIR)/prrng.$(OBJ_SUFFIX) \
@ -269,11 +265,6 @@ OBJS = \
misc/$(OBJDIR)/prtrace.$(OBJ_SUFFIX) \
misc/$(OBJDIR)/prtime.$(OBJ_SUFFIX)
# ilib now rejects empty objects
ifneq ($(MOZ_OS2_TOOLS),VACPP)
OBJS += malloc/$(OBJDIR)/prmalloc.$(OBJ_SUFFIX)
endif
ifdef USE_PTHREADS
OBJS += \
pthreads/$(OBJDIR)/ptsynch.$(OBJ_SUFFIX) \
@ -384,13 +375,9 @@ $(TINC):
$(OBJDIR)/prvrsion.$(OBJ_SUFFIX): prvrsion.c $(TINC)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
ifeq ($(MOZ_OS2_TOOLS), VACPP)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
endif
endif
#
# Version information generation (end)
#

Просмотреть файл

@ -139,13 +139,7 @@ endif
endif
ifeq ($(OS_ARCH),OS2)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
LIBPLC = $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
else
LDOPTS += -Zomf -Zlinker /PM:VIO -lstdcpp
endif
LDOPTS += -Zomf -Zlinker /PM:VIO -lstdcpp
endif
ifneq ($(OS_ARCH), WINNT)

Просмотреть файл

@ -85,13 +85,5 @@ DEFINES += -D_NSPR_BUILD_
include $(topsrcdir)/config/rules.mk
# An OS/2 Optimization bug causes PR_snprintf() to produce wrong result.
# This suppresses optimization for this single compilation unit.
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(OBJDIR)/prprf.obj: prprf.c
@$(MAKE_OBJDIR)
$(CC) -Fo$@ -c $(filter-out /O+, $(CFLAGS)) $<
endif
export:: $(TARGETS)

Просмотреть файл

@ -44,9 +44,6 @@
* Copyright (c) International Business Machines Corporation, 2000.
* Modifications to Mozilla code or documentation identified per
* MPL Section 3.3
*
* Date Modified by Description of modification
* 04/10/2000 IBM Corp. Added DebugBreak() definitions for OS/2
*/
#include "primpl.h"
@ -544,23 +541,6 @@ PR_IMPLEMENT(void) PR_Abort(void)
abort();
}
#if defined(XP_OS2)
/*
* Added definitions for DebugBreak() for 2 different OS/2 compilers.
* Doing the int3 on purpose for Visual Age so that a developer can
* step over the instruction if so desired. Not always possible if
* trapping due to exception handling IBM-AKR
*/
#if defined(XP_OS2_VACPP)
#include <builtin.h>
static void DebugBreak(void) { _interrupt(3); }
#elif defined(XP_OS2_EMX)
static void DebugBreak(void) { asm("int $3"); }
#else
static void DebugBreak(void) { }
#endif
#endif /* XP_OS2 */
PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln)
{
PR_LogPrint("Assertion failure: %s, at %s:%d\n", s, file, ln);
@ -570,9 +550,12 @@ PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln)
#ifdef XP_MAC
dprintf("Assertion failure: %s, at %s:%d\n", s, file, ln);
#endif
#if defined(WIN32) || defined(XP_OS2)
#ifdef WIN32
DebugBreak();
#endif
#ifdef XP_OS2
asm("int $3");
#endif
#ifndef XP_MAC
abort();
#endif

Просмотреть файл

@ -47,7 +47,7 @@
PRBool IsValidNetAddr(const PRNetAddr *addr)
{
if ((addr != NULL)
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
&& (addr->raw.family != PR_AF_LOCAL)
#endif
&& (addr->raw.family != PR_AF_INET6)
@ -64,7 +64,7 @@ static PRBool IsValidNetAddrLen(const PRNetAddr *addr, PRInt32 addr_len)
* is not uniform, so we don't check it.
*/
if ((addr != NULL)
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
&& (addr->raw.family != AF_UNIX)
#endif
&& (PR_NETADDR_SIZE(addr) != addr_len)) {
@ -1293,7 +1293,7 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto)
if (!_pr_initialized) _PR_ImplicitInitialization();
if (PR_AF_INET != domain
&& PR_AF_INET6 != domain
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
&& PR_AF_LOCAL != domain
#endif
) {

Просмотреть файл

@ -62,13 +62,7 @@ CSRCS = \
$(NULL)
endif
ifeq ($(MOZ_OS2_TOOLS),VACPP)
ASFILES = os2vacpp.asm
endif
ifeq ($(MOZ_OS2_TOOLS),EMX)
ASFILES = os2emx.s os2vaclegacy.s
endif
TARGETS = $(OBJS)

Просмотреть файл

@ -52,13 +52,7 @@ CSRCS = \
os2rng.c \
$(NULL)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
ASFILES = os2vacpp.asm
endif
ifeq ($(MOZ_OS2_TOOLS),EMX)
ASFILES = os2emx.s os2vaclegacy.s
endif
OBJS += $(addprefix md/os2/$(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \
$(addprefix md/os2/$(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX)))

Просмотреть файл

@ -878,7 +878,6 @@ void _MD_os2_map_shutdown_error(PRInt32 err)
}
}
#ifndef XP_OS2_VACPP
void _MD_os2_map_socketpair_error(PRInt32 err)
{
switch (err) {
@ -902,7 +901,6 @@ void _MD_os2_map_socketpair_error(PRInt32 err)
return;
}
}
#endif
void _MD_os2_map_getsockname_error(PRInt32 err)
{

Просмотреть файл

@ -51,42 +51,6 @@
#include "primpl.h"
#ifdef USE_RAMSEM
ULONG _Far16 _Pascal Dos16GetInfoSeg(PSEL pselGlobal, PSEL pselLocal);
#ifdef XP_OS2_EMX
typedef unsigned short BOOL16;
#endif
typedef struct _LINFOSEG
{
USHORT pidCurrent;
USHORT pidParent;
USHORT prtyCurrent;
USHORT tidCurrent;
USHORT sgCurrent;
UCHAR rfProcStatus;
UCHAR dummy1;
BOOL16 fForeground;
UCHAR typProcess;
UCHAR dummy2;
SEL selEnvironment;
USHORT offCmdLine;
USHORT cbDataSegment;
USHORT cbStack;
USHORT cbHeap;
USHORT hmod;
SEL selDS;
SEL selPack;
SEL selPackShr;
SEL selPackPck;
ULONG ulReserved;
} LINFOSEG;
typedef LINFOSEG FAR *PLINFOSEG;
PLINFOSEG plisCurrent = NULL;
#endif
/*
* AddThreadToCVWaitQueueInternal --
*
@ -202,11 +166,7 @@ md_UnlockAndPostNotifies(
}
/* Release the lock before notifying */
#ifdef USE_RAMSEM
SemReleasex86(&lock->mutex, 0);
#else
DosReleaseMutexSem(lock->mutex);
#endif
DosReleaseMutexSem(lock->mutex);
notified = &post; /* this is where we start */
do {
@ -313,11 +273,7 @@ _PR_MD_WAIT_CV(_MDCVar *cv, _MDLock *lock, PRIntervalTime timeout )
md_UnlockAndPostNotifies(lock, thred, cv);
} else {
AddThreadToCVWaitQueueInternal(thred, cv);
#ifdef USE_RAMSEM
SemReleasex86( &lock->mutex, 0 );
#else
DosReleaseMutexSem(lock->mutex);
#endif
}
/* Wait for notification or timeout; don't really care which */
@ -326,11 +282,7 @@ _PR_MD_WAIT_CV(_MDCVar *cv, _MDLock *lock, PRIntervalTime timeout )
DosResetEventSem(thred->md.blocked_sema, &count);
}
#ifdef USE_RAMSEM
SemRequest486(&(lock->mutex), -1);
#else
DosRequestMutexSem((lock->mutex), SEM_INDEFINITE_WAIT);
#endif
PR_ASSERT(rv == NO_ERROR || rv == ERROR_TIMEOUT);
@ -387,41 +339,10 @@ _PR_MD_NOTIFY_CV(_MDCVar *cv, _MDLock *lock)
PRStatus
_PR_MD_NEW_LOCK(_MDLock *lock)
{
#ifdef USE_RAMSEM
// It's better if this API traps when pCriticalSect is not a valid
// pointer, because we can't return an error code and if we just return
// the API caller will have nasty bugs that are hard to find.
PRAMSEM pramsem = (PRAMSEM)(&(lock->mutex));
/* First time, set up addresses of processor specific functions
*/
if (plisCurrent == NULL)
{
SEL selGlobal = 0, selLocal = 0;
/* Convert 16 bit global information segment to 32 bit address
* by performing CRMA on the 16 bit address: "shift" operation
* to convert sel to flat, "and" operation to mask the address
* to 32-bit
*/
Dos16GetInfoSeg(&selGlobal, &selLocal);
plisCurrent = (PLINFOSEG)(((ULONG)selLocal << 13) &
(ULONG)0x1fff0000);
}
memset(pramsem, 0, sizeof(pramsem));
DosCreateEventSem(0, &pramsem->hevSem, DC_SEM_SHARED, 0);
lock->notified.length=0;
lock->notified.link=NULL;
return PR_SUCCESS;
#else
DosCreateMutexSem(0, &(lock->mutex), 0, 0);
(lock)->notified.length=0;
(lock)->notified.link=NULL;
return PR_SUCCESS;
#endif
}
void

Просмотреть файл

@ -35,26 +35,6 @@
*
* ***** END LICENSE BLOCK ***** */
/*
* This Original Code has been modified by IBM Corporation.
* Modifications made by IBM described herein are
* Copyright (c) International Business Machines
* Corporation, 2000
*
* Modifications to Mozilla code or documentation
* identified per MPL Section 3.3
*
* Date Modified by Description of modification
* 03/23/2000 IBM Corp. Changed write() to DosWrite(). EMX i/o
* calls cannot be intermixed with DosXXX
* calls since EMX remaps file/socket
* handles.
* 04/27/2000 IBM Corp. Changed open file to be more like NT and
* better handle PR_TRUNCATE | PR_CREATE_FILE
* and also fixed _PR_MD_SET_FD_INHERITABLE
*/
/* OS2 IO module
*
* Assumes synchronous I/O.
@ -65,14 +45,10 @@
#include "prio.h"
#include <ctype.h>
#include <string.h>
#ifdef XP_OS2_VACPP
#include <direct.h>
#else
#include <limits.h>
#include <dirent.h>
#include <fcntl.h>
#include <io.h>
#endif
struct _MDLock _pr_ioq_lock;

Просмотреть файл

@ -39,9 +39,7 @@
* This file implements _PR_MD_PR_POLL for OS/2.
*/
#ifdef XP_OS2_EMX
#include <sys/time.h> /* For timeval. */
#endif
#include <sys/time.h> /* For timeval. */
#include "primpl.h"

Просмотреть файл

@ -48,22 +48,12 @@
#include "primpl.h"
#ifdef XP_OS2_EMX
#include <sys/time.h> /* For timeval. */
#endif
#include <sys/time.h> /* For timeval. */
#define _PR_INTERRUPT_CHECK_INTERVAL_SECS 5
#define READ_FD 1
#define WRITE_FD 2
#ifdef XP_OS2_VACPP
#define _OS2_WRITEV writev
#define _OS2_IOCTL ioctl
#else
#define _OS2_WRITEV so_writev
#define _OS2_IOCTL so_ioctl
#endif
/* --- SOCKET IO --------------------------------------------------------- */
@ -105,7 +95,7 @@ _MD_SocketAvailable(PRFileDesc *fd)
{
PRInt32 result;
if (_OS2_IOCTL(fd->secret->md.osfd, FIONREAD, (char *) &result, sizeof(result)) < 0) {
if (so_ioctl(fd->secret->md.osfd, FIONREAD, (char *) &result, sizeof(result)) < 0) {
PR_SetError(PR_BAD_DESCRIPTOR_ERROR, sock_errno());
return -1;
}
@ -547,7 +537,7 @@ _PR_MD_WRITEV(PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size,
}
}
while ((rv = _OS2_WRITEV(osfd, (const struct iovec*)iov, iov_size)) == -1) {
while ((rv = so_writev(osfd, (const struct iovec*)iov, iov_size)) == -1) {
err = sock_errno();
if ((err == EWOULDBLOCK)) {
if (fd->secret->nonblocking) {
@ -592,7 +582,6 @@ _PR_MD_SHUTDOWN(PRFileDesc *fd, PRIntn how)
return rv;
}
#ifndef XP_OS2_VACPP
PRInt32
_PR_MD_SOCKETPAIR(int af, int type, int flags, PRInt32 *osfd)
{
@ -605,7 +594,6 @@ _PR_MD_SOCKETPAIR(int af, int type, int flags, PRInt32 *osfd)
}
return rv;
}
#endif
PRStatus
_PR_MD_GETSOCKNAME(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen)
@ -675,7 +663,7 @@ _MD_MakeNonblock(PRFileDesc *fd)
return;
}
err = _OS2_IOCTL( osfd, FIONBIO, (char *) &one, sizeof(one));
err = so_ioctl( osfd, FIONBIO, (char *) &one, sizeof(one));
if ( err != 0 )
{
err = sock_errno();

Просмотреть файл

@ -38,13 +38,7 @@
#include "primpl.h"
#include <process.h> /* for _beginthread() */
#ifdef XP_OS2_VACPP
#include <time.h> /* for _tzset() */
#endif
#ifdef XP_OS2_EMX
#include <signal.h>
#endif
#include <float.h>
@ -75,10 +69,6 @@ _PR_MD_EARLY_INIT()
if (DosLoadModule(NULL, 0, "DOSCALL1", &hmod) == 0)
DosQueryProcAddr(hmod, 877, "DOSQUERYTHREADCONTEXT",
(PFN *)&QueryThreadContext);
#ifdef XP_OS2_VACPP
_tzset();
#endif
}
static void
@ -223,18 +213,10 @@ _PR_MD_CREATE_THREAD(PRThread *thread,
PARAMSTORE* params = PR_Malloc(sizeof(PARAMSTORE));
params->start = start;
params->thread = thread;
#ifdef XP_OS2_VACPP /* No exception handler for VACPP */
thread->md.handle = thread->id = (TID) _beginthread(
(void(* _Optlink)(void*))start,
NULL,
thread->stack->stackSize,
thread);
#else
thread->md.handle = thread->id = (TID) _beginthread(ExcpStartFunc,
NULL,
thread->stack->stackSize,
params);
#endif
if(thread->md.handle == -1) {
return PR_FAILURE;
}

Просмотреть файл

Просмотреть файл

@ -700,11 +700,7 @@ PR_IMPLEMENT(PRStatus) PR_GetHostByName(
LOCK_DNS();
#ifdef XP_OS2_VACPP
h = GETHOSTBYNAME((char *)name);
#else
h = GETHOSTBYNAME(name);
#endif
if (NULL == h)
{
@ -933,11 +929,7 @@ PR_IMPLEMENT(PRStatus) PR_GetIPNodeByName(
}
#else /* _PR_INET6 */
LOCK_DNS();
#ifdef XP_OS2_VACPP
h = GETHOSTBYNAME((char *)name);
#else
h = GETHOSTBYNAME(name);
#endif
#endif /* _PR_INET6 */
if (NULL == h)
@ -1101,11 +1093,7 @@ PR_IMPLEMENT(PRStatus) PR_GetHostByAddr(
}
#else /* _PR_HAVE_GETIPNODEBYADDR */
LOCK_DNS();
#ifdef XP_OS2_VACPP
h = GETHOSTBYADDR((char *)addr, addrlen, af);
#else
h = GETHOSTBYADDR(addr, addrlen, af);
#endif
#endif /* _PR_HAVE_GETIPNODEBYADDR */
if (NULL == h)
{
@ -1185,11 +1173,7 @@ PR_IMPLEMENT(PRStatus) PR_GetHostByAddr(
static struct protoent *getprotobyname_r(const char* name)
{
#ifdef XP_OS2_VACPP
return getprotobyname((char *)name);
#else
return getprotobyname(name);
#endif
} /* getprotobyname_r */
static struct protoent *getprotobynumber_r(PRInt32 number)
@ -1380,7 +1364,7 @@ PRUintn _PR_NetAddrSize(const PRNetAddr* addr)
#else
addrsize = sizeof(addr->ipv6);
#endif
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
else if (AF_UNIX == addr->raw.family)
addrsize = sizeof(addr->local);
#endif
@ -2223,11 +2207,7 @@ static PRStatus pr_StringToNetAddrFB(const char *string, PRNetAddr *addr)
memset(&addr->ipv6.ip, 0, sizeof(addr->ipv6.ip));
addr->inet.family = AF_INET;
#ifdef XP_OS2_VACPP
addr->inet.ip = inet_addr((char *)string);
#else
addr->inet.ip = inet_addr(string);
#endif
if ((PRUint32) -1 == addr->inet.ip)
{
/*

Просмотреть файл

@ -571,7 +571,7 @@ static struct tm *MT_safe_localtime(const time_t *clock, struct tm *result)
* We have to manually check (WIN16 only) for negative value of
* clock and return NULL.
*
* With negative values of clock, emx returns the struct tm for
* With negative values of clock, OS/2 returns the struct tm for
* clock plus ULONG_MAX. So we also have to check for the invalid
* structs returned for timezones west of Greenwich when clock == 0.
*/
@ -582,7 +582,7 @@ static struct tm *MT_safe_localtime(const time_t *clock, struct tm *result)
tmPtr = localtime(clock);
#endif
#if defined(WIN16) || defined(XP_OS2_EMX)
#if defined(WIN16) || defined(XP_OS2)
if ( (PRInt32) *clock < 0 ||
( (PRInt32) *clock == 0 && tmPtr->tm_year != 70))
result = NULL;

Просмотреть файл

@ -236,13 +236,9 @@ endif # NS_USE_GCC
endif
ifeq ($(OS_ARCH),OS2)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
else
EXTRA_LIBS = $(OS_LIBS)
LDOPTS = -Zomf -Zlinker /PM:VIO -Zlinker /ST:0x64000
endif
endif
ifneq ($(OS_ARCH), WINNT)
# Use an absolute pathname as the runtime library path (for the -R
@ -493,12 +489,8 @@ ifdef MT
rm -f $@.manifest; \
fi
endif
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(LD) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(OS_LIBS) $(EXTRA_LIBS)
else
$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -o $@
endif # OS/2
endif # WINNT
endif # AIX_PRE_4_2

Просмотреть файл

@ -332,13 +332,8 @@ int main(int argc, char **argv)
#elif defined(OS2)
# ifdef __EMX__
threadID = (TID) _beginthread((void *)threadStartFunc, NULL,
32768, NULL);
# else
threadID = (TID) _beginthread((void(* _Optlink)(void*))threadStartFunc, NULL,
32768, NULL);
# endif
if (threadID == -1) {
fprintf(stderr, "thread creation failed: error code %d\n", errno);
failed_already=1;

Просмотреть файл

@ -39,10 +39,6 @@
#include <windows.h>
#endif
#ifdef XP_OS2_VACPP
#include <io.h> /* for close() */
#endif
#ifdef XP_UNIX
#include <unistd.h> /* for close() */
#endif

Просмотреть файл

@ -453,12 +453,12 @@ static void Measure(void (*func)(void), const char *msg)
int main(int argc, char **argv)
{
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
int opt;
PR_IMPORT_DATA(char *) optarg;
#endif
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
while ( (opt = getopt(argc, argv, "c:s:i:t:v")) != EOF) {
switch(opt) {
case 'i':

Просмотреть файл

@ -49,7 +49,7 @@
int main(void)
{
/* This test applies to Unix and OS/2 (emx build). */
/* This test applies to Unix and OS/2. */
return 0;
}
@ -64,12 +64,7 @@ int main(void)
#endif
#include <stdio.h>
#ifdef XP_OS2_VACPP
#define EPIPE EBADF /* IBM's write() doesn't return EPIPE */
#include <io.h>
#else
#include <unistd.h>
#endif
#include <errno.h>
static void Test(void *arg)

Просмотреть файл

@ -52,11 +52,6 @@
#define GTOD(_a) gettimeofday((_a), NULL)
#endif
#if defined (XP_OS2_VACPP)
#define INCL_DOSPROCESS
#include <os2.h>
#endif
static PRIntn rv = 0;
static void Other(void *unused)

Просмотреть файл

@ -52,10 +52,8 @@
#if defined(XP_OS2)
#define INCL_DOSFILEMGR
#include <os2.h>
#ifdef XP_OS2_EMX
#include <getopt.h>
#include <errno.h>
#endif /* XP_OS2_EMX */
#endif /* XP_OS2 */
static int _debug_on = 0;
@ -953,12 +951,12 @@ int main(int argc, char **argv)
#ifdef WIN32
PRUint32 len;
#endif
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
int opt;
extern char *optarg;
extern int optind;
#endif
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#if defined(XP_UNIX) || defined(XP_OS2)
while ((opt = getopt(argc, argv, "d")) != EOF) {
switch(opt) {
case 'd':

Просмотреть файл

@ -58,7 +58,7 @@
#endif
/* for getcwd */
#if defined(XP_UNIX) || defined (XP_OS2_EMX) || defined(XP_BEOS)
#if defined(XP_UNIX) || defined (XP_OS2) || defined(XP_BEOS)
#include <unistd.h>
#elif defined(XP_PC)
#include <direct.h>

Просмотреть файл

@ -66,7 +66,7 @@
#include <string.h>
/* for getcwd */
#if defined(XP_UNIX) || defined (XP_OS2_EMX) || defined(XP_BEOS)
#if defined(XP_UNIX) || defined (XP_OS2) || defined(XP_BEOS)
#include <unistd.h>
#elif defined(XP_PC)
#include <direct.h>

Просмотреть файл

@ -90,13 +90,7 @@ endif
endif
ifeq ($(OS_ARCH),OS2)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
LIBPR = $(dist_libdir)/nspr$(NSPR_VERSION).lib
LIBPLC= $(dist_libdir)/plc$(NSPR_VERSION).lib
else
LDOPTS += -Zomf -Zlinker /PM:VIO
endif
LDOPTS += -Zomf -Zlinker /PM:VIO
endif
ifneq ($(OS_ARCH), WINNT)