From 213b6d48da0649afad05a2ad21f84b72fef597fb Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 10 Jul 2021 13:03:24 +0300 Subject: [PATCH 30/30] Avoid namespace conflicts with tinycthread Rename tinycthread source files, and resulting library, to make sure we use freeciv copy of those instead of one from crosser environment. See osdn #42607 Signed-off-by: Marko Lindqvist --- configure.ac | 2 +- dependencies/tinycthread/Makefile.am | 8 ++++---- dependencies/tinycthread/Version.txt | 2 ++ .../tinycthread/{tinycthread.c => fc_tinycthread.c} | 2 +- .../tinycthread/{tinycthread.h => fc_tinycthread.h} | 0 utility/fcthread.h | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) rename dependencies/tinycthread/{tinycthread.c => fc_tinycthread.c} (99%) rename dependencies/tinycthread/{tinycthread.h => fc_tinycthread.h} (100%) diff --git a/configure.ac b/configure.ac index 112318d990..1ff4218985 100644 --- a/configure.ac +++ b/configure.ac @@ -821,7 +821,7 @@ if test "x$fctinycthr" = "xyes" ; then AC_DEFINE([FREECIV_HAVE_THREAD_COND], [1], [Has thread condition variable implementation]) thread_cond=true - TINYCTHR_LIBS="\$(top_builddir)/dependencies/tinycthread/libtinycthread.la" + TINYCTHR_LIBS="\$(top_builddir)/dependencies/tinycthread/libfctinycthread.la" AC_SUBST([TINYCTHR_LIBS]) AC_MSG_RESULT([tinycthread]) diff --git a/dependencies/tinycthread/Makefile.am b/dependencies/tinycthread/Makefile.am index d9d1174fc8..1b07deb542 100644 --- a/dependencies/tinycthread/Makefile.am +++ b/dependencies/tinycthread/Makefile.am @@ -1,8 +1,8 @@ -noinst_LTLIBRARIES = libtinycthread.la +noinst_LTLIBRARIES = libfctinycthread.la -libtinycthread_la_SOURCES = \ - tinycthread.c \ - tinycthread.h +libfctinycthread_la_SOURCES = \ + fc_tinycthread.c \ + fc_tinycthread.h EXTRA_DIST = README.txt \ Version.txt diff --git a/dependencies/tinycthread/Version.txt b/dependencies/tinycthread/Version.txt index ebd450732f..ca7dbf2147 100644 --- a/dependencies/tinycthread/Version.txt +++ b/dependencies/tinycthread/Version.txt @@ -4,3 +4,5 @@ commit 6957fc8383d6c7db25b60b8c849b29caab1caaee Fri Sep 30 12:47:32 2016 -0400 Only files needed by freeciv have been included here. +Source files have been renamed to distinguish freeciv copy +from a version in crosser environment. diff --git a/dependencies/tinycthread/tinycthread.c b/dependencies/tinycthread/fc_tinycthread.c similarity index 99% rename from dependencies/tinycthread/tinycthread.c rename to dependencies/tinycthread/fc_tinycthread.c index 570fdff1d8..30ff964a9e 100644 --- a/dependencies/tinycthread/tinycthread.c +++ b/dependencies/tinycthread/fc_tinycthread.c @@ -22,7 +22,7 @@ freely, subject to the following restrictions: distribution. */ -#include "tinycthread.h" +#include "fc_tinycthread.h" #include /* Platform specific includes */ diff --git a/dependencies/tinycthread/tinycthread.h b/dependencies/tinycthread/fc_tinycthread.h similarity index 100% rename from dependencies/tinycthread/tinycthread.h rename to dependencies/tinycthread/fc_tinycthread.h diff --git a/utility/fcthread.h b/utility/fcthread.h index 5b3099b8b2..42a676f6f0 100644 --- a/utility/fcthread.h +++ b/utility/fcthread.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -25,7 +25,7 @@ extern "C" { #include "support.h" /* bool */ #ifdef FREECIV_HAVE_TINYCTHR -#include "tinycthread.h" +#include "fc_tinycthread.h" #define FREECIV_C11_THR #else #ifdef FREECIV_HAVE_C11_THREADS -- 2.30.2