Author: cazfi Date: Wed Nov 16 11:28:51 2016 New Revision: 34524 URL: http://svn.gna.org/viewcvs/freeciv?rev=34524&view=rev Log: Added dirent.h configure check.
See patch #7990 Modified: trunk/client/gui-gtk-2.0/themes.c trunk/client/gui-gtk-3.0/themes.c trunk/client/gui-gtk-3.22/themes.c trunk/client/gui-sdl2/themes.c trunk/configure.ac trunk/gen_headers/freeciv_config.h.in trunk/utility/shared.c trunk/utility/support.h Modified: trunk/client/gui-gtk-2.0/themes.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/themes.c?rev=34524&r1=34523&r2=34524&view=diff ============================================================================== --- trunk/client/gui-gtk-2.0/themes.c (original) +++ trunk/client/gui-gtk-2.0/themes.c Wed Nov 16 11:28:51 2016 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2005 The Freeciv Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,7 +14,10 @@ #include <fc_config.h> #endif +#ifdef FREECIV_HAVE_DIRENT_H #include <dirent.h> +#endif + #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> @@ -186,7 +189,6 @@ { DIR *dir; struct dirent *entry; - char **theme_names = fc_malloc(sizeof(char *) * 2); /* Allocated memory size */ int t_size = 2; Modified: trunk/client/gui-gtk-3.0/themes.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/themes.c?rev=34524&r1=34523&r2=34524&view=diff ============================================================================== --- trunk/client/gui-gtk-3.0/themes.c (original) +++ trunk/client/gui-gtk-3.0/themes.c Wed Nov 16 11:28:51 2016 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2005 The Freeciv Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,7 +14,10 @@ #include <fc_config.h> #endif +#ifdef FREECIV_HAVE_DIRENT_H #include <dirent.h> +#endif + #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> @@ -147,7 +150,6 @@ { DIR *dir; struct dirent *entry; - char **theme_names = fc_malloc(sizeof(char *) * 2); /* Allocated memory size */ int t_size = 2; Modified: trunk/client/gui-gtk-3.22/themes.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.22/themes.c?rev=34524&r1=34523&r2=34524&view=diff ============================================================================== --- trunk/client/gui-gtk-3.22/themes.c (original) +++ trunk/client/gui-gtk-3.22/themes.c Wed Nov 16 11:28:51 2016 @@ -14,7 +14,10 @@ #include <fc_config.h> #endif +#ifdef FREECIV_HAVE_DIRENT_H #include <dirent.h> +#endif + #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> @@ -145,7 +148,6 @@ { DIR *dir; struct dirent *entry; - char **theme_names = fc_malloc(sizeof(char *) * 2); /* Allocated memory size */ int t_size = 2; Modified: trunk/client/gui-sdl2/themes.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/themes.c?rev=34524&r1=34523&r2=34524&view=diff ============================================================================== --- trunk/client/gui-sdl2/themes.c (original) +++ trunk/client/gui-sdl2/themes.c Wed Nov 16 11:28:51 2016 @@ -14,7 +14,10 @@ #include <fc_config.h> #endif +#ifdef FREECIV_HAVE_DIRENT_H #include <dirent.h> +#endif + #include <sys/stat.h> /* utility */ Modified: trunk/configure.ac URL: http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=34524&r1=34523&r2=34524&view=diff ============================================================================== --- trunk/configure.ac (original) +++ trunk/configure.ac Wed Nov 16 11:28:51 2016 @@ -1339,6 +1339,7 @@ AC_CHECK_HEADERS([unistd.h], [AC_DEFINE([FREECIV_HAVE_UNISTD_H], [1], [unistd.h available])]) AC_CHECK_HEADERS([locale.h], [AC_DEFINE([FREECIV_HAVE_LOCALE_H], [1], [locale.h available])]) AC_CHECK_HEADERS([libintl.h], [AC_DEFINE([FREECIV_HAVE_LIBINTL_H], [1], [libint.h available])]) +AC_CHECK_HEADERS([dirent.h], [AC_DEFINE([FREECIV_HAVE_DIRENT_H], [1], [dirent.h available])]) AC_HEADER_STDBOOL if test $ac_cv_header_stdbool_h = yes; then AC_DEFINE([FREECIV_HAVE_STDBOOL_H], [1], [Have standard compliant stdbool.h]) Modified: trunk/gen_headers/freeciv_config.h.in URL: http://svn.gna.org/viewcvs/freeciv/trunk/gen_headers/freeciv_config.h.in?rev=34524&r1=34523&r2=34524&view=diff ============================================================================== --- trunk/gen_headers/freeciv_config.h.in (original) +++ trunk/gen_headers/freeciv_config.h.in Wed Nov 16 11:28:51 2016 @@ -83,6 +83,9 @@ /* netinet/in.h available */ #undef FREECIV_HAVE_NETINET_IN_H +/* dirent.h available */ +#undef FREECIV_HAVE_DIRENT_H + /* Have standard compliant stdbool.h */ #undef FREECIV_HAVE_STDBOOL_H Modified: trunk/utility/shared.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/utility/shared.c?rev=34524&r1=34523&r2=34524&view=diff ============================================================================== --- trunk/utility/shared.c (original) +++ trunk/utility/shared.c Wed Nov 16 11:28:51 2016 @@ -22,7 +22,10 @@ #include <sys/types.h> #endif +#ifdef FREECIV_HAVE_DIRENT_H #include <dirent.h> +#endif + #include <errno.h> #include <limits.h> #include <stdarg.h> Modified: trunk/utility/support.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/utility/support.h?rev=34524&r1=34523&r2=34524&view=diff ============================================================================== --- trunk/utility/support.h (original) +++ trunk/utility/support.h Wed Nov 16 11:28:51 2016 @@ -26,7 +26,10 @@ #include <freeciv_config.h> +#ifdef FREECIV_HAVE_DIRENT_H #include <dirent.h> +#endif + #include <stdarg.h> #include <stdio.h> #include <stdlib.h> /* size_t */ _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits