From 3280d76682d142a3dc9623bd94d2be0287a25abf Mon Sep 17 00:00:00 2001 From: yitam Date: Wed, 1 Feb 2017 12:41:13 -0800 Subject: [PATCH] modified ifdef __linux__ --- source/shared/FormattedPrint.cpp | 4 ++-- source/shared/core_sqlsrv.h | 4 ++-- source/shared/typedefs_for_linux.h | 4 ++-- source/sqlsrv/stmt.cpp | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/shared/FormattedPrint.cpp b/source/shared/FormattedPrint.cpp index f018f3ea..b3aa3e7a 100644 --- a/source/shared/FormattedPrint.cpp +++ b/source/shared/FormattedPrint.cpp @@ -45,11 +45,11 @@ #include "sal_def.h" #endif -#ifdef __linux__ +#ifndef _WIN32 #define PTR_IS_INT64 1 #else #define PTR_IS_INT64 0 -#endif +#endif // !_WIN32 #ifndef _MSC_VER // SQL Server does not have a long double type diff --git a/source/shared/core_sqlsrv.h b/source/shared/core_sqlsrv.h index 9688b416..9b6c2d2d 100644 --- a/source/shared/core_sqlsrv.h +++ b/source/shared/core_sqlsrv.h @@ -2089,10 +2089,10 @@ namespace core { // unixODBC: 2.3.1 // r = ::SQLRowCount( stmt->handle(), &rows_affected ); // returns r=-1 for an empty result set. -#ifdef __linux__ +#ifndef _WIN32 if( r == -1 && rows_affected == -1 ) return 0; -#endif +#endif // !_WIN32 CHECK_SQL_ERROR_OR_WARNING( r, stmt ) { throw CoreException(); diff --git a/source/shared/typedefs_for_linux.h b/source/shared/typedefs_for_linux.h index 24966305..45798b86 100644 --- a/source/shared/typedefs_for_linux.h +++ b/source/shared/typedefs_for_linux.h @@ -54,11 +54,11 @@ DWORD FormatMessageW( va_list *Arguments ); -#ifdef __linux__ +#ifndef _WIN32 #define FormatMessage FormatMessageA #else #define FormatMessage FormatMessageW -#endif +#endif // !_WIN32 #define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100 #define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200 diff --git a/source/sqlsrv/stmt.cpp b/source/sqlsrv/stmt.cpp index 9d0acba6..d252d086 100644 --- a/source/sqlsrv/stmt.cpp +++ b/source/sqlsrv/stmt.cpp @@ -21,7 +21,7 @@ #include "php_sqlsrv.h" #ifdef _WIN32 #include -#endif +#endif // _WIN32 // // *** internal variables and constants *** @@ -1825,10 +1825,10 @@ void fetch_fields_common( _Inout_ ss_sqlsrv_stmt* stmt, zend_long fetch_type, _O for( int i = 0; i < num_cols; ++i ) { core::SQLColAttributeW ( stmt, i + 1, SQL_DESC_NAME, field_name_w, ( SS_MAXCOLNAMELEN + 1 ) * 2, &field_name_len_w, NULL TSRMLS_CC ); -#ifdef __linux__ +#ifndef _WIN32 //Conversion function in Linux expects size in characters. field_name_len_w = field_name_len_w / sizeof ( SQLWCHAR ); -#endif +#endif // !_WIN32 bool converted = convert_string_from_utf16( encoding, field_name_w, field_name_len_w, ( char** ) &field_name, field_name_len ); @@ -2169,11 +2169,11 @@ void type_and_size_calc( INTERNAL_FUNCTION_PARAMETERS, int type ) size = SQLSRV_SIZE_MAX_TYPE; } else { -#ifdef __linux__ +#ifndef _WIN32 errno = 0; #else _set_errno(0); // reset errno for atol -#endif +#endif // !_WIN32 size = atol( size_p ); if( errno != 0 ) { size = SQLSRV_INVALID_SIZE;