[M3devel] RTLinker.envp, instance removal?

Jay K jay.krell at cornell.edu
Mon Aug 23 23:54:17 CEST 2010


envp is used at least by posix/RTArgs so will stay.
I'll investigate further: ie. if it is used on Windows, test it and make it work, else maybe make it null.
Still probably remove instance if it isn't used, I don't think it has a portable use.
 One could compare it to null to deduce Win32 vs. Posix but there is already Compiler.ThisOS or somesuch.

 - Jay

From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Subject: RTLinker.envp, instance removal?
Date: Mon, 23 Aug 2010 11:17:17 +0000








RTLinker exposes:
  envp
  instance


envp is not entirely useless, but is redundant with Cstdlib.getenv,
which is exposed through libm3/Env.


RTLinker.envp appears somewhat broken on Windows, despite appearances
that I tried to fix it. In particular, broken for gui apps.
 (btw, gui apps and console apps are far more the same than
  people realize; this whole business where Modula-3's main
  varies for each of them is unnecessary; the actual
  entry point for any Win32 console or gui app takes no parameters;
  the parameters the C runtime passes to main or WinMain
  are created by it based on stuff such as GetCommandLine,
  GetStartupInfo, etc.)
  
 
instance is pretty much useless.
Anyone that needs it can get it via GetModuleHandle(NULL);

I suppose RTLinker.instance is more portable, as it'll reliably
be null on posix -- ie: the #ifdef is built into startup/m3core,
instead of the user's app.
(on the other hand, there's probably nothing portable
you can do with instance, given that it is useless on Posix)

Anyway, on the general premise that less is more and things
deemed buggy, of little value, and unused, are best just
removed instead of fixed or improved, I propose removing
both of these. Once I verify they are unused.


?


 - Jay




 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100823/61b1b7ac/attachment-0002.html>


More information about the M3devel mailing list