* demo/configure.in (AC_C_CONST): added, for portability

* mdemo/configure.in (AC_C_CONST): ditto
	* libltdl/configure.in (AC_C_CONST, AC_C_INLINE): ditto
	* libltdl/ltdl.c (LTDL_FILENAME_MAX): use FILENAME_MAX if defined
	(FILENAME_MAX): replace all explicit uses with LTDL_FILENAME_MAX
	(presym_free_symlists, trim): don't return void, for portability
	(lt_dlgetsearchpath): replace (void) with __P((void))
This commit is contained in:
Alexandre Oliva 1999-01-20 13:01:27 +00:00 committed by Alexandre Oliva
parent ee93981385
commit 3770203057
5 changed files with 25 additions and 7 deletions

View File

@ -1,5 +1,13 @@
1999-01-20 Alexandre Oliva <oliva@dcc.unicamp.br>
* demo/configure.in (AC_C_CONST): added, for portability
* mdemo/configure.in (AC_C_CONST): ditto
* libltdl/configure.in (AC_C_CONST, AC_C_INLINE): ditto
* libltdl/ltdl.c (LTDL_FILENAME_MAX): use FILENAME_MAX if defined
(FILENAME_MAX): replace all explicit uses with LTDL_FILENAME_MAX
(presym_free_symlists, trim): don't return void, for portability
(lt_dlgetsearchpath): replace (void) with __P((void))
* ltmain.in (compile): when compiling both PIC and non-PIC, write
the PIC object to .libs/.lo and only rename it to .lo after
compiling the .o, to avoid fooling make dependencies

View File

@ -3,6 +3,7 @@ AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hell,1.0)
AC_PROG_CC
AC_C_CONST
AC_EXEEXT
AM_PROG_LIBTOOL

View File

@ -19,6 +19,8 @@ AC_SUBST(LIBLIBS)
AC_SUBST(NOINSTLIBS)
AC_PROG_CC
AC_C_CONST
AC_C_INLINE
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)

View File

@ -52,7 +52,11 @@ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
/* max. filename length */
#ifndef LTDL_FILENAME_MAX
#define LTDL_FILENAME_MAX 1024
# ifdef FILENAME_MAX
# define LTDL_FILENAME_MAX FILENAME_MAX
# else
# define LTDL_FILENAME_MAX 1024
# endif
#endif
#ifndef LTDL_SEARCHPATH_MAX
@ -540,7 +544,7 @@ presym_init ()
return 0;
}
static void
static int /* not all compilers support void */
presym_free_symlists ()
{
lt_dlsymlists_t *lists = preloaded_symbols;
@ -552,6 +556,7 @@ presym_free_symlists ()
free(tmp);
}
preloaded_symbols = 0;
return 0;
}
static int
@ -751,7 +756,7 @@ lt_dlexit ()
return errors;
}
static void
static int /* not all compilers support void */
trim (dest, s)
char *dest;
const char *s;
@ -764,6 +769,7 @@ trim (dest, s)
dest[len-3] = '\0';
} else
*dest = '\0';
return 0;
}
static int
@ -867,7 +873,7 @@ find_library (handle, basename, search_path)
while (cur) {
next = strchr(cur, ':');
if (next) {
if (next - cur + 1 >= FILENAME_MAX) {
if (next - cur + 1 >= LTDL_FILENAME_MAX) {
last_error = buffer_overflow_error;
return 1;
}
@ -875,7 +881,7 @@ find_library (handle, basename, search_path)
filename[next - cur] = '\0';
cur = next+1;
} else {
if (strlen(cur)+1 >= FILENAME_MAX) {
if (strlen(cur)+1 >= LTDL_FILENAME_MAX) {
last_error = buffer_overflow_error;
return 1;
}
@ -977,7 +983,7 @@ lt_dlopen (filename)
basename++;
else
basename = filename;
if (basename - filename >= FILENAME_MAX) {
if (basename - filename >= LTDL_FILENAME_MAX) {
last_error = buffer_overflow_error;
return 0;
}
@ -1236,7 +1242,7 @@ lt_dlsetsearchpath (search_path)
}
const char *
lt_dlgetsearchpath (void)
lt_dlgetsearchpath __P((void))
{
return usr_search_path;
}

View File

@ -3,6 +3,7 @@ AC_INIT(main.c)
AM_INIT_AUTOMAKE(mdemo,0.1)
AC_PROG_CC
AC_C_CONST
AC_EXEEXT
AM_PROG_LIBTOOL