shithub: libmujs

Download patch

ref: f882c6c5fea88ca1eca664b6755ba1d2a7c2b3f5
parent: 66d98a5f8efdb7fb70528d831f05a128917b15c2
author: Tor Andersson <tor.andersson@artifex.com>
date: Wed Nov 9 11:01:32 EST 2022

Rename private functions to avoid problems with MSYS stdio.h.

--- a/jsproperty.c
+++ b/jsproperty.c
@@ -104,7 +104,7 @@
 	--obj->count;
 }
 
-static js_Property *unlink(js_State *J, js_Object *obj, js_Property *node, const char *name, js_Property **garbage)
+static js_Property *unlinkproperty(js_State *J, js_Object *obj, js_Property *node, const char *name, js_Property **garbage)
 {
 	js_Property *temp, *succ;
 
@@ -111,9 +111,9 @@
 	if (node != &sentinel) {
 		int c = strcmp(name, node->name);
 		if (c < 0) {
-			node->left = unlink(J, obj, node->left, name, garbage);
+			node->left = unlinkproperty(J, obj, node->left, name, garbage);
 		} else if (c > 0) {
-			node->right = unlink(J, obj, node->right, name, garbage);
+			node->right = unlinkproperty(J, obj, node->right, name, garbage);
 		} else {
 			if (node->left == &sentinel) {
 				*garbage = node;
@@ -126,7 +126,7 @@
 				succ = node->right;
 				while (succ->left != &sentinel)
 					succ = succ->left;
-				succ->right = unlink(J, obj, node->right, succ->name, &temp);
+				succ->right = unlinkproperty(J, obj, node->right, succ->name, &temp);
 				succ->left = node->left;
 				node = succ;
 			}
@@ -147,10 +147,10 @@
 	return node;
 }
 
-static js_Property *delete(js_State *J, js_Object *obj, js_Property *tree, const char *name)
+static js_Property *deleteproperty(js_State *J, js_Object *obj, js_Property *tree, const char *name)
 {
 	js_Property *garbage = NULL;
-	tree = unlink(J, obj, tree, name, &garbage);
+	tree = unlinkproperty(J, obj, tree, name, &garbage);
 	if (garbage != NULL)
 		freeproperty(J, obj, garbage);
 	return tree;
@@ -230,7 +230,7 @@
 
 void jsV_delproperty(js_State *J, js_Object *obj, const char *name)
 {
-	obj->properties = delete(J, obj, obj->properties, name);
+	obj->properties = deleteproperty(J, obj, obj->properties, name);
 }
 
 /* Flatten hierarchy of enumerable properties into an iterator object */