[freetds] ENOMEM vs. errno

Frediano Ziglio freddy77 at gmail.com
Thu Dec 6 14:36:02 EST 2007


...
> | 
> | Another way to fix this issue would be to have somthing like
> | 
> | #ifdef WIN32
> |    /* fix errno setting in some windows malloc implementations */
> |    if (msgno == SYBEMEM)
> |       errnum = ENOMEM;
> | #endif
> | 
> | Would you prefer this change? 
> 
> I think it is less intrusive and also documents what's broken and
> how you are working around it. I would say in the comment:
> 
> /*
>  * Unfortunately MingW uses the "old" msvcrt.dll (Visual C++ 2005 uses
>  * a newer version) which does not set errno when allocation functions
>  * cannot allocate memory, so we do it for them.
>  */
> 

Agreed, rollback and committed. MingW agree!

freddy77




More information about the FreeTDS mailing list