[Vm-dev] [commit][2842] Fix a slip in the BochsPlugin' s makefile that broke if not built in standard place.

commits at squeakvm.org commits at squeakvm.org
Fri Jan 10 21:52:46 UTC 2014


Revision: 2842
Author:   eliot
Date:     2014-01-10 13:52:44 -0800 (Fri, 10 Jan 2014)
Log Message:
-----------
Fix a slip in the BochsPlugin's makefile that broke if not built in standard place.

Modified Paths:
--------------
    branches/Cog/platforms/win32/vm/sqWin32ExternalPrims.c

Modified: branches/Cog/platforms/win32/vm/sqWin32ExternalPrims.c
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32ExternalPrims.c	2014-01-08 02:15:19 UTC (rev 2841)
+++ branches/Cog/platforms/win32/vm/sqWin32ExternalPrims.c	2014-01-10 21:52:44 UTC (rev 2842)
@@ -62,14 +62,48 @@
 	return 0;
 }
 
-void *ioFindExternalFunctionIn(char *lookupName, void *moduleHandle)
+#if SPURVM
+void *
+ioFindExternalFunctionInAccessorDepthInto(char *lookupName, void *moduleHandle,
+											sqInt *accessorDepthPtr)
 {
-#ifdef UNICODE
+	void *f;
+	char buffer[256];
+
+# ifdef UNICODE
+	f = GetProcAddress(moduleHandle, toUnicode(lookupName));
+# else
+	f = GetProcAddress(moduleHandle, lookupName);
+# endif
+	if (f) {
+		void *accessorDepthVarPtr;
+		snprintf(buffer,256,"%sAccessorDepth",lookupName);
+		accessorDepthVarPtr =
+# ifdef UNICODE
+		accessorDepthVarPtr = GetProcAddress(moduleHandle, toUnicode(buffer));
+# else
+		accessorDepthVarPtr = GetProcAddress(moduleHandle, buffer);
+# endif
+		/* The Slang machinery assumes accessor depth defaults to -1, which
+		 * means "no accessor depth".  It saves space not outputting -1 depths.
+		 */
+		*accessorDepthPtr = accessorDepthVarPtr
+								? *(signed char *)accessorDepthVarPtr
+								: -1;
+	}
+	return f;
+}
+#else /* SPURVM */
+void *
+ioFindExternalFunctionIn(char *lookupName, void *moduleHandle)
+{
+# ifdef UNICODE
 	return GetProcAddress((HANDLE)moduleHandle, toUnicode(lookupName));
-#else
+# else
 	return GetProcAddress((HANDLE)moduleHandle, lookupName);
-#endif
+# endif
 }
+#endif /* SPURVM */
 
 sqInt ioFreeModule(void *moduleHandle)
 {



More information about the Vm-dev mailing list