Fix clang compile errors.

This commit is contained in:
v-dareck 2017-02-14 16:52:42 -08:00
parent c6157b0f79
commit c35d998942
4 changed files with 7 additions and 10 deletions

View file

@ -25,13 +25,10 @@
#include "typedefs_for_linux.h" #include "typedefs_for_linux.h"
#ifdef MPLAT_UNIX #ifdef MPLAT_UNIX
namespace std #include <locale>
{
// Forward reference
class locale;
}
#endif #endif
#define CP_UTF8 65001 #define CP_UTF8 65001
#define CP_UTF16 1200 #define CP_UTF16 1200
#define CP_UTF32 12000 #define CP_UTF32 12000

View file

@ -143,7 +143,7 @@ int get_stmt_option_key( zend_string* key, size_t key_len TSRMLS_DC );
// constants for parameters used by process_params function(s) // constants for parameters used by process_params function(s)
int ss_sqlsrv_conn::descriptor; int ss_sqlsrv_conn::descriptor;
char* ss_sqlsrv_conn::resource_name = static_cast<char *>("ss_sqlsrv_conn"); const char* ss_sqlsrv_conn::resource_name = "ss_sqlsrv_conn";
// connection specific parameter proccessing. Use the generic function specialised to return a connection // connection specific parameter proccessing. Use the generic function specialised to return a connection
// resource. // resource.

View file

@ -134,7 +134,7 @@ struct ss_sqlsrv_conn : sqlsrv_conn
bool in_transaction; // flag set when inside a transaction and used for checking validity of tran API calls bool in_transaction; // flag set when inside a transaction and used for checking validity of tran API calls
// static variables used in process_params // static variables used in process_params
static char* resource_name; // char because const char forces casting all over the place. Just easier to leave it char here. static const char* resource_name;
static int descriptor; static int descriptor;
// initialize with default values // initialize with default values
@ -184,7 +184,7 @@ struct ss_sqlsrv_stmt : public sqlsrv_stmt {
int fetch_fields_count; int fetch_fields_count;
// static variables used in process_params // static variables used in process_params
static char* resource_name; // char because const char forces casting all over the place in ODBC functions static const char* resource_name;
static int descriptor; static int descriptor;
}; };
@ -490,7 +490,7 @@ namespace ss {
} }
}; };
inline void zend_register_resource(_Out_ zval& rsrc_result, void* rsrc_pointer, int rsrc_type, char* rsrc_name TSRMLS_DC) inline void zend_register_resource(_Out_ zval& rsrc_result, void* rsrc_pointer, int rsrc_type, const char* rsrc_name TSRMLS_DC)
{ {
int zr = (NULL != (Z_RES(rsrc_result) = ::zend_register_resource(rsrc_pointer, rsrc_type)) ? SUCCESS : FAILURE); int zr = (NULL != (Z_RES(rsrc_result) = ::zend_register_resource(rsrc_pointer, rsrc_type)) ? SUCCESS : FAILURE);
CHECK_CUSTOM_ERROR(( zr == FAILURE ), reinterpret_cast<sqlsrv_context*>( rsrc_pointer ), SS_SQLSRV_ERROR_REGISTER_RESOURCE, CHECK_CUSTOM_ERROR(( zr == FAILURE ), reinterpret_cast<sqlsrv_context*>( rsrc_pointer ), SS_SQLSRV_ERROR_REGISTER_RESOURCE,

View file

@ -28,7 +28,7 @@
// //
// our resource descriptor assigned in minit // our resource descriptor assigned in minit
int ss_sqlsrv_stmt::descriptor = 0; int ss_sqlsrv_stmt::descriptor = 0;
char* ss_sqlsrv_stmt::resource_name = static_cast<char *>("ss_sqlsrv_stmt"); // not const for a reason. see sqlsrv_stmt in php_sqlsrv.h const char* ss_sqlsrv_stmt::resource_name = "ss_sqlsrv_stmt";
namespace { namespace {