# # Patch managed by http://www.holgerschurig.de/patcher.html # --- ncurses-5.4/ncurses/Makefile.in~visibility.patch +++ ncurses-5.4/ncurses/Makefile.in @@ -107,7 +107,7 @@ CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) --- ncurses-5.4/panel/Makefile.in~visibility.patch +++ ncurses-5.4/panel/Makefile.in @@ -88,7 +88,7 @@ CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) --- ncurses-5.4/menu/Makefile.in~visibility.patch +++ ncurses-5.4/menu/Makefile.in @@ -87,7 +87,7 @@ CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) --- ncurses-5.4/c++/Makefile.in~visibility.patch +++ ncurses-5.4/c++/Makefile.in @@ -80,7 +80,7 @@ CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) --- ncurses-5.4/form/Makefile.in~visibility.patch +++ ncurses-5.4/form/Makefile.in @@ -88,7 +88,7 @@ CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) --- ncurses-5.4/configure.in~visibility.patch +++ ncurses-5.4/configure.in @@ -34,17 +34,20 @@ dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- -AC_PREREQ(2.13.20020210) +AC_PREREQ(2.59) AC_REVISION($Revision: 1.312 $) -AC_INIT(ncurses/base/lib_initscr.c) +AC_INIT +AC_CONFIG_SRCDIR([ncurses/base/lib_initscr.c]) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) +m4_include([m4/templates.m4]) + CF_SUBST_NCURSES_VERSION CF_WITH_REL_VERSION(NCURSES) CF_WITH_ABI_VERSION -CF_CHECK_CACHE([AC_CANONICAL_SYSTEM]) +CF_CHECK_CACHE([AC_CANONICAL_TARGET([])]) AC_ARG_WITH(system-type, [ --with-system-type=XXX test: override derived host system-type], [AC_MSG_WARN(overriding system type to $withval) @@ -100,7 +103,7 @@ CF_GXX_VERSION case $GXX_VERSION in 1*|2.[[0-6]]*) - GXX=""; CXX=""; ac_cv_prog_gxx=no + GXX=""; CXX=""; ac_cv_cxx_compiler_gnu=no cf_cxx_library=no AC_MSG_WARN(templates do not work) ;; @@ -176,7 +179,6 @@ AC_SUBST(DESTDIR) ############################################################################### -CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:) # If we're cross-compiling, allow the user to override the tools and their # options. The configure script is oriented toward identifying the host # compiler, etc., but we need a build compiler to generate parts of the source. @@ -213,7 +215,6 @@ AC_SUBST(BUILD_EXEEXT) ############################################################################### -CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:) ### Options to allow the user to specify the set of libraries which are used. ### Use "--without-normal --with-shared" to allow the default model to be @@ -343,11 +344,11 @@ AC_MSG_CHECKING(for default loader flags) case $DFT_LWR_MODEL in -libtool) LD_MODEL='' ;; +libtool) LD_MODEL=''; LIBOPTS="-DNCURSES_DLL" ;; normal) LD_MODEL='' ;; debug) LD_MODEL=$CC_G_OPT ;; profile) LD_MODEL='-pg';; -shared) LD_MODEL='' ;; +shared) LD_MODEL=''; LIBOPTS="-DNCURSES_DLL" ;; esac AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg) AC_MSG_RESULT($LD_MODEL) @@ -363,14 +364,14 @@ if test "$CC_SHARED_OPTS" = "unknown"; then for model in $cf_list_models; do if test "$model" = "shared"; then - AC_ERROR(Shared libraries are not supported in this version) + AC_MSG_ERROR([Shared libraries are not supported in this version]) fi done fi -############################################################################### -CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) +AC_SUBST(LIBOPTS) +############################################################################### ### use option --disable-overwrite to leave out the link to -lcurses AC_MSG_CHECKING(if you wish to install ncurses overwriting curses) AC_ARG_ENABLE(overwrite, @@ -450,7 +451,7 @@ AC_ARG_ENABLE(big-core, [ --disable-big-core assume machine has little memory], [with_big_core=$enableval], - [AC_TRY_RUN([ + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include int main() { @@ -459,10 +460,7 @@ if (s != 0) s[0] = s[n-1] = 0; exit(s == 0); -}], - [with_big_core=yes], - [with_big_core=no], - [with_big_core=no])]) +}]])],[with_big_core=yes],[with_big_core=no],[with_big_core=no])]) AC_MSG_RESULT($with_big_core) test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE) @@ -477,7 +475,7 @@ if test "$with_termcap" != "yes" ; then if test "$use_database" = no ; then if test -z "$with_fallback" ; then - AC_ERROR(You have disabled the database w/o specifying fallbacks) + AC_MSG_ERROR([You have disabled the database w/o specifying fallbacks]) fi fi AC_DEFINE(PURE_TERMINFO) @@ -614,10 +612,10 @@ test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS) ############################################################################### + CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ]) ############################################################################### -CF_HELP_MESSAGE(Extensions:) ### Note that some functions (such as const) are normally disabled anyway. AC_MSG_CHECKING(if you want to build with function extensions) @@ -683,7 +681,6 @@ ############################################################################### # These options are relatively safe to experiment with. -CF_HELP_MESSAGE(Development Code:) AC_MSG_CHECKING(if you want all development code) AC_ARG_WITH(develop, [ --with-develop enable all development options], @@ -719,7 +716,6 @@ ############################################################################### # These are just experimental, probably should not be in a package: -CF_HELP_MESSAGE(Experimental Code:) AC_MSG_CHECKING(if you do not want to assume colors are white-on-black) AC_ARG_ENABLE(assumed-color, @@ -828,7 +824,6 @@ AC_SUBST(TERMINFO_CAPS) ############################################################################### -CF_HELP_MESSAGE(Testing/development Options:) ### use option --disable-echo to suppress full display compiling commands AC_MSG_CHECKING(if you want to display full commands during build) @@ -931,7 +926,7 @@ AC_SUBST(MATH_LIB) ### Checks for header files. -AC_STDC_HEADERS +AC_HEADER_STDC([]) AC_HEADER_DIRENT AC_HEADER_TIME CF_REGEX @@ -965,7 +960,7 @@ CF_SYS_TIME_SELECT ### checks for compiler characteristics -AC_LANG_C +AC_LANG([C]) AC_C_CONST AC_C_INLINE test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS) @@ -1040,7 +1035,7 @@ # Check for C++ compiler characteristics (and ensure that it's there!) if test -n "$CXX" ; then - AC_LANG_CPLUSPLUS + AC_LANG([C++]) CF_STDCPP_LIBRARY case $GXX_VERSION in @@ -1135,7 +1130,6 @@ fi AC_SUBST(USE_CXX_BOOL) -CF_HELP_MESSAGE(Ada95 Binding Options:) dnl Check for availability of GNU Ada Translator (GNAT). dnl At the moment we support no other Ada95 compiler. @@ -1309,15 +1303,16 @@ ################################################################################ test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" -AC_OUTPUT( \ +AC_CONFIG_FILES([\ include/MKterm.h.awk \ include/curses.head:include/curses.h.in \ include/termcap.h \ include/unctrl.h \ $SUB_MAKEFILES \ - Makefile,[ + Makefile]) +AC_CONFIG_COMMANDS([default],[ CF_LIB_RULES -],[ +],[[ ### Special initialization commands, used to pass information from the ### configuration-run into config.status @@ -1348,5 +1343,6 @@ host="$host" target="$target" -],cat)dnl +]]) +AC_OUTPUT ${MAKE-make} preinstall --- ncurses-5.4/include/ncurses_dll.h~visibility.patch +++ ncurses-5.4/include/ncurses_dll.h @@ -7,8 +7,8 @@ /* but this structure may be useful at some point for an MSVC build */ /* so, for now unconditionally define the important flags */ /* "the right way" for proper static and dll+auto-import behavior */ -#undef NCURSES_DLL -#define NCURSES_STATIC +//#undef NCURSES_DLL +//#define NCURSES_STATIC #if defined(__CYGWIN__) # if defined(NCURSES_DLL) @@ -32,12 +32,20 @@ # endif # define NCURSES_API __cdecl # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API -# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type +# define NCURSES_EXPORT_VAR(var) var NCURSES_IMPEXP #endif /* Take care of non-cygwin platforms */ #if !defined(NCURSES_IMPEXP) -# define NCURSES_IMPEXP /* nothing */ +# if defined(GCC_HASCLASSVISIBILITY) +# if defined(NCURSES_DLL) +# define NCURSES_IMPEXP __attribute__ ((visibility("default"))) +# else +# define NCURSES_IMPEXP /* nothing */ +# endif +# else +# define NCURSES_IMPEXP /* nothing */ +# endif #endif #if !defined(NCURSES_API) # define NCURSES_API /* nothing */ @@ -46,7 +54,7 @@ # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API #endif #if !defined(NCURSES_EXPORT_VAR) -# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type +# define NCURSES_EXPORT_VAR(var) var NCURSES_IMPEXP #endif #endif /* NCURSES_DLL_H_incl */ --- ncurses-5.4/form/fty_alnum.c~visibility.patch +++ ncurses-5.4/form/fty_alnum.c @@ -132,6 +132,6 @@ NULL }; -NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeALNUM; +FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_ALNUM) = &typeALNUM; /* fty_alnum.c ends here */ --- ncurses-5.4/form/fty_alpha.c~visibility.patch +++ ncurses-5.4/form/fty_alpha.c @@ -133,6 +133,6 @@ NULL }; -NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeALPHA; +FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_ALPHA) = &typeALPHA; /* fty_alpha.c ends here */ --- ncurses-5.4/form/fld_newftyp.c~visibility.patch +++ ncurses-5.4/form/fld_newftyp.c @@ -48,7 +48,7 @@ NULL /* enumerate previous function */ }; -NCURSES_EXPORT_VAR(const FIELDTYPE*) _nc_Default_FieldType = &default_fieldtype; +const FIELDTYPE* NCURSES_EXPORT_VAR(_nc_Default_FieldType) = &default_fieldtype; /*--------------------------------------------------------------------------- | Facility : libnform --- ncurses-5.4/form/form.h~visibility.patch +++ ncurses-5.4/form/form.h @@ -248,24 +248,24 @@ /************************* * standard field types * *************************/ -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; +extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_ALPHA); +extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_ALNUM); +extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_ENUM); +extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_INTEGER); +extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_NUMERIC); +extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_REGEXP); /************************************ * built-in additional field types * * They are not defined in SVr4 * ************************************/ -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ +extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_IPV4); /* Internet IP Version 4 address */ /*********************** * Default objects * ***********************/ -extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form; -extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field; +extern FORM * NCURSES_EXPORT_VAR(_nc_Default_Form); +extern FIELD * NCURSES_EXPORT_VAR(_nc_Default_Field); /*********************** --- ncurses-5.4/form/fty_int.c~visibility.patch +++ ncurses-5.4/form/fty_int.c @@ -155,6 +155,6 @@ NULL }; -NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeINTEGER; +FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_INTEGER) = &typeINTEGER; /* fty_int.c ends here */ --- ncurses-5.4/form/fty_num.c~visibility.patch +++ ncurses-5.4/form/fty_num.c @@ -190,6 +190,6 @@ NULL }; -NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeNUMERIC; +FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_NUMERIC) = &typeNUMERIC; /* fty_num.c ends here */ --- ncurses-5.4/form/fty_regex.c~visibility.patch +++ ncurses-5.4/form/fty_regex.c @@ -252,6 +252,6 @@ NULL }; -NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP; +FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_REGEXP) = &typeREGEXP; /* fty_regex.c ends here */ --- ncurses-5.4/form/frm_def.c~visibility.patch +++ ncurses-5.4/form/frm_def.c @@ -60,7 +60,7 @@ NULL /* fieldterm */ }; -NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; +FORM * NCURSES_EXPORT_VAR(_nc_Default_Form) = &default_form; /*--------------------------------------------------------------------------- | Facility : libnform --- ncurses-5.4/form/fld_def.c~visibility.patch +++ ncurses-5.4/form/fld_def.c @@ -63,7 +63,7 @@ (char *)0 /* usrptr */ }; -NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; +FIELD * NCURSES_EXPORT_VAR(_nc_Default_Field) = &default_field; /*--------------------------------------------------------------------------- | Facility : libnform --- ncurses-5.4/form/fty_enum.c~visibility.patch +++ ncurses-5.4/form/fty_enum.c @@ -290,6 +290,6 @@ Previous_Enum }; -NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ENUM = &typeENUM; +FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_ENUM) = &typeENUM; /* fty_enum.c ends here */ --- ncurses-5.4/form/fty_ipv4.c~visibility.patch +++ ncurses-5.4/form/fty_ipv4.c @@ -76,6 +76,6 @@ NULL }; -NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4; +FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_IPV4) = &typeIPV4; /* fty_ipv4.c ends here */ --- ncurses-5.4/form/form.priv.h~visibility.patch +++ ncurses-5.4/form/form.priv.h @@ -112,7 +112,7 @@ #define C_BLANK ' ' #define is_blank(c) ((c)==C_BLANK) -extern NCURSES_EXPORT_VAR(const FIELDTYPE *) _nc_Default_FieldType; +extern const FIELDTYPE * NCURSES_EXPORT_VAR(_nc_Default_FieldType); extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*,va_list*,int*); extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*,const TypeArgument*, int*); --- ncurses-5.4/include/tic.h~visibility.patch +++ ncurses-5.4/include/tic.h @@ -117,7 +117,7 @@ #define DEBUG(n, a) /*nothing*/ #endif -extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; +extern unsigned NCURSES_EXPORT_VAR(_nc_tracing); extern NCURSES_EXPORT(void) _nc_tracef (char *, ...) GCC_PRINTFLIKE(1,2); extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); @@ -151,7 +151,7 @@ char *tk_valstring; /* value of capability (if a string) */ }; -extern NCURSES_EXPORT_VAR(struct token) _nc_curr_token; +extern struct token NCURSES_EXPORT_VAR(_nc_curr_token); /* * List of keynames with their corresponding code. @@ -161,7 +161,7 @@ int code; }; -extern NCURSES_EXPORT_VAR(const struct kn) _nc_key_names[]; +extern const struct kn NCURSES_EXPORT_VAR(_nc_key_names[]); /* * Offsets to string capabilities, with the corresponding functionkey @@ -179,7 +179,7 @@ #else -extern NCURSES_EXPORT_VAR(struct tinfo_fkeys) _nc_tinfo_fkeys[]; +extern struct tinfo_fkeys NCURSES_EXPORT_VAR(_nc_tinfo_fkeys[]); #endif @@ -204,11 +204,11 @@ const char *source; }; -extern NCURSES_EXPORT_VAR(const struct name_table_entry * const) _nc_info_hash_table[]; -extern NCURSES_EXPORT_VAR(const struct name_table_entry * const) _nc_cap_hash_table[]; +extern const struct name_table_entry * const NCURSES_EXPORT_VAR(_nc_info_hash_table[]); +extern const struct name_table_entry * const NCURSES_EXPORT_VAR(_nc_cap_hash_table[]); -extern NCURSES_EXPORT_VAR(const struct alias) _nc_capalias_table[]; -extern NCURSES_EXPORT_VAR(const struct alias) _nc_infoalias_table[]; +extern const struct alias NCURSES_EXPORT_VAR(_nc_capalias_table[]); +extern const struct alias NCURSES_EXPORT_VAR(_nc_infoalias_table[]); extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool); extern NCURSES_EXPORT(const struct name_table_entry * const *) _nc_get_hash_table (bool); @@ -255,13 +255,13 @@ extern NCURSES_EXPORT(void) _nc_panic_mode (char); extern NCURSES_EXPORT(void) _nc_push_token (int); extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *); -extern NCURSES_EXPORT_VAR(int) _nc_curr_col; -extern NCURSES_EXPORT_VAR(int) _nc_curr_line; -extern NCURSES_EXPORT_VAR(int) _nc_syntax; -extern NCURSES_EXPORT_VAR(long) _nc_comment_end; -extern NCURSES_EXPORT_VAR(long) _nc_comment_start; -extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos; -extern NCURSES_EXPORT_VAR(long) _nc_start_line; +extern int NCURSES_EXPORT_VAR(_nc_curr_col); +extern int NCURSES_EXPORT_VAR(_nc_curr_line); +extern int NCURSES_EXPORT_VAR(_nc_syntax); +extern long NCURSES_EXPORT_VAR(_nc_comment_end); +extern long NCURSES_EXPORT_VAR(_nc_comment_start); +extern long NCURSES_EXPORT_VAR(_nc_curr_file_pos); +extern long NCURSES_EXPORT_VAR(_nc_start_line); #define SYN_TERMINFO 0 #define SYN_TERMCAP 1 @@ -272,7 +272,7 @@ extern NCURSES_EXPORT(void) _nc_syserr_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; extern NCURSES_EXPORT(void) _nc_err_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; extern NCURSES_EXPORT(void) _nc_warning (const char *const,...) GCC_PRINTFLIKE(1,2); -extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings; +extern bool NCURSES_EXPORT_VAR(_nc_suppress_warnings); /* comp_expand.c: expand string into readable form */ extern NCURSES_EXPORT(char *) _nc_tic_expand (const char *, bool, int); @@ -287,12 +287,12 @@ /* lib_tparm.c */ #define NUM_PARM 9 -extern NCURSES_EXPORT_VAR(int) _nc_tparm_err; +extern int NCURSES_EXPORT_VAR(_nc_tparm_err); extern NCURSES_EXPORT(int) _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount); /* lib_tputs.c */ -extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent */ +extern int NCURSES_EXPORT_VAR(_nc_nulls_sent); /* Add one for every null sent */ /* comp_main.c: compiler main */ extern const char * _nc_progname; --- ncurses-5.4/include/MKterm.h.awk.in~visibility.patch +++ ncurses-5.4/include/MKterm.h.awk.in @@ -228,9 +228,9 @@ print " char * _termname; /* used for termname() */" print "} TERMINAL;" print "" - print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;" + print "extern TERMINAL * NCURSES_EXPORT_VAR(cur_term);" print "" - print "#if BROKEN_LINKER" + print "#if defined(BROKEN_LINKER)" print "#define boolnames _nc_boolnames()" print "#define boolcodes _nc_boolcodes()" print "#define boolfnames _nc_boolfnames()" @@ -253,15 +253,15 @@ print "" print "#else" print "" - print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];" - print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];" - print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];" - print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];" - print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];" - print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];" - print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];" - print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];" - print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];" + print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(boolnames[]);" + print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(boolcodes[]);" + print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(boolfnames[]);" + print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(numnames[]);" + print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(numcodes[]);" + print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(numfnames[]);" + print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(strnames[]);" + print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(strcodes[]);" + print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(strfnames[]);" print "" print "#endif" print "" @@ -287,7 +287,7 @@ print "#if !defined(__NCURSES_H)" print "extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);" print "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);" - print "extern NCURSES_EXPORT_VAR(char) ttytype[];" + print "extern char NCURSES_EXPORT_VAR(ttytype[]);" print "extern NCURSES_EXPORT(int) putp (const char *);" print "extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);" print "extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);" --- ncurses-5.4/include/termcap.h.in~visibility.patch +++ ncurses-5.4/include/termcap.h.in @@ -54,10 +54,10 @@ #undef NCURSES_OSPEED #define NCURSES_OSPEED @NCURSES_OSPEED@ -extern NCURSES_EXPORT_VAR(char) PC; -extern NCURSES_EXPORT_VAR(char *) UP; -extern NCURSES_EXPORT_VAR(char *) BC; -extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed; +extern char NCURSES_EXPORT_VAR(PC); +extern char * NCURSES_EXPORT_VAR(UP); +extern char * NCURSES_EXPORT_VAR(BC); +extern NCURSES_OSPEED NCURSES_EXPORT_VAR(ospeed); #if !defined(NCURSES_TERM_H_incl) extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **); --- ncurses-5.4/include/term_entry.h~visibility.patch +++ ncurses-5.4/include/term_entry.h @@ -90,8 +90,8 @@ #define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names) #define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names) -extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head; -extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail; +extern ENTRY * NCURSES_EXPORT_VAR(_nc_head); +extern ENTRY * NCURSES_EXPORT_VAR(_nc_tail); #define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next) #define MAX_LINE 132 @@ -135,8 +135,8 @@ /* parse_entry.c: entry-parsing code */ #if NCURSES_XNAMES -extern NCURSES_EXPORT_VAR(bool) _nc_user_definable; -extern NCURSES_EXPORT_VAR(bool) _nc_disable_period; +extern bool NCURSES_EXPORT_VAR(_nc_user_definable); +extern bool NCURSES_EXPORT_VAR(_nc_disable_period); #endif extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool); extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *); --- ncurses-5.4/include/curses.h.in~visibility.patch +++ ncurses-5.4/include/curses.h.in @@ -171,8 +171,8 @@ #define WA_VERTICAL A_VERTICAL /* colors */ -extern NCURSES_EXPORT_VAR(int) COLORS; -extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS; +extern int NCURSES_EXPORT_VAR(COLORS); +extern int NCURSES_EXPORT_VAR(COLOR_PAIRS); #define COLOR_BLACK 0 #define COLOR_RED 1 @@ -186,10 +186,10 @@ /* line graphics */ #if @BROKEN_LINKER@ -extern NCURSES_EXPORT_VAR(chtype*) _nc_acs_map(void); +extern chtype* NCURSES_EXPORT_VAR(_nc_acs_map)(void); #define acs_map (_nc_acs_map()) #else -extern NCURSES_EXPORT_VAR(chtype) acs_map[]; +extern chtype NCURSES_EXPORT_VAR(acs_map[]); #endif #define NCURSES_ACS(c) (acs_map[(unsigned char)c]) @@ -369,20 +369,20 @@ #endif }; -extern NCURSES_EXPORT_VAR(WINDOW *) stdscr; -extern NCURSES_EXPORT_VAR(WINDOW *) curscr; -extern NCURSES_EXPORT_VAR(WINDOW *) newscr; +extern WINDOW * NCURSES_EXPORT_VAR(stdscr); +extern WINDOW * NCURSES_EXPORT_VAR(curscr); +extern WINDOW * NCURSES_EXPORT_VAR(newscr); -extern NCURSES_EXPORT_VAR(int) LINES; -extern NCURSES_EXPORT_VAR(int) COLS; -extern NCURSES_EXPORT_VAR(int) TABSIZE; +extern int NCURSES_EXPORT_VAR(LINES); +extern int NCURSES_EXPORT_VAR(COLS); +extern int NCURSES_EXPORT_VAR(TABSIZE); /* * This global was an undocumented feature under AIX curses. */ -extern NCURSES_EXPORT_VAR(int) ESCDELAY; /* ESC expire time in milliseconds */ +extern int NCURSES_EXPORT_VAR(ESCDELAY); /* ESC expire time in milliseconds */ -extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */ +extern char NCURSES_EXPORT_VAR(ttytype[]); /* needed for backward compatibility */ /* * These functions are extensions - not in XSI Curses. --- ncurses-5.4/include/curses.tail~visibility.patch +++ ncurses-5.4/include/curses.tail @@ -110,7 +110,7 @@ #define TRACE_MAXIMUM ((1 << TRACE_SHIFT) - 1) /* maximum trace level */ #if defined(TRACE) || defined(NCURSES_TEST) -extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */ +extern int NCURSES_EXPORT_VAR(_nc_optimize_enable); /* enable optimizations */ #ifdef _XOPEN_SOURCE_EXTENDED extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *); #endif --- ncurses-5.4/include/curses.wide~visibility.patch +++ ncurses-5.4/include/curses.wide @@ -3,7 +3,7 @@ /* $Id: curses.wide,v 1.28 2004/01/03 20:35:14 tom Exp $ */ -extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs; +extern cchar_t * NCURSES_EXPORT_VAR(_nc_wacs); #define NCURSES_WACS(c) (&_nc_wacs[(unsigned char)c]) --- ncurses-5.4/menu/menu.priv.h~visibility.patch +++ ncurses-5.4/menu/menu.priv.h @@ -49,8 +49,8 @@ /* Backspace code */ #define BS (8) -extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item; -extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; +extern ITEM NCURSES_EXPORT_VAR(_nc_Default_Item); +extern MENU NCURSES_EXPORT_VAR(_nc_Default_Menu); /* Normalize item to default if none was given */ #define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item) --- ncurses-5.4/menu/m_global.c~visibility.patch +++ ncurses-5.4/menu/m_global.c @@ -41,7 +41,7 @@ static char mark[] = "-"; -NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { +MENU NCURSES_EXPORT_VAR(_nc_Default_Menu) = { 16, /* Nr. of chars high */ 1, /* Nr. of chars wide */ 16, /* Nr. of items high */ @@ -80,7 +80,7 @@ 0 /* status */ }; -NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = { +ITEM NCURSES_EXPORT_VAR(_nc_Default_Item) = { { (char *)0, 0 }, /* name */ { (char *)0, 0 }, /* description */ (MENU *)0, /* Pointer to parent menu */ --- ncurses-5.4/ncurses/tty/lib_mvcur.c~visibility.patch +++ ncurses-5.4/ncurses/tty/lib_mvcur.c @@ -937,7 +937,7 @@ } #if defined(TRACE) || defined(NCURSES_TEST) -NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL; +int NCURSES_EXPORT_VAR(_nc_optimize_enable) = OPTIMIZE_ALL; #endif #if defined(MAIN) || defined(NCURSES_TEST) @@ -950,7 +950,7 @@ #include #include -NCURSES_EXPORT_VAR(const char *) _nc_progname = "mvcur"; +const char * NCURSES_EXPORT_VAR(_nc_progname) = "mvcur"; static unsigned long xmits; --- ncurses-5.4/ncurses/tty/hardscroll.c~visibility.patch +++ ncurses-5.4/ncurses/tty/hardscroll.c @@ -151,8 +151,7 @@ # undef screen_lines # define screen_lines MAXLINES -NCURSES_EXPORT_VAR(int) -oldnums[MAXLINES]; +int NCURSES_EXPORT_VAR(oldnums[MAXLINES]); # define OLDNUM(n) oldnums[n] # define _tracef printf # undef TR @@ -163,8 +162,7 @@ /* OLDNUM(n) indicates which line will be shifted to the position n. if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from somewhere. */ -NCURSES_EXPORT_VAR(int *) -_nc_oldnums = 0; +int * NCURSES_EXPORT_VAR(_nc_oldnums) = 0; # if USE_HASHMAP static int oldnums_allocated = 0; --- ncurses-5.4/ncurses/base/lib_getch.c~visibility.patch +++ ncurses-5.4/ncurses/base/lib_getch.c @@ -44,8 +44,7 @@ #include -NCURSES_EXPORT_VAR(int) -ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */ +int NCURSES_EXPORT_VAR(ESCDELAY) = 1000; /* max interval betw. chars in funkeys, in millisecs */ #ifdef NCURSES_WGETCH_EVENTS #define TWAIT_MASK 7 --- ncurses-5.4/ncurses/base/lib_slk.c~visibility.patch +++ ncurses-5.4/ncurses/base/lib_slk.c @@ -47,8 +47,7 @@ * We'd like to move these into the screen context structure, but cannot, * because slk_init() is called before initscr()/newterm(). */ -NCURSES_EXPORT_VAR(int) -_nc_slk_format = 0; /* one more than format specified in slk_init() */ +int NCURSES_EXPORT_VAR(_nc_slk_format) = 0; /* one more than format specified in slk_init() */ /* * Paint the info line for the PC style SLK emulation. --- ncurses-5.4/ncurses/base/lib_color.c~visibility.patch +++ ncurses-5.4/ncurses/base/lib_color.c @@ -48,8 +48,8 @@ * historical reasons. So we assign them in start_color() and also in * set_term()'s screen-switching logic. */ -NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0; -NCURSES_EXPORT_VAR(int) COLORS = 0; +int NCURSES_EXPORT_VAR(COLOR_PAIRS) = 0; +int NCURSES_EXPORT_VAR(COLORS) = 0; #define DATA(r,g,b) {r,g,b, 0,0,0, 0} --- ncurses-5.4/ncurses/tinfo/lib_termcap.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/lib_termcap.c @@ -50,8 +50,8 @@ #define L_BRACK '[' #define SHIFT_OUT 017 /* ^N */ -NCURSES_EXPORT_VAR(char *) UP = 0; -NCURSES_EXPORT_VAR(char *) BC = 0; +char * NCURSES_EXPORT_VAR(UP) = 0; +char * NCURSES_EXPORT_VAR(BC) = 0; static char *fix_me = 0; --- ncurses-5.4/ncurses/tinfo/lib_cur_term.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/lib_cur_term.c @@ -42,7 +42,7 @@ MODULE_ID("$Id: lib_cur_term.c,v 1.13 2003/12/27 18:21:30 tom Exp $") -NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; +TERMINAL * NCURSES_EXPORT_VAR(cur_term) = 0; NCURSES_EXPORT(TERMINAL *) set_curterm(TERMINAL * termp) --- ncurses-5.4/ncurses/tinfo/lib_setup.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/lib_setup.c @@ -91,10 +91,10 @@ # endif #endif -NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = ""; -NCURSES_EXPORT_VAR(int) LINES = 0; -NCURSES_EXPORT_VAR(int) COLS = 0; -NCURSES_EXPORT_VAR(int) TABSIZE = 0; +char NCURSES_EXPORT_VAR(ttytype[NAMESIZE]) = ""; +int NCURSES_EXPORT_VAR(LINES) = 0; +int NCURSES_EXPORT_VAR(COLS) = 0; +int NCURSES_EXPORT_VAR(TABSIZE) = 0; static int _use_env = TRUE; --- ncurses-5.4/ncurses/tinfo/MKnames.awk~visibility.patch +++ ncurses-5.4/ncurses/tinfo/MKnames.awk @@ -10,7 +10,7 @@ print "#include " > "namehdr" print "#define DCL(it) static IT data##it[]" > "namehdr" print "#else" > "namehdr" - print "#define DCL(it) NCURSES_EXPORT_VAR(IT) it[]" > "namehdr" + print "#define DCL(it) IT NCURSES_EXPORT_VAR(it[])" > "namehdr" print "#endif" > "namehdr" print "" > "namehdr" print "/*" > "boolnames" --- ncurses-5.4/ncurses/tinfo/lib_tparm.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/lib_tparm.c @@ -115,7 +115,7 @@ bool num_type; } stack_frame; -NCURSES_EXPORT_VAR(int) _nc_tparm_err = 0; +int NCURSES_EXPORT_VAR(_nc_tparm_err) = 0; static stack_frame stack[STACKSIZE]; static int stack_ptr; --- ncurses-5.4/ncurses/tinfo/lib_tputs.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/lib_tputs.c @@ -47,10 +47,10 @@ MODULE_ID("$Id: lib_tputs.c,v 1.62 2003/08/23 21:39:20 tom Exp $") -NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ -NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ +char NCURSES_EXPORT_VAR(PC) = 0; /* used by termcap library */ +NCURSES_OSPEED NCURSES_EXPORT_VAR(ospeed) = 0; /* used by termcap library */ -NCURSES_EXPORT_VAR(int) _nc_nulls_sent = 0; /* used by 'tack' program */ +int NCURSES_EXPORT_VAR(_nc_nulls_sent) = 0; /* used by 'tack' program */ static int (*my_outch) (int c) = _nc_outch; --- ncurses-5.4/ncurses/tinfo/comp_error.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/comp_error.c @@ -42,9 +42,9 @@ MODULE_ID("$Id: comp_error.c,v 1.25 2002/09/07 20:05:07 tom Exp $") -NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE; -NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */ -NCURSES_EXPORT_VAR(int) _nc_curr_col = 0; /* current column # in input */ +bool NCURSES_EXPORT_VAR(_nc_suppress_warnings) = FALSE; +int NCURSES_EXPORT_VAR(_nc_curr_line) = 0; /* current line # in input */ +int NCURSES_EXPORT_VAR(_nc_curr_col) = 0; /* current column # in input */ static const char *sourcename; static char *termtype; --- ncurses-5.4/ncurses/tinfo/free_ttype.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/free_ttype.c @@ -92,7 +92,7 @@ } #if NCURSES_XNAMES -NCURSES_EXPORT_VAR(bool) _nc_user_definable = TRUE; +bool NCURSES_EXPORT_VAR(_nc_user_definable) = TRUE; NCURSES_EXPORT(int) use_extended_names(bool flag) --- ncurses-5.4/ncurses/tinfo/comp_parse.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/comp_parse.c @@ -78,8 +78,8 @@ * _nc_head _nc_tail */ -NCURSES_EXPORT_VAR(ENTRY *) _nc_head = 0; -NCURSES_EXPORT_VAR(ENTRY *) _nc_tail = 0; +ENTRY * NCURSES_EXPORT_VAR(_nc_head) = 0; +ENTRY * NCURSES_EXPORT_VAR(_nc_tail) = 0; static void enqueue(ENTRY * ep) --- ncurses-5.4/ncurses/tinfo/comp_scan.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/comp_scan.c @@ -60,19 +60,13 @@ #define iswhite(ch) (ch == ' ' || ch == '\t') -NCURSES_EXPORT_VAR(int) -_nc_syntax = 0; /* termcap or terminfo? */ -NCURSES_EXPORT_VAR(long) -_nc_curr_file_pos = 0; /* file offset of current line */ -NCURSES_EXPORT_VAR(long) -_nc_comment_start = 0; /* start of comment range before name */ -NCURSES_EXPORT_VAR(long) -_nc_comment_end = 0; /* end of comment range before name */ -NCURSES_EXPORT_VAR(long) -_nc_start_line = 0; /* start line of current entry */ +int NCURSES_EXPORT_VAR(_nc_syntax) = 0; /* termcap or terminfo? */ +long NCURSES_EXPORT_VAR(_nc_curr_file_pos) = 0; /* file offset of current line */ +long NCURSES_EXPORT_VAR(_nc_comment_start) = 0; /* start of comment range before name */ +long NCURSES_EXPORT_VAR(_nc_comment_end) = 0; /* end of comment range before name */ +long NCURSES_EXPORT_VAR(_nc_start_line) = 0; /* start line of current entry */ -NCURSES_EXPORT_VAR(struct token) -_nc_curr_token = +struct token NCURSES_EXPORT_VAR(_nc_curr_token) = { 0, 0, 0 }; @@ -90,8 +84,7 @@ static char *pushname; #if NCURSES_EXT_FUNCS -NCURSES_EXPORT_VAR(bool) -_nc_disable_period = FALSE; /* used by tic -a option */ +bool NCURSES_EXPORT_VAR(_nc_disable_period) = FALSE; /* used by tic -a option */ #endif static bool end_of_stream(void); --- ncurses-5.4/ncurses/tinfo/lib_acs.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/lib_acs.c @@ -37,8 +37,7 @@ MODULE_ID("$Id: lib_acs.c,v 1.25 2002/12/28 16:26:46 tom Exp $") #if BROKEN_LINKER -NCURSES_EXPORT_VAR(chtype *) -_nc_acs_map(void) +chtype * NCURSES_EXPORT_VAR(_nc_acs_map)(void) { static chtype *the_map = 0; if (the_map == 0) @@ -46,7 +45,7 @@ return the_map; } #else -NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] = +chtype NCURSES_EXPORT_VAR(acs_map[ACS_LEN]) = { 0 }; --- ncurses-5.4/ncurses/tinfo/lib_data.c~visibility.patch +++ ncurses-5.4/ncurses/tinfo/lib_data.c @@ -46,14 +46,11 @@ * OS/2's native linker complains if we don't initialize public data when * constructing a dll (reported by J.J.G.Ripoll). */ -NCURSES_EXPORT_VAR(WINDOW *) -stdscr = 0; -NCURSES_EXPORT_VAR(WINDOW *) -curscr = 0; -NCURSES_EXPORT_VAR(WINDOW *) -newscr = 0; +WINDOW * NCURSES_EXPORT_VAR(stdscr) = 0; +WINDOW * NCURSES_EXPORT_VAR(curscr) = 0; +WINDOW * NCURSES_EXPORT_VAR(newscr) = 0; -NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain = 0; +SCREEN * NCURSES_EXPORT_VAR(_nc_screen_chain) = 0; /* * The variable 'SP' will be defined as a function on systems that cannot link @@ -87,5 +84,5 @@ } #else -NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */ +SCREEN * NCURSES_EXPORT_VAR(SP) = NULL; /* Some linkers require initialized data... */ #endif --- ncurses-5.4/ncurses/trace/lib_trace.c~visibility.patch +++ ncurses-5.4/ncurses/trace/lib_trace.c @@ -42,11 +42,11 @@ MODULE_ID("$Id: lib_trace.c,v 1.53 2003/11/23 00:39:30 tom Exp $") -NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ +unsigned NCURSES_EXPORT_VAR(_nc_tracing) = 0; /* always define this */ #ifdef TRACE -NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace = ""; -NCURSES_EXPORT_VAR(long) _nc_outchars = 0; +const char * NCURSES_EXPORT_VAR(_nc_tputs_trace) = ""; +long NCURSES_EXPORT_VAR(_nc_outchars) = 0; static FILE *tracefp = 0; /* default to writing to stderr */ --- ncurses-5.4/ncurses/curses.priv.h~visibility.patch +++ ncurses-5.4/ncurses/curses.priv.h @@ -498,7 +498,7 @@ #endif }; -extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain; +extern SCREEN * NCURSES_EXPORT_VAR(_nc_screen_chain); #if NCURSES_NOMACROS #include @@ -752,9 +752,9 @@ extern NCURSES_EXPORT(int) _nc_retrace_int (int); extern NCURSES_EXPORT(unsigned) _nc_retrace_unsigned (unsigned); extern NCURSES_EXPORT(void) _nc_fifo_dump (void); -extern NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace; -extern NCURSES_EXPORT_VAR(long) _nc_outchars; -extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; +extern const char * NCURSES_EXPORT_VAR(_nc_tputs_trace); +extern long NCURSES_EXPORT_VAR(_nc_outchars); +extern unsigned NCURSES_EXPORT_VAR(_nc_tracing); #if USE_WIDEC_SUPPORT extern NCURSES_EXPORT(const char *) _nc_viswbuf2 (int, const wchar_t *); @@ -1055,7 +1055,7 @@ #endif /* scroll indices */ -extern NCURSES_EXPORT_VAR(int *) _nc_oldnums; +extern int * NCURSES_EXPORT_VAR(_nc_oldnums); #define USE_SETBUF_0 0 @@ -1074,7 +1074,7 @@ extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *); #else /* current screen is private data; avoid possible linking conflicts too */ -extern NCURSES_EXPORT_VAR(SCREEN *) SP; +extern SCREEN * NCURSES_EXPORT_VAR(SP); #define _nc_alloc_screen() ((SP = typeCalloc(SCREEN, 1)) != 0) #define _nc_set_screen(sp) SP = sp #endif @@ -1087,7 +1087,7 @@ #define screen_lines SP->_lines #define screen_columns SP->_columns -extern NCURSES_EXPORT_VAR(int) _nc_slk_format; /* != 0 if slk_init() called */ +extern int NCURSES_EXPORT_VAR(_nc_slk_format); /* != 0 if slk_init() called */ extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int); /* --- /dev/null +++ ncurses-5.4/m4/cf.m4 @@ -0,0 +1,3703 @@ +dnl*************************************************************************** +dnl Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. * +dnl * +dnl Permission is hereby granted, free of charge, to any person obtaining a * +dnl copy of this software and associated documentation files (the * +dnl "Software"), to deal in the Software without restriction, including * +dnl without limitation the rights to use, copy, modify, merge, publish, * +dnl distribute, distribute with modifications, sublicense, and/or sell * +dnl copies of the Software, and to permit persons to whom the Software is * +dnl furnished to do so, subject to the following conditions: * +dnl * +dnl The above copyright notice and this permission notice shall be included * +dnl in all copies or substantial portions of the Software. * +dnl * +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +dnl * +dnl Except as contained in this notice, the name(s) of the above copyright * +dnl holders shall not be used in advertising or otherwise to promote the * +dnl sale, use or other dealings in this Software without prior written * +dnl authorization. * +dnl*************************************************************************** +dnl +dnl Author: Thomas E. Dickey 1995-2003 +dnl +dnl $Id: aclocal.m4,v 1.333 2004/01/30 20:59:56 tom Exp $ +dnl Macros used in NCURSES auto-configuration script. +dnl +dnl See http://invisible-island.net/autoconf/ for additional information. +dnl +dnl --------------------------------------------------------------------------- +dnl --------------------------------------------------------------------------- +dnl CF_ADA_INCLUDE_DIRS version: 4 updated: 2002/12/01 00:12:15 +dnl ------------------- +dnl Construct the list of include-options for the C programs in the Ada95 +dnl binding. +AC_DEFUN([CF_ADA_INCLUDE_DIRS], +[ +ACPPFLAGS="-I. -I../../include $ACPPFLAGS" +if test "$srcdir" != "."; then + ACPPFLAGS="-I\$(srcdir)/../../include $ACPPFLAGS" +fi +if test "$GCC" != yes; then + ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" +elif test "$includedir" != "/usr/include"; then + if test "$includedir" = '${prefix}/include' ; then + if test $prefix != /usr ; then + ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" + fi + else + ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" + fi +fi +AC_SUBST(ACPPFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_CFLAGS version: 5 updated: 2002/12/01 00:12:15 +dnl ------------- +dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS +dnl The second parameter if given makes this macro verbose. +AC_DEFUN([CF_ADD_CFLAGS], +[ +cf_new_cflags= +cf_new_cppflags= +for cf_add_cflags in $1 +do + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac +done + +if test -n "$cf_new_cflags" ; then + ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" +fi + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34 +dnl ---------------- +dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' +dnl in the sharutils 4.2 distribution. +AC_DEFUN([CF_ANSI_CC_CHECK], +[ +AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[ +cf_cv_ansi_cc=no +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc +# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) +for cf_arg in "-DCC_HAS_PROTOS" \ + "" \ + -qlanglvl=ansi \ + -std1 \ + -Ae \ + "-Aa -D_HPUX_SOURCE" \ + -Xc +do + CF_ADD_CFLAGS($cf_arg) + AC_TRY_COMPILE( +[ +#ifndef CC_HAS_PROTOS +#if !defined(__STDC__) || (__STDC__ != 1) +choke me +#endif +#endif +],[ + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);};], + [cf_cv_ansi_cc="$cf_arg"; break]) +done +CFLAGS="$cf_save_CFLAGS" +CPPFLAGS="$cf_save_CPPFLAGS" +]) + +if test "$cf_cv_ansi_cc" != "no"; then +if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then + CF_ADD_CFLAGS($cf_cv_ansi_cc) +else + AC_DEFINE(CC_HAS_PROTOS) +fi +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44 +dnl --------------- +dnl For programs that must use an ANSI compiler, obtain compiler options that +dnl will make it recognize prototypes. We'll do preprocessor checks in other +dnl macros, since tools such as unproto can fake prototypes, but only part of +dnl the preprocessor. +AC_DEFUN([CF_ANSI_CC_REQD], +[AC_REQUIRE([CF_ANSI_CC_CHECK]) +if test "$cf_cv_ansi_cc" = "no"; then + AC_ERROR( +[Your compiler does not appear to recognize prototypes. +You have the following choices: + a. adjust your compiler options + b. get an up-to-date compiler + c. use a wrapper such as unproto]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18 +dnl ------------ +dnl Test if 'bool' is a builtin type in the configured C++ compiler. Some +dnl older compilers (e.g., gcc 2.5.8) don't support 'bool' directly; gcc +dnl 2.6.3 does, in anticipation of the ANSI C++ standard. +dnl +dnl Treat the configuration-variable specially here, since we're directly +dnl substituting its value (i.e., 1/0). +dnl +dnl $1 is the shell variable to store the result in, if not $cv_cv_builtin_bool +AC_DEFUN([CF_BOOL_DECL], +[ +AC_MSG_CHECKING(if we should include stdbool.h) + +AC_CACHE_VAL(cf_cv_header_stdbool_h,[ + AC_TRY_COMPILE([],[bool foo = false], + [cf_cv_header_stdbool_h=0], + [AC_TRY_COMPILE([ +#ifndef __BEOS__ +#include +#endif +],[bool foo = false], + [cf_cv_header_stdbool_h=1], + [cf_cv_header_stdbool_h=0])])]) + +if test "$cf_cv_header_stdbool_h" = 1 +then AC_MSG_RESULT(yes) +else AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING([for builtin bool type]) + +AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[ + AC_TRY_COMPILE([ +#include +#include +],[bool x = false], + [ifelse($1,,cf_cv_builtin_bool,[$1])=1], + [ifelse($1,,cf_cv_builtin_bool,[$1])=0]) + ]) + +if test "$ifelse($1,,cf_cv_builtin_bool,[$1])" = 1 +then AC_MSG_RESULT(yes) +else AC_MSG_RESULT(no) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_BOOL_SIZE version: 10 updated: 2002/02/23 20:38:31 +dnl ------------ +dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type). +dnl Don't bother looking for bool.h, since it's been deprecated. +dnl +dnl If the current compiler is C rather than C++, we get the bool definition +dnl from . +AC_DEFUN([CF_BOOL_SIZE], +[ +AC_MSG_CHECKING([for size of bool]) +AC_CACHE_VAL(cf_cv_type_of_bool,[ + rm -f cf_test.out + AC_TRY_RUN([ +#include +#include + +#if defined(__cplusplus) + +#ifdef HAVE_GXX_BUILTIN_H +#include +#elif HAVE_GPP_BUILTIN_H +#include +#elif HAVE_BUILTIN_H +#include +#endif + +#else + +#if $cf_cv_header_stdbool_h +#include +#endif + +#endif + +main() +{ + FILE *fp = fopen("cf_test.out", "w"); + if (fp != 0) { + bool x = true; + if ((bool)(-x) >= 0) + fputs("unsigned ", fp); + if (sizeof(x) == sizeof(int)) fputs("int", fp); + else if (sizeof(x) == sizeof(char)) fputs("char", fp); + else if (sizeof(x) == sizeof(short))fputs("short",fp); + else if (sizeof(x) == sizeof(long)) fputs("long", fp); + fclose(fp); + } + exit(0); +} + ], + [cf_cv_type_of_bool=`cat cf_test.out` + if test -z "$cf_cv_type_of_bool"; then + cf_cv_type_of_bool=unknown + fi], + [cf_cv_type_of_bool=unknown], + [cf_cv_type_of_bool=unknown]) + ]) + rm -f cf_test.out +AC_MSG_RESULT($cf_cv_type_of_bool) +if test "$cf_cv_type_of_bool" = unknown ; then + case .$NCURSES_BOOL in #(vi + .auto|.) NCURSES_BOOL=unsigned;; + esac + AC_MSG_WARN(Assuming $NCURSES_BOOL for type of bool) + cf_cv_type_of_bool=$NCURSES_BOOL +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CFG_DEFAULTS version: 6 updated: 2003/07/12 15:15:19 +dnl --------------- +dnl Determine the default configuration into which we'll install ncurses. This +dnl can be overridden by the user's command-line options. There's two items to +dnl look for: +dnl 1. the prefix (e.g., /usr) +dnl 2. the header files (e.g., /usr/include/ncurses) +dnl We'll look for a previous installation of ncurses and use the same defaults. +dnl +dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and +dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's +dnl programs from a vendor's. +AC_DEFUN([CF_CFG_DEFAULTS], +[ +AC_MSG_CHECKING(for prefix) +if test "x$prefix" = "xNONE" ; then + case "$cf_cv_system_name" in + # non-vendor systems don't have a conflict + openbsd*|netbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu) + prefix=/usr + ;; + *) prefix=$ac_default_prefix + ;; + esac +fi +AC_MSG_RESULT($prefix) + +if test "x$prefix" = "xNONE" ; then +AC_MSG_CHECKING(for default include-directory) +test -n "$verbose" && echo 1>&AC_FD_MSG +for cf_symbol in \ + $includedir \ + $includedir/ncurses \ + $prefix/include \ + $prefix/include/ncurses \ + /usr/local/include \ + /usr/local/include/ncurses \ + /usr/include \ + /usr/include/ncurses +do + cf_dir=`eval echo $cf_symbol` + if test -f $cf_dir/curses.h ; then + if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then + includedir="$cf_symbol" + test -n "$verbose" && echo $ac_n " found " 1>&AC_FD_MSG + break + fi + fi + test -n "$verbose" && echo " tested $cf_dir" 1>&AC_FD_MSG +done +AC_MSG_RESULT($includedir) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CGETENT version: 3 updated: 2000/08/12 23:18:52 +dnl ---------- +dnl Check if the terminal-capability database functions are available. If not, +dnl ncurses has a much-reduced version. +AC_DEFUN([CF_CGETENT],[ +AC_MSG_CHECKING(for terminal-capability database functions) +AC_CACHE_VAL(cf_cv_cgetent,[ +AC_TRY_LINK([ +#include ],[ + char temp[128]; + char *buf = temp; + char *db_array = temp; + cgetent(&buf, /* int *, */ &db_array, "vt100"); + cgetcap(buf, "tc", '='); + cgetmatch(buf, "tc"); + ], + [cf_cv_cgetent=yes], + [cf_cv_cgetent=no]) +]) +AC_MSG_RESULT($cf_cv_cgetent) +test "$cf_cv_cgetent" = yes && AC_DEFINE(HAVE_BSD_CGETENT) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CHECK_CACHE version: 9 updated: 2004/01/30 15:59:13 +dnl -------------- +dnl Check if we're accidentally using a cache from a different machine. +dnl Derive the system name, as a check for reusing the autoconf cache. +dnl +dnl If we've packaged config.guess and config.sub, run that (since it does a +dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow +dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM +dnl which is useful in cross-compiles. +dnl +dnl Note: we would use $ac_config_sub, but that is one of the places where +dnl autoconf 2.5x broke compatibility with autoconf 2.13 +AC_DEFUN([CF_CHECK_CACHE], +[ +if test -f $srcdir/config.guess ; then + ifelse([$1],,[AC_CANONICAL_HOST],[$1]) + system_name="$host_os" +else + system_name="`(uname -s -r) 2>/dev/null`" + if test -z "$system_name" ; then + system_name="`(hostname) 2>/dev/null`" + fi +fi +test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") +AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) + +test -z "$system_name" && system_name="$cf_cv_system_name" +test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) + +if test ".$system_name" != ".$cf_cv_system_name" ; then + AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) + AC_ERROR("Please remove config.cache and try again.") +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23 +dnl -------------- +dnl Check for data that is usually declared in or , e.g., +dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it +dnl ourselves. +dnl +dnl $1 = the name to check +AC_DEFUN([CF_CHECK_ERRNO], +[ +AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ + AC_TRY_COMPILE([ +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#include +#include ], + [long x = (long) $1], + [cf_cv_dcl_$1=yes], + [cf_cv_dcl_$1=no]) +]) + +if test "$cf_cv_dcl_$1" = no ; then + CF_UPPER(cf_result,decl_$1) + AC_DEFINE_UNQUOTED($cf_result) +fi + +# It's possible (for near-UNIX clones) that the data doesn't exist +CF_CHECK_EXTERN_DATA($1,int) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23 +dnl -------------------- +dnl Check for existence of external data in the current set of libraries. If +dnl we can modify it, it's real enough. +dnl $1 = the name to check +dnl $2 = its type +AC_DEFUN([CF_CHECK_EXTERN_DATA], +[ +AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[ + AC_TRY_LINK([ +#undef $1 +extern $2 $1; +], + [$1 = 2], + [cf_cv_have_$1=yes], + [cf_cv_have_$1=no]) +]) + +if test "$cf_cv_have_$1" = yes ; then + CF_UPPER(cf_result,have_$1) + AC_DEFINE_UNQUOTED($cf_result) +fi + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CPP_PARAM_INIT version: 4 updated: 2001/04/07 22:31:18 +dnl ----------------- +dnl Check if the C++ compiler accepts duplicate parameter initialization. This +dnl is a late feature for the standard and is not in some recent compilers +dnl (1999/9/11). +AC_DEFUN([CF_CPP_PARAM_INIT], +[ +if test -n "$CXX"; then +AC_CACHE_CHECK(if $CXX accepts parameter initialization,cf_cv_cpp_param_init,[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_RUN([ +class TEST { +private: + int value; +public: + TEST(int x = 1); + ~TEST(); +}; + +TEST::TEST(int x = 1) // some compilers do not like second initializer +{ + value = x; +} +void main() { } +], + [cf_cv_cpp_param_init=yes], + [cf_cv_cpp_param_init=no], + [cf_cv_cpp_param_init=unknown]) + AC_LANG_RESTORE +]) +fi +test "$cf_cv_cpp_param_init" = yes && AC_DEFINE(CPP_HAS_PARAM_INIT) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CPP_VSCAN_FUNC version: 5 updated: 2001/12/02 01:39:28 +dnl ----------------- +dnl Check if the g++ compiler supports vscan function (not a standard feature). +AC_DEFUN([CF_CPP_VSCAN_FUNC], +[ +if test -n "$CXX"; then + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CHECK_HEADERS(strstream.h) + +AC_CACHE_CHECK(if $CXX supports vscan function,cf_cv_cpp_vscan_func,[ + for cf_vscan_func in strstream strstream_cast stdio + do + case $cf_vscan_func in #(vi + stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi + strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;; + strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;; + esac + AC_TRY_LINK([ +#include +#include +#define $cf_vscan_defs 1 +#if defined(USE_STDIO_VSCAN) +#elif defined(HAVE_STRSTREAM_H) && defined(USE_STRSTREAM_VSCAN) +#include +#endif + +int scanw(const char* fmt, ...) +{ + int result = -1; + char buf[BUFSIZ]; + + va_list args; + va_start(args, fmt); +#if defined(USE_STDIO_VSCAN) + if (::vsscanf(buf, fmt, args) != -1) + result = 0; +#elif defined(USE_STRSTREAM_VSCAN) + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) + result = 0; +#elif defined(USE_STRSTREAM_VSCAN_CAST) + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, (_IO_va_list)args) != -1) + result = 0; +#else +#error case $cf_vscan_func failed +#endif + va_end(args); + return result; +} +],[int tmp, foo = scanw("%d", &tmp)], + [cf_cv_cpp_vscan_func=$cf_vscan_func; break], + [cf_cv_cpp_vscan_func=no]) + test "$cf_cv_cpp_vscan_func" != no && break + done +]) + +AC_LANG_RESTORE +fi + +case $cf_cv_cpp_vscan_func in #(vi +stdio) #(vi + AC_DEFINE(CPP_HAS_VSCAN_FUNC) + AC_DEFINE(USE_STDIO_VSCAN) + ;; +strstream) + AC_DEFINE(CPP_HAS_VSCAN_FUNC) + AC_DEFINE(USE_STRSTREAM_VSCAN) + ;; +strstream_cast) + AC_DEFINE(CPP_HAS_VSCAN_FUNC) + AC_DEFINE(USE_STRSTREAM_VSCAN_CAST) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52 +dnl ---------- +dnl "dirname" is not portable, so we fake it with a shell script. +AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl +dnl --------------------------------------------------------------------------- +dnl CF_DIRS_TO_MAKE version: 3 updated: 2002/02/23 20:38:31 +dnl --------------- +AC_DEFUN([CF_DIRS_TO_MAKE], +[ +DIRS_TO_MAKE="lib" +for cf_item in $cf_list_models +do + CF_OBJ_SUBDIR($cf_item,cf_subdir) + for cf_item2 in $DIRS_TO_MAKE + do + test $cf_item2 = $cf_subdir && break + done + test ".$cf_item2" != ".$cf_subdir" && DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" +done +for cf_dir in $DIRS_TO_MAKE +do + test ! -d $cf_dir && mkdir $cf_dir +done +AC_SUBST(DIRS_TO_MAKE) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 +dnl -------- +dnl Check if 'errno' is declared in +AC_DEFUN([CF_ERRNO], +[ +CF_CHECK_ERRNO(errno) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ETIP_DEFINES version: 3 updated: 2003/03/22 19:13:43 +dnl --------------- +dnl Test for conflicting definitions of exception in gcc 2.8.0, etc., between +dnl math.h and builtin.h, only for ncurses +AC_DEFUN([CF_ETIP_DEFINES], +[ +AC_MSG_CHECKING(for special defines needed for etip.h) +cf_save_CXXFLAGS="$CXXFLAGS" +cf_result="none" +for cf_math in "" MATH_H +do +for cf_excp in "" MATH_EXCEPTION +do + CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu -I${srcdir}/include" + test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" + test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" +AC_TRY_COMPILE([ +#include +],[],[ + test -n "$cf_math" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_math}) + test -n "$cf_excp" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_excp}) + cf_result="$cf_math $cf_excp" + break +],[]) +done +done +AC_MSG_RESULT($cf_result) +CXXFLAGS="$cf_save_CXXFLAGS" +]) +dnl --------------------------------------------------------------------------- +dnl CF_FUNC_MEMMOVE version: 5 updated: 2000/08/12 23:18:52 +dnl --------------- +dnl Check for memmove, or a bcopy that can handle overlapping copy. If neither +dnl is found, add our own version of memmove to the list of objects. +AC_DEFUN([CF_FUNC_MEMMOVE], +[ +AC_CHECK_FUNC(memmove,,[ +AC_CHECK_FUNC(bcopy,[ + AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[ + AC_TRY_RUN([ +int main() { + static char data[] = "abcdefghijklmnopqrstuwwxyz"; + char temp[40]; + bcopy(data, temp, sizeof(data)); + bcopy(temp+10, temp, 15); + bcopy(temp+5, temp+15, 10); + exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz")); +} + ], + [cf_cv_good_bcopy=yes], + [cf_cv_good_bcopy=no], + [cf_cv_good_bcopy=unknown]) + ]) + ],[cf_cv_good_bcopy=no]) + if test "$cf_cv_good_bcopy" = yes ; then + AC_DEFINE(USE_OK_BCOPY) + else + AC_DEFINE(USE_MY_MEMMOVE) + fi +])])dnl +dnl --------------------------------------------------------------------------- +dnl CF_FUNC_POLL version: 2 updated: 2000/02/06 01:38:04 +dnl ------------ +dnl See if the poll function really works. Some platforms have poll(), but +dnl it does not work for terminals or files. +AC_DEFUN([CF_FUNC_POLL],[ +AC_CACHE_CHECK(if poll really works,cf_cv_working_poll,[ +AC_TRY_RUN([ +#include +#ifdef HAVE_POLL_H +#include +#else +#include +#endif +int main() { + struct pollfd myfds; + int ret; + + myfds.fd = 0; + myfds.events = POLLIN; + + ret = poll(&myfds, 1, 100); + exit(ret != 0); +}], + [cf_cv_working_poll=yes], + [cf_cv_working_poll=no], + [cf_cv_working_poll=unknown])]) +test "$cf_cv_working_poll" = "yes" && AC_DEFINE(HAVE_WORKING_POLL) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_FUNC_TERMIOS version: 2 updated: 2000/07/22 23:37:24 +dnl --------------- +dnl Some old/broken variations define tcgetattr() only as a macro in +dnl termio(s).h +AC_DEFUN([CF_FUNC_TERMIOS],[ +AC_REQUIRE([CF_STRUCT_TERMIOS]) +AC_CACHE_CHECK(for tcgetattr, cf_cv_have_tcgetattr,[ +AC_TRY_LINK([ +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_TERMIOS_H +#include +#define TTY struct termios +#else +#ifdef HAVE_TERMIO_H +#include +#define TTY struct termio +#endif +#endif +],[ +TTY foo; +tcgetattr(1, &foo);], +[cf_cv_have_tcgetattr=yes], +[cf_cv_have_tcgetattr=no])]) +test "$cf_cv_have_tcgetattr" = yes && AC_DEFINE(HAVE_TCGETATTR) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_FUNC_VSSCANF version: 3 updated: 2001/12/19 00:50:10 +dnl --------------- +dnl Check for vsscanf() function, which is in c9x but generally not in earlier +dnl versions of C. It is in the GNU C library, and can often be simulated by +dnl other functions. +AC_DEFUN([CF_FUNC_VSSCANF], +[ +AC_CACHE_CHECK(for vsscanf function or workaround,cf_cv_func_vsscanf,[ +AC_TRY_LINK([ +#include +#include ],[ + va_list ap; + vsscanf("from", "%d", ap)],[cf_cv_func_vsscanf=vsscanf],[ +AC_TRY_LINK([ +#include +#include ],[ + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (vfscanf(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=vfscanf],[ +AC_TRY_LINK([ +#include +#include ],[ + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (_doscan(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=_doscan],[ +cf_cv_func_vsscanf=no])])])]) + +case $cf_cv_func_vsscanf in #(vi +vsscanf) AC_DEFINE(HAVE_VSSCANF);; #(vi +vfscanf) AC_DEFINE(HAVE_VFSCANF);; #(vi +_doscan) AC_DEFINE(HAVE__DOSCAN);; +esac + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GCC_ATTRIBUTES version: 9 updated: 2002/12/21 19:25:52 +dnl ----------------- +dnl Test for availability of useful gcc __attribute__ directives to quiet +dnl compiler warnings. Though useful, not all are supported -- and contrary +dnl to documentation, unrecognized directives cause older compilers to barf. +AC_DEFUN([CF_GCC_ATTRIBUTES], +[ +if test "$GCC" = yes +then +cat > conftest.i < conftest.$ac_ext <&AC_FD_CC + case $cf_attribute in + scanf|printf) + cat >conftest.h <conftest.h <>confdefs.h + fi + done +else + fgrep define conftest.i >>confdefs.h +fi +rm -rf conftest* +fi +])dnl +dnl -------------------------