view src/librsb-1-setenv.patch @ 6538:8e1e1a000deb

of-netcdf: Fix compatibility with Octave 9. * src/of-netcdf-1-octave-9-compat.patch: Add patch that replaces class that has been deprecated in Octave 7 and removed from Octave 9. * dist-files.mk: Add new file to list.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 19 Nov 2022 12:54:37 +0100
parents 86edd6018826
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 )