Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37732581
en ru br
ALT Linux repositórios
S:1.12-alt2

Group :: Sistema/Bibliotecas
RPM: libpcl

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: pcl-1.12-alt-e2k.patch
Download


From e6fb7d0f0b1380ae4bf94a41cc23cf66e0c1080b Mon Sep 17 00:00:00 2001
From: Ilya Kurdyukov <jpegqs@gmail.com>
Date: Fri, 13 Aug 2021 17:29:49 +0700
Subject: [PATCH] libpcl-1.12 e2k support
---
 include/pcl_config.h | 2 +-
 pcl/pcl.c            | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/pcl_config.h b/include/pcl_config.h
index be922c1..0b9f696 100644
--- a/include/pcl_config.h
+++ b/include/pcl_config.h
@@ -36,7 +36,7 @@
  */
 #define CO_MULTI_THREAD
 
-#elif defined(HAVE_GETCONTEXT) && defined(HAVE_MAKECONTEXT) && defined(HAVE_SWAPCONTEXT)
+#elif defined(HAVE_GETCONTEXT) && (defined(HAVE_MAKECONTEXT) || defined(__e2k__)) && defined(HAVE_SWAPCONTEXT)
 
 /*
  * Use this if the system has a working getcontext/makecontext/swapcontext
diff --git a/pcl/pcl.c b/pcl/pcl.c
index 58d8605..b07650f 100644
--- a/pcl/pcl.c
+++ b/pcl/pcl.c
@@ -77,7 +77,12 @@ static int co_set_context(co_ctx_t *ctx, void *func, char *stkbase, long stksiz)
 	ctx->cc.uc_stack.ss_size = stksiz - sizeof(long);
 	ctx->cc.uc_stack.ss_flags = 0;
 
+#ifdef __e2k__
+	if (makecontext_e2k(&ctx->cc, func, 1) < 0)
+		return -1;
+#else
 	makecontext(&ctx->cc, func, 1);
+#endif
 
 	return 0;
 }
@@ -416,6 +421,9 @@ void co_delete(coroutine_t coro)
 			tctx->co_curr);
 		exit(1);
 	}
+#if defined(CO_USE_UCONEXT) && defined(__e2k__)
+	freecontext_e2k(&co->ctx.cc);
+#endif
 	if (co->alloc)
 		free(co);
 }
-- 
2.17.1
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009