Thursday, September 30, 2010

Mercurial

http://hginit.com/top/index.html

Tuesday, September 21, 2010

Aliasing symbol names during Link time

Reference: see  VC/crt/src/crtdll.c




  /*
  * _pRawDllMain MUST be an extern const variable, which will be aliased to
  * _pDefaultRawDllMain if no real user definition is present, thanks to the
  * alternatename directive.
  */

extern BOOL (WINAPI * const _pRawDllMain)(HANDLE, DWORD, LPVOID);
extern BOOL (WINAPI * const _pDefaultRawDllMain)(HANDLE, DWORD, LPVOID) = NULL;
#if defined (_M_IX86)
#pragma comment(linker, "/alternatename:__pRawDllMain=__pDefaultRawDllMain")
#elif defined (_M_IA64) || defined (_M_AMD64)
#pragma comment(linker, "/alternatename:_pRawDllMain=_pDefaultRawDllMain")
#else  /* defined (_M_IA64) || defined (_M_AMD64) */
#error Unsupported platform
#endif  /* defined (_M_IA64) || defined (_M_AMD64) */

Example:
1. Inside a static lib A, put the following
extern "C" int xxx = 2;
2. Inside an EXE which links A, put the following
extern "C" int a = 4;
#pragma comment(linker, "/alternatename:_xxx=_a")

In this case "xxx" will be resolved as 2. Now how if we remove the line inside static-lib A. In this case the linker will replace "xxx" with "a", which is equal to 4.


BTW, don't forget to put addition "_" in front of symbol name inside #pragma comment directives. It is necessary to follow "C" name decoration. See http://msdn.microsoft.com/en-us/library/deaxefa7.aspx.

Coding Standard

http://www.possibility.com/Cpp/CppCodingStandard.html

boost::spirit

http://stackoverflow.com/questions/924642/boost-spirit-headers-deprecated

Friday, September 3, 2010

Visual Studio Extension (Add-Ins)

windows management console (msc) list

http://searchwarp.com/swa217012.htm


  • certmgr.msc Certificate Manager
  • ciadv.msc Indexing Service
  • comexp.msc Component services
  • compmgmt.msc Computer management
  • devmgmt.msc Device Manager 
  • dfrg.msc Defragment
  • diskmgmt.msc Disk Management
  • fsmgmt.msc Folder Sharing Management
  • eventvwr.msc Event Viewer
  • gpedit.msc Group Policy 
  • iis.msc Internet Information Services
  • lusrmgr.msc Local Users and Groups
  • mscorcfg.msc .Net configurations
  • ntmsmgr.msc Removable Storage
  • perfmon.msc Performance Manager
  • rsop.msc RSoP - Resultant Set of Policy
  • secpol.msc Local Security Policy
  • services.msc System Services 
  • wmimgmt.msc Windows Management Instrumental