view src/librsb-1-setenv.patch @ 6453:86edd6018826 release

librsb: Update to version 1.3.0.1 (bug #61393). * src/librsb.mk: Update version and checksum. (Temporarily) build without librsbpp. * src/librsb-1-setenv.patch, src/librsb-2-config.patch: Add patches for MinGW (no setenv function) and for dependency on zlib. * dist-files.mk: Add new files to dist.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 15 Oct 2022 14:46:51 +0200
parents
children
line wrap: on
line source

--- librsb-1.3.0.1/rsb_test_matops.c.orig	2022-02-24 11:11:02.000000000 +0100
+++ librsb-1.3.0.1/rsb_test_matops.c	2022-10-15 13:44:55.920772450 +0200
@@ -1979,7 +1979,7 @@
 			RSB_STDOUT("# Memory benchmark took %.3lfs\n",dt);
 	}
 
-#ifdef RSB_HAVE_UNISTD_H
+#ifdef RSB_HAVE_SETENV
 {
 	/* special environmental variables set just for the sake of being saved in .rpr files */
 #ifdef RSB_CC
@@ -6536,7 +6536,7 @@
 			RSB_STDOUT("# Memory benchmark took %.3lfs\n",dt);
 	}
 
-#ifdef RSB_HAVE_UNISTD_H
+#ifdef RSB_HAVE_SETENV
 {
 	/* special environmental variables set just for the sake of being saved in .rpr files */
 #ifdef RSB_CC
@@ -10962,7 +10962,7 @@
 			RSB_STDOUT("# Memory benchmark took %.3lfs\n",dt);
 	}
 
-#ifdef RSB_HAVE_UNISTD_H
+#ifdef RSB_HAVE_SETENV
 {
 	/* special environmental variables set just for the sake of being saved in .rpr files */
 #ifdef RSB_CC
 
 --- librsb-1.3.0.1/rsbench.c.orig	2022-10-15 13:54:32.053382000 +0200
+++ librsb-1.3.0.1/rsbench.c	2022-10-15 13:54:58.038005553 +0200
@@ -479,7 +479,15 @@
 	{
 		const rsb_char_t *name=ava, *value=esp+1;
 		*esp=RSB_NUL;
+		#ifdef RSB_HAVE_SETENV
 		setenv(name, value, /*overwrite*/1);
+		#else
+		rsb_char_t buf[1000];
+		strcpy(buf, name);
+		strcat(buf, "=");
+		strcat(buf, value);
+		putenv(buf);
+		#endif
 		RSBENCH_STDOUT("# Calling setenv() with arguments %s and %s\n",name,value);
 	}
 	if( ava )