Resolve many build warnings
This patch fixes many warnings from the beginning of the build up to and including the depend stage. Nearly all warnings should be gone even with -Wall.
This commit is contained in:
committed by
Jon Trulson
parent
2bf29e5d63
commit
42e891d9e7
@@ -24,7 +24,7 @@ XCOMM (c) Copyright 1996 Hitachi.
|
||||
* So, when 'all' is made in this directory, redo make includes/depend.
|
||||
* An imake hack no doubt, but it is necessary for now.
|
||||
*/
|
||||
all:: generated_includes depend
|
||||
all:: generated_includes abdepend
|
||||
|
||||
#include "../ab.tmpl"
|
||||
#include "../ab.rules"
|
||||
@@ -174,6 +174,18 @@ SOURCES.msg = \
|
||||
../libABobjXm/libABobjXm.msg \
|
||||
../libABil/libABil.msg
|
||||
|
||||
AB_MAKEFILES = \
|
||||
Makefile.aix \
|
||||
Makefile.hpux \
|
||||
Makefile.sunos \
|
||||
Makefile.osf1 \
|
||||
Makefile.uxp \
|
||||
Makefile.unixware \
|
||||
Makefile.linux \
|
||||
Makefile.freebsd \
|
||||
Makefile.netbsd \
|
||||
Makefile.openbsd
|
||||
|
||||
#ifndef UngeneratedSource
|
||||
#define UngeneratedSource(macro, suffix) @@\
|
||||
macro = \ @@\
|
||||
@@ -240,8 +252,8 @@ Concat(x_util,suffix)
|
||||
UngeneratedSource(NONTGTS.c,.c)
|
||||
UngeneratedSource(NONTGTS.o,.o)
|
||||
|
||||
SRCS = $(TARGETS.c) $(TARGETS.c.stubs) $(NONTGTS.c)
|
||||
OBJS = $(TARGETS.o) $(TARGETS.o.stubs) $(NONTGTS.o)
|
||||
SRCS2 = $(TARGETS.c) $(TARGETS.c.stubs) $(NONTGTS.c)
|
||||
OBJS2 = $(TARGETS.o) $(TARGETS.o.stubs) $(NONTGTS.o)
|
||||
|
||||
SYS_LIBRARIES = -lm $(ICONVSYSLIB) $(DYNLIBSYSLIB) $(REGEXSYSLIB)
|
||||
|
||||
@@ -276,7 +288,10 @@ LOCAL_LIBRARIES = ../libABil/libABil.a ../libABobjXm/libABobjXm.a \
|
||||
$(TTLIB) $(UILLIB) $(MRESOURCELIB) $(XMLIB) $(XTOOLLIB) $(XLIB) \
|
||||
$(UTILLIB)
|
||||
|
||||
$(OBJS): $(SOURCES.h)
|
||||
/* dtcodegen needs path to catalogfile */
|
||||
DTCODEGENCAT = NLSPATH=$(CDESRC)/dtappbuilder/src/abmf/dtcodegen.cat
|
||||
|
||||
$(OBJS2): $(SOURCES.h)
|
||||
|
||||
XCOMM dtcodegen wants to rewrite some files, so we make copies for it.
|
||||
dtbuilder.msg: dtbuilder.msg.src
|
||||
@@ -286,7 +301,17 @@ dtbuilder.c: dtbuilder.c.src
|
||||
|
||||
includes:: dtbuilder.msg dtbuilder.c
|
||||
|
||||
ComplexProgramTarget(dtbuilder)
|
||||
all:: $(PROGRAMS)
|
||||
|
||||
ComplexProgramTarget_2(dtbuilder,$(LOCAL_LIBRARIES),)
|
||||
|
||||
abdepend:: DependFileName
|
||||
|
||||
DependFileName::
|
||||
-RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) $(SRCS2)) > $@
|
||||
|
||||
clean::
|
||||
RemoveFile(ProgramTargetName(PROGRAMS))
|
||||
|
||||
AbMessageCatalogTarget(dtbuilder)
|
||||
|
||||
@@ -294,7 +319,7 @@ XCOMM Try to replace the original dtbuilder.msg.src file if necessary.
|
||||
all:: dtbuilder dtbuilder.cat
|
||||
|
||||
clean::
|
||||
$(RM) $(TARGETS.h) $(TARGETS.c) .dtcodegen.log *.delta dtbuilder.c dtbuilder.msg
|
||||
$(RM) $(TARGETS.h) $(TARGETS.c) $(AB_MAKEFILES) .dtcodegen.log *.delta dtbuilder.c dtbuilder.msg
|
||||
|
||||
CppSourceFile(Dtbuilder,Dtbuilder.src,$(LOCAL_CPP_DEFINES),)
|
||||
|
||||
|
||||
@@ -101,25 +101,24 @@ static int write_os_params(
|
||||
static int write_aix_stuff(File makeFile, AbmfLibs libs);
|
||||
static int write_hpux_stuff(File makeFile, AbmfLibs libs);
|
||||
static int write_sunos_params(File makeFile, AbmfLibs libs);
|
||||
static int write_unixware_params(File makeFile, AbmfLibs libs);
|
||||
static int write_uxp_params(File makeFile, AbmfLibs libs);
|
||||
static int write_osf1_stuff(File makeFile, AbmfLibs libs);
|
||||
|
||||
#ifdef USL
|
||||
/*
|
||||
* USL specific changes were added ifdef USL due to time constraints
|
||||
* These ifdefs should be removed in the next release
|
||||
*/
|
||||
static int write_unixware_params(File makeFile, AbmfLibs libs);
|
||||
#endif
|
||||
static int write_lnx_params(File makeFile, AbmfLibs libs);
|
||||
static int write_fbsd_params(File makeFile, AbmfLibs libs);
|
||||
static int write_nbsd_params(File makeFile, AbmfLibs libs);
|
||||
static int write_obsd_params(File makeFile, AbmfLibs libs);
|
||||
|
||||
static int determine_aix_libs(AbmfLibs libs, ABObj project);
|
||||
static int determine_hpux_libs(AbmfLibs libs, ABObj project);
|
||||
static int determine_sunos_libs(AbmfLibs libs, ABObj project);
|
||||
static int determine_unixware_libs(AbmfLibs libs, ABObj project);
|
||||
static int determine_uxp_libs(AbmfLibs libs, ABObj project);
|
||||
static int determine_osf1_libs(AbmfLibs libs, ABObj project);
|
||||
#ifdef USL
|
||||
static int determine_unixware_libs(AbmfLibs libs, ABObj project);
|
||||
#endif
|
||||
static int determine_lnx_libs(AbmfLibs libs, ABObj project);
|
||||
static int determine_fbsd_libs(AbmfLibs libs, ABObj project);
|
||||
static int determine_nbsd_libs(AbmfLibs libs, ABObj project);
|
||||
static int determine_obsd_libs(AbmfLibs libs, ABObj project);
|
||||
|
||||
static int write_file_header(
|
||||
GenCodeInfo genCodeInfo,
|
||||
@@ -239,14 +238,24 @@ determine_libs(AbmfLibs libs, ABObj project, AB_OS_TYPE osType)
|
||||
case AB_OS_OSF1:
|
||||
return_value = determine_osf1_libs(libs, project);
|
||||
break;
|
||||
#ifdef USL
|
||||
case AB_OS_UNIXWARE:
|
||||
return_value = determine_unixware_libs(libs, project);
|
||||
break;
|
||||
#endif
|
||||
case AB_OS_UXP:
|
||||
return_value = determine_uxp_libs(libs, project);
|
||||
break;
|
||||
case AB_OS_LNX:
|
||||
return_value = determine_lnx_libs(libs, project);
|
||||
break;
|
||||
case AB_OS_FBSD:
|
||||
return_value = determine_fbsd_libs(libs, project);
|
||||
break;
|
||||
case AB_OS_NBSD:
|
||||
return_value = determine_nbsd_libs(libs, project);
|
||||
break;
|
||||
case AB_OS_OBSD:
|
||||
return_value = determine_obsd_libs(libs, project);
|
||||
break;
|
||||
}
|
||||
|
||||
return return_value;
|
||||
@@ -288,13 +297,35 @@ determine_osf1_libs(AbmfLibs libs, ABObj project)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef USL
|
||||
static int
|
||||
determine_unixware_libs(AbmfLibs libs, ABObj project)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
determine_lnx_libs(AbmfLibs libs, ABObj project)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
determine_fbsd_libs(AbmfLibs libs, ABObj project)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
determine_nbsd_libs(AbmfLibs libs, ABObj project)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
determine_obsd_libs(AbmfLibs libs, ABObj project)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static STRING
|
||||
get_string_for_lib(AbmfLibDesc lib, AB_OS_TYPE osType)
|
||||
@@ -491,6 +522,10 @@ write_os_params(
|
||||
return_value = write_sunos_params(makeFile, libs);
|
||||
break;
|
||||
|
||||
case AB_OS_UNIXWARE:
|
||||
return_value = write_unixware_params(makeFile, libs);
|
||||
break;
|
||||
|
||||
case AB_OS_UXP:
|
||||
return_value = write_uxp_params(makeFile, libs);
|
||||
break;
|
||||
@@ -499,11 +534,21 @@ write_os_params(
|
||||
return_value = write_osf1_stuff(makeFile, libs);
|
||||
break;
|
||||
|
||||
#ifdef USL
|
||||
case AB_OS_UNIXWARE:
|
||||
return_value = write_unixware_params(makeFile, libs);
|
||||
case AB_OS_LNX:
|
||||
return_value = write_lnx_params(makeFile, libs);
|
||||
break;
|
||||
|
||||
case AB_OS_FBSD:
|
||||
return_value = write_fbsd_params(makeFile, libs);
|
||||
break;
|
||||
|
||||
case AB_OS_NBSD:
|
||||
return_value = write_nbsd_params(makeFile, libs);
|
||||
break;
|
||||
|
||||
case AB_OS_OBSD:
|
||||
return_value = write_obsd_params(makeFile, libs);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
return return_value;
|
||||
@@ -732,7 +777,6 @@ write_osf1_stuff(File makeFile, AbmfLibs libs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef USL
|
||||
static int
|
||||
write_unixware_params(File makeFile, AbmfLibs libs)
|
||||
{
|
||||
@@ -774,7 +818,185 @@ write_unixware_params(File makeFile, AbmfLibs libs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /*** USL***/
|
||||
static int
|
||||
write_lnx_params(File makeFile, AbmfLibs libs)
|
||||
{
|
||||
STRING osName = util_os_type_to_string(AB_OS_LNX);
|
||||
|
||||
abio_printf(makeFile,
|
||||
"\n"
|
||||
"###########################################################################\n"
|
||||
"# These are the %s-dependent configuration parameters that must be\n"
|
||||
"# set in order for any application to build.\n"
|
||||
"###########################################################################\n",
|
||||
osName);
|
||||
|
||||
abio_puts(makeFile,
|
||||
"\n"
|
||||
".KEEP_STATE:\n"
|
||||
"\n"
|
||||
" RM = rm -f\n"
|
||||
" INCLUDES = -I/usr/dt/include -I/X11/include\n"
|
||||
"\n"
|
||||
" STD_DEFINES = \n"
|
||||
" ANSI_DEFINES = \n"
|
||||
"\n"
|
||||
" CDEBUGFLAGS = -g\n"
|
||||
" COPTFLAGS = -O2\n"
|
||||
" SYS_LIBRARIES = -lgen -lm\n"
|
||||
" CDE_LIBPATH = /usr/dt/lib\n"
|
||||
" CDE_LDFLAGS = -L$(CDE_LIBPATH)\n"
|
||||
" ALLX_LIBPATH = /X11/lib\n"
|
||||
" ALLX_LDFLAGS = -L$(ALLX_LIBPATH)\n"
|
||||
);
|
||||
write_local_libraries(makeFile, libs, AB_OS_LNX);
|
||||
|
||||
abio_puts(makeFile,
|
||||
"\n"
|
||||
" CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES)"
|
||||
" $(ANSI_DEFINES)\n"
|
||||
" LDLIBS = $(SYS_LIBRARIES)\n"
|
||||
" LDOPTIONS = $(CDE_LDFLAGS) $(ALLX_LDFLAGS)\n"
|
||||
"\n"
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
write_fbsd_params(File makeFile, AbmfLibs libs)
|
||||
{
|
||||
STRING osName = util_os_type_to_string(AB_OS_FBSD);
|
||||
|
||||
abio_printf(makeFile,
|
||||
"\n"
|
||||
"###########################################################################\n"
|
||||
"# These are the %s-dependent configuration parameters that must be\n"
|
||||
"# set in order for any application to build.\n"
|
||||
"###########################################################################\n",
|
||||
osName);
|
||||
|
||||
abio_puts(makeFile,
|
||||
"\n"
|
||||
".KEEP_STATE:\n"
|
||||
"\n"
|
||||
" RM = rm -f\n"
|
||||
" INCLUDES = -I/usr/dt/include -I/X11/include\n"
|
||||
"\n"
|
||||
" STD_DEFINES = \n"
|
||||
" ANSI_DEFINES = \n"
|
||||
"\n"
|
||||
" CDEBUGFLAGS = -g\n"
|
||||
" COPTFLAGS = -O2\n"
|
||||
" SYS_LIBRARIES = -lgen -lm\n"
|
||||
" CDE_LIBPATH = /usr/dt/lib\n"
|
||||
" CDE_LDFLAGS = -L$(CDE_LIBPATH)\n"
|
||||
" ALLX_LIBPATH = /X11/lib\n"
|
||||
" ALLX_LDFLAGS = -L$(ALLX_LIBPATH)\n"
|
||||
);
|
||||
write_local_libraries(makeFile, libs, AB_OS_FBSD);
|
||||
|
||||
abio_puts(makeFile,
|
||||
"\n"
|
||||
" CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES)"
|
||||
" $(ANSI_DEFINES)\n"
|
||||
" LDLIBS = $(SYS_LIBRARIES)\n"
|
||||
" LDOPTIONS = $(CDE_LDFLAGS) $(ALLX_LDFLAGS)\n"
|
||||
"\n"
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
write_nbsd_params(File makeFile, AbmfLibs libs)
|
||||
{
|
||||
STRING osName = util_os_type_to_string(AB_OS_NBSD);
|
||||
|
||||
abio_printf(makeFile,
|
||||
"\n"
|
||||
"###########################################################################\n"
|
||||
"# These are the %s-dependent configuration parameters that must be\n"
|
||||
"# set in order for any application to build.\n"
|
||||
"###########################################################################\n",
|
||||
osName);
|
||||
|
||||
abio_puts(makeFile,
|
||||
"\n"
|
||||
".KEEP_STATE:\n"
|
||||
"\n"
|
||||
" RM = rm -f\n"
|
||||
" INCLUDES = -I/usr/dt/include -I/X11/include\n"
|
||||
"\n"
|
||||
" STD_DEFINES = \n"
|
||||
" ANSI_DEFINES = \n"
|
||||
"\n"
|
||||
" CDEBUGFLAGS = -g\n"
|
||||
" COPTFLAGS = -O2\n"
|
||||
" SYS_LIBRARIES = -lgen -lm\n"
|
||||
" CDE_LIBPATH = /usr/dt/lib\n"
|
||||
" CDE_LDFLAGS = -L$(CDE_LIBPATH)\n"
|
||||
" ALLX_LIBPATH = /X11/lib\n"
|
||||
" ALLX_LDFLAGS = -L$(ALLX_LIBPATH)\n"
|
||||
);
|
||||
write_local_libraries(makeFile, libs, AB_OS_NBSD);
|
||||
|
||||
abio_puts(makeFile,
|
||||
"\n"
|
||||
" CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES)"
|
||||
" $(ANSI_DEFINES)\n"
|
||||
" LDLIBS = $(SYS_LIBRARIES)\n"
|
||||
" LDOPTIONS = $(CDE_LDFLAGS) $(ALLX_LDFLAGS)\n"
|
||||
"\n"
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
write_obsd_params(File makeFile, AbmfLibs libs)
|
||||
{
|
||||
STRING osName = util_os_type_to_string(AB_OS_OBSD);
|
||||
|
||||
abio_printf(makeFile,
|
||||
"\n"
|
||||
"###########################################################################\n"
|
||||
"# These are the %s-dependent configuration parameters that must be\n"
|
||||
"# set in order for any application to build.\n"
|
||||
"###########################################################################\n",
|
||||
osName);
|
||||
|
||||
abio_puts(makeFile,
|
||||
"\n"
|
||||
".KEEP_STATE:\n"
|
||||
"\n"
|
||||
" RM = rm -f\n"
|
||||
" INCLUDES = -I/usr/dt/include -I/X11/include\n"
|
||||
"\n"
|
||||
" STD_DEFINES = \n"
|
||||
" ANSI_DEFINES = \n"
|
||||
"\n"
|
||||
" CDEBUGFLAGS = -g\n"
|
||||
" COPTFLAGS = -O2\n"
|
||||
" SYS_LIBRARIES = -lgen -lm\n"
|
||||
" CDE_LIBPATH = /usr/dt/lib\n"
|
||||
" CDE_LDFLAGS = -L$(CDE_LIBPATH)\n"
|
||||
" ALLX_LIBPATH = /X11/lib\n"
|
||||
" ALLX_LDFLAGS = -L$(ALLX_LIBPATH)\n"
|
||||
);
|
||||
write_local_libraries(makeFile, libs, AB_OS_OBSD);
|
||||
|
||||
abio_puts(makeFile,
|
||||
"\n"
|
||||
" CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES)"
|
||||
" $(ANSI_DEFINES)\n"
|
||||
" LDLIBS = $(SYS_LIBRARIES)\n"
|
||||
" LDOPTIONS = $(CDE_LDFLAGS) $(ALLX_LDFLAGS)\n"
|
||||
"\n"
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
write_local_libraries(
|
||||
@@ -1112,8 +1334,10 @@ write_targets(
|
||||
" $(RM) $(CLEAN_FILES)\n"
|
||||
"\n"
|
||||
"scour:\n"
|
||||
" $(RM) $(CLEAN_FILES) $(TARGETS.h.merged) $(TARGETS.c.merged) Makefile Makefile.aix Makefile.hpux Makefile.sunos \\\n"
|
||||
" Makefile.osf1\n"
|
||||
" $(RM) $(CLEAN_FILES) $(TARGETS.h.merged) $(TARGETS.c.merged) \\\n"
|
||||
" Makefile Makefile.aix Makefile.hpux Makefile.sunos \\\n"
|
||||
" Makefile.osf1 Makefile.uxp Makefile.unixware Makefile.linux \\\n"
|
||||
" Makefile.freebsd Makefile.netbsd Makefile.openbsd\n"
|
||||
);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -249,18 +249,14 @@ util_get_os_type(void)
|
||||
struct utsname sysInfo;
|
||||
int aixIndex = -1;
|
||||
int hpIndex = -1;
|
||||
int sunIndex = -1;
|
||||
int unixwareIndex = -1;
|
||||
int uxpIndex = -1;
|
||||
int osf1Index = -1;
|
||||
|
||||
#ifdef USL
|
||||
/*
|
||||
* These changes were made ifdef USL due to time constraint.
|
||||
* ifdefs should be removed in next release
|
||||
*/
|
||||
int unixwareIndex = -1;
|
||||
#endif
|
||||
|
||||
int sunIndex = -1;
|
||||
int lnxIndex = -1;
|
||||
int fbsdIndex = -1;
|
||||
int nbsdIndex = -1;
|
||||
int obsdIndex = -1;
|
||||
|
||||
if (osTypeDefined)
|
||||
{
|
||||
@@ -274,86 +270,80 @@ util_get_os_type(void)
|
||||
aixIndex = util_strcasestr(sysInfo.sysname, "aix");
|
||||
hpIndex = util_strcasestr(sysInfo.sysname, "hp");
|
||||
sunIndex = util_strcasestr(sysInfo.sysname, "sun");
|
||||
unixwareIndex = util_strcasestr(sysInfo.sysname, "UNIX_SV");
|
||||
uxpIndex = util_strcasestr(sysInfo.sysname, "UNIX_System_V");
|
||||
osf1Index = util_strcasestr(sysInfo.sysname, "osf1");
|
||||
|
||||
#ifdef USL
|
||||
/*
|
||||
* These changes were made ifdef USL due to time constraint.
|
||||
* ifdefs should be removed in next release
|
||||
*/
|
||||
unixwareIndex = util_strcasestr(sysInfo.sysname, "UNIX_SV");
|
||||
#endif
|
||||
lnxIndex = util_strcasestr(sysInfo.sysname, "linux");
|
||||
fbsdIndex = util_strcasestr(sysInfo.sysname, "freebsd");
|
||||
nbsdIndex = util_strcasestr(sysInfo.sysname, "netbsd");
|
||||
obsdIndex = util_strcasestr(sysInfo.sysname, "openbsd");
|
||||
|
||||
if (aixIndex < 0) aixIndex = INT_MAX;
|
||||
if (hpIndex < 0) hpIndex = INT_MAX;
|
||||
if (sunIndex < 0) sunIndex = INT_MAX;
|
||||
if (unixwareIndex < 0) unixwareIndex = INT_MAX;
|
||||
if (uxpIndex < 0) uxpIndex = INT_MAX;
|
||||
if (osf1Index < 0) osf1Index = INT_MAX;
|
||||
if (lnxIndex < 0) lnxIndex = INT_MAX;
|
||||
if (fbsdIndex < 0) fbsdIndex = INT_MAX;
|
||||
if (nbsdIndex < 0) nbsdIndex = INT_MAX;
|
||||
if (obsdIndex < 0) obsdIndex = INT_MAX;
|
||||
|
||||
#ifdef USL
|
||||
/*
|
||||
* These changes were made ifdef USL due to time constraint.
|
||||
* ifdefs should be removed in next release
|
||||
*/
|
||||
if (unixwareIndex < 0) unixwareIndex = INT_MAX;
|
||||
#endif
|
||||
#define IS_MATCH(a,b,c,d,e,f,g,h,i,j) \
|
||||
(((a) < (b)) && ((a) < (c)) && ((a) < (d)) && ((a) < (e)) && ((a) < (f)) && \
|
||||
((a) < (g)) && ((a) < (h)) && ((a) < (i)) && ((a) < (j)))
|
||||
|
||||
#ifndef USL
|
||||
|
||||
#define IS_MATCH(a,b,c,d,e) \
|
||||
(((a) < (b)) && ((a) < (c)) && ((a) < (d))&& ((a) < (e)))
|
||||
|
||||
if (IS_MATCH(aixIndex, hpIndex, sunIndex, osf1Index, uxpIndex))
|
||||
if (IS_MATCH(aixIndex, hpIndex, sunIndex, osf1Index, unixwareIndex,
|
||||
uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex))
|
||||
{
|
||||
return AB_OS_AIX;
|
||||
}
|
||||
if (IS_MATCH(hpIndex, aixIndex, sunIndex, osf1Index, uxpIndex))
|
||||
if (IS_MATCH(hpIndex, aixIndex, sunIndex, osf1Index, unixwareIndex,
|
||||
uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex))
|
||||
{
|
||||
return AB_OS_HPUX;
|
||||
}
|
||||
if (IS_MATCH(sunIndex, aixIndex, hpIndex, osf1Index, uxpIndex))
|
||||
if (IS_MATCH(sunIndex, aixIndex, hpIndex, osf1Index, unixwareIndex,
|
||||
uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex))
|
||||
{
|
||||
return AB_OS_SUNOS;
|
||||
}
|
||||
if (IS_MATCH(osf1Index, aixIndex, hpIndex, sunIndex, uxpIndex))
|
||||
if (IS_MATCH(osf1Index, aixIndex, hpIndex, sunIndex, unixwareIndex,
|
||||
uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex))
|
||||
{
|
||||
return AB_OS_OSF1;
|
||||
}
|
||||
if (IS_MATCH(uxpIndex, aixIndex, hpIndex, sunIndex, osf1Index))
|
||||
if (IS_MATCH(uxpIndex, aixIndex, hpIndex, sunIndex, unixwareIndex,
|
||||
osf1Index, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex))
|
||||
{
|
||||
return AB_OS_UXP;
|
||||
}
|
||||
|
||||
#else
|
||||
#define IS_MATCH(a,b,c,d,e,f) \
|
||||
(((a) < (b)) && ((a) < (c)) && ((a) < (d)) && ((a) < (e)) && ((a) < (f)))
|
||||
|
||||
if (IS_MATCH(aixIndex, hpIndex, sunIndex, osf1Index, unixwareIndex, uxpIndex))
|
||||
{
|
||||
return AB_OS_AIX;
|
||||
}
|
||||
if (IS_MATCH(hpIndex, aixIndex, sunIndex, osf1Index, unixwareIndex, uxpIndex))
|
||||
{
|
||||
return AB_OS_HPUX;
|
||||
}
|
||||
if (IS_MATCH(sunIndex, aixIndex, hpIndex, osf1Index, unixwareIndex, uxpIndex))
|
||||
{
|
||||
return AB_OS_SUNOS;
|
||||
}
|
||||
if (IS_MATCH(osf1Index, aixIndex, hpIndex, sunIndex, unixwareIndex, uxpIndex))
|
||||
{
|
||||
return AB_OS_OSF1;
|
||||
}
|
||||
if (IS_MATCH(uxpIndex, aixIndex, hpIndex, sunIndex, unixwareIndex, osf1Index))
|
||||
{
|
||||
return AB_OS_UXP;
|
||||
}
|
||||
if (IS_MATCH(unixwareIndex, aixIndex, hpIndex, sunIndex, osf1Index, uxpIndex))
|
||||
if (IS_MATCH(unixwareIndex, aixIndex, hpIndex, sunIndex, osf1Index,
|
||||
uxpIndex, lnxIndex, fbsdIndex, nbsdIndex, obsdIndex))
|
||||
{
|
||||
return AB_OS_UNIXWARE;
|
||||
}
|
||||
#endif /**USL**/
|
||||
if (IS_MATCH(lnxIndex, aixIndex, hpIndex, sunIndex, osf1Index,
|
||||
unixwareIndex, uxpIndex, fbsdIndex, nbsdIndex, obsdIndex))
|
||||
{
|
||||
return AB_OS_LNX;
|
||||
}
|
||||
if (IS_MATCH(fbsdIndex, aixIndex, hpIndex, sunIndex, osf1Index,
|
||||
unixwareIndex, uxpIndex, lnxIndex, nbsdIndex, obsdIndex))
|
||||
{
|
||||
return AB_OS_FBSD;
|
||||
}
|
||||
if (IS_MATCH(nbsdIndex, aixIndex, hpIndex, sunIndex, osf1Index,
|
||||
unixwareIndex, uxpIndex, lnxIndex, fbsdIndex, obsdIndex))
|
||||
{
|
||||
return AB_OS_NBSD;
|
||||
}
|
||||
if (IS_MATCH(obsdIndex, aixIndex, hpIndex, sunIndex, osf1Index,
|
||||
unixwareIndex, uxpIndex, lnxIndex, fbsdIndex, nbsdIndex))
|
||||
{
|
||||
return AB_OS_OBSD;
|
||||
}
|
||||
|
||||
osTypeDefined = TRUE;
|
||||
|
||||
epilogue:
|
||||
|
||||
@@ -82,10 +82,12 @@ typedef enum
|
||||
AB_OS_AIX,
|
||||
AB_OS_SUNOS,
|
||||
AB_OS_OSF1,
|
||||
#ifdef USL
|
||||
AB_OS_UNIXWARE,
|
||||
#endif
|
||||
AB_OS_UXP,
|
||||
AB_OS_LNX,
|
||||
AB_OS_FBSD,
|
||||
AB_OS_NBSD,
|
||||
AB_OS_OBSD,
|
||||
AB_OS_TYPE_NUM_VALUES /* must be last */
|
||||
} AB_OS_TYPE;
|
||||
|
||||
|
||||
@@ -854,16 +854,13 @@ util_os_type_to_ident(AB_OS_TYPE osType)
|
||||
case AB_OS_AIX: typeString = "aix"; break;
|
||||
case AB_OS_HPUX: typeString = "hpux"; break;
|
||||
case AB_OS_SUNOS: typeString = "sunos"; break;
|
||||
case AB_OS_UNIXWARE: typeString = "unixware"; break;
|
||||
case AB_OS_UXP: typeString = "uxp"; break;
|
||||
case AB_OS_OSF1: typeString = "osf1"; break;
|
||||
|
||||
#ifdef USL
|
||||
/*
|
||||
* The USL specific changes were made ifdef USL due to time constraint
|
||||
* They should be removed in the next release
|
||||
*/
|
||||
case AB_OS_UNIXWARE: typeString = "unixware"; break;
|
||||
#endif
|
||||
case AB_OS_LNX: typeString = "linux"; break;
|
||||
case AB_OS_FBSD: typeString = "freebsd"; break;
|
||||
case AB_OS_NBSD: typeString = "netbsd"; break;
|
||||
case AB_OS_OBSD: typeString = "openbsd"; break;
|
||||
}
|
||||
|
||||
return typeString;
|
||||
@@ -883,8 +880,13 @@ util_os_type_to_string(AB_OS_TYPE osType)
|
||||
case AB_OS_AIX: nameString = "AIX"; break;
|
||||
case AB_OS_HPUX: nameString = "HP-UX"; break;
|
||||
case AB_OS_SUNOS: nameString = "SunOS"; break;
|
||||
case AB_OS_UNIXWARE: nameString = "UnixWare"; break;
|
||||
case AB_OS_UXP: nameString = "UXP"; break;
|
||||
case AB_OS_OSF1: nameString = "OSF/1"; break;
|
||||
case AB_OS_LNX: nameString = "Linux"; break;
|
||||
case AB_OS_FBSD: nameString = "FreeBSD"; break;
|
||||
case AB_OS_NBSD: nameString = "NetBSD"; break;
|
||||
case AB_OS_OBSD: nameString = "OpenBSD"; break;
|
||||
}
|
||||
|
||||
return nameString;
|
||||
|
||||
Reference in New Issue
Block a user