Original patch by Shawn Wilsher (sdwilsh) <comrade693+bmo@gmail.com>, updated by me to handle the standalone xpcom glue case and to use printf safely. r=bsmedberg, sr=bzbarsky, a=dsicore. git-svn-id: svn://10.0.0.236/trunk@236869 18797224-902f-48f8-a5cc-f745e15eee43