Index: driver/results.c =================================================================== --- driver/results.c (revision 1041) +++ driver/results.c (working copy) @@ -535,7 +535,7 @@ *pnColumnSize= size; } if (pibScale) - *pibScale= (SQLSMALLINT)max(0, get_decimal_digits(stmt, field)); + *pibScale= (SQLSMALLINT)myodbc_max(0, get_decimal_digits(stmt, field)); if (pfNullable) { if ((field->flags & NOT_NULL_FLAG) && @@ -777,8 +777,9 @@ case SQL_COLUMN_SCALE: case SQL_DESC_SCALE: - *(SQLINTEGER *)NumericAttributePtr= max(0, get_decimal_digits(stmt, - field)); + *(SQLINTEGER *)NumericAttributePtr= myodbc_max(0, + get_decimal_digits(stmt, + field)); break; case SQL_DESC_SCHEMA_NAME: @@ -1335,7 +1336,8 @@ } stmt->current_row= cur_row; - rows_to_fetch= min(max_row-cur_row, (long)stmt->stmt_options.rows_in_set); + rows_to_fetch= myodbc_min(max_row-cur_row, + (long)stmt->stmt_options.rows_in_set); if ( !rows_to_fetch ) { *pcrow= 0; Index: driver/utility.c =================================================================== --- driver/utility.c (revision 1041) +++ driver/utility.c (working copy) @@ -205,7 +205,7 @@ if ( rgbValue ) strmake((char*) rgbValue, src, cbValueMax); - if ( min(*pcbValue , cbValueMax) != *pcbValue ) + if ( myodbc_min(*pcbValue , cbValueMax) != *pcbValue ) return SQL_SUCCESS_WITH_INFO; return SQL_SUCCESS; } @@ -282,7 +282,7 @@ fill_length-= *offset; } - length= min(fill_length, cbValueMax); + length= myodbc_min(fill_length, cbValueMax); (*offset)+= length; /* Fix for next call */ if ( pcbValue ) *pcbValue= fill_length; @@ -338,7 +338,7 @@ src+= *offset; src_length-= *offset; length= cbValueMax ? (ulong)(cbValueMax-1)/2 : 0; - length= min(src_length,length); + length= myodbc_min(src_length,length); (*offset)+= length; /* Fix for next call */ if ( pcbValue ) *pcbValue= src_length*2; Index: driver/myodbc3.h =================================================================== --- driver/myodbc3.h (revision 1041) +++ driver/myodbc3.h (working copy) @@ -42,6 +42,11 @@ #define WIN32 /* Hack for rc files */ #endif +#ifndef myodbc_max +#define myodbc_max( a, b ) (((a) > (b)) ? (a) : (b)) +#define myodbc_min( a, b ) (((a) < (b)) ? (a) : (b)) +#endif + #ifdef __cplusplus extern "C" { Index: driver/cursor.c =================================================================== --- driver/cursor.c (revision 1041) +++ driver/cursor.c (working copy) @@ -1478,7 +1478,7 @@ if ( szCursor && cbCursorMax > 0 ) strmake((char*) szCursor, stmt->cursor.name, cbCursorMax); - nLength= min(*pcbCursor , cbCursorMax); + nLength= myodbc_min(*pcbCursor , cbCursorMax); if ( nLength != *pcbCursor ) return set_error(stmt,MYERR_01004,NULL,0); Index: monitor/myodbc3m.h =================================================================== --- monitor/myodbc3m.h (revision 1041) +++ monitor/myodbc3m.h (working copy) @@ -117,12 +117,12 @@ #define MAX_DATA_WIDTH 300 -#ifndef max -#define max( a, b ) (((a) > (b)) ? (a) : (b)) +#ifndef myodbc_max +#define myodbc_max( a, b ) (((a) > (b)) ? (a) : (b)) #endif -#ifndef min -#define min( a, b ) (((a) < (b)) ? (a) : (b)) +#ifndef myodbc_min +#define myodbc_min( a, b ) (((a) < (b)) ? (a) : (b)) #endif int OpenEnvironment( SQLHENV *phEnv ); Index: monitor/myodbc3m.c =================================================================== --- monitor/myodbc3m.c (revision 1041) +++ monitor/myodbc3m.c (working copy) @@ -292,10 +292,10 @@ SQLColAttribute( hStmt, nCol, SQL_DESC_LABEL, szColumnName, sizeof(szColumnName), NULL, NULL ); nLabelWidth = strlen((char*) szColumnName ); - nOptimalDisplayWidth = max( nLabelWidth, nDataWidth ); + nOptimalDisplayWidth = myodbc_max( nLabelWidth, nDataWidth ); if ( nUserWidth > 0 ) - nOptimalDisplayWidth = min( nOptimalDisplayWidth, nUserWidth ); + nOptimalDisplayWidth = myodbc_min( nOptimalDisplayWidth, nUserWidth ); if ( nOptimalDisplayWidth > MAX_DATA_WIDTH ) nOptimalDisplayWidth = MAX_DATA_WIDTH; Index: util/MYODBCUtilReadDataSourceStr.c =================================================================== --- util/MYODBCUtilReadDataSourceStr.c (revision 1041) +++ util/MYODBCUtilReadDataSourceStr.c (working copy) @@ -29,7 +29,7 @@ if ( !s ) return 0; - nAvail = min( strlen(s) + 1, n + 1 ); + nAvail = myodbc_min( strlen(s) + 1, n + 1 ); if ( nAvail < 1 ) return 0; @@ -63,7 +63,7 @@ if ( !s ) return 0; - nAvail = min( strlen(s) + 1, n + 1 ); + nAvail = myodbc_min( strlen(s) + 1, n + 1 ); if ( nAvail < 1 ) return 0; Index: util/MYODBCUtil.h =================================================================== --- util/MYODBCUtil.h (revision 1041) +++ util/MYODBCUtil.h (working copy) @@ -56,9 +56,9 @@ #define TRUE 1 #endif -#ifndef max -#define max( a, b ) (((a) > (b)) ? (a) : (b)) -#define min( a, b ) (((a) < (b)) ? (a) : (b)) +#ifndef myodbc_max +#define myodbc_max( a, b ) (((a) > (b)) ? (a) : (b)) +#define myodbc_min( a, b ) (((a) < (b)) ? (a) : (b)) #endif /* Could use DRIVER_NAME but trying to keep dependency upon driver specific code to a min */