From c35d9989421eb8a387c99e7fc217e066e5c24260 Mon Sep 17 00:00:00 2001 From: v-dareck Date: Tue, 14 Feb 2017 16:52:42 -0800 Subject: [PATCH] Fix clang compile errors. --- source/shared/localization.hpp | 7 ++----- source/sqlsrv/conn.cpp | 2 +- source/sqlsrv/php_sqlsrv.h | 6 +++--- source/sqlsrv/stmt.cpp | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/source/shared/localization.hpp b/source/shared/localization.hpp index a7307889..18e30b27 100644 --- a/source/shared/localization.hpp +++ b/source/shared/localization.hpp @@ -25,13 +25,10 @@ #include "typedefs_for_linux.h" #ifdef MPLAT_UNIX -namespace std -{ - // Forward reference - class locale; -} +#include #endif + #define CP_UTF8 65001 #define CP_UTF16 1200 #define CP_UTF32 12000 diff --git a/source/sqlsrv/conn.cpp b/source/sqlsrv/conn.cpp index 59a2479f..51096cfb 100644 --- a/source/sqlsrv/conn.cpp +++ b/source/sqlsrv/conn.cpp @@ -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) int ss_sqlsrv_conn::descriptor; -char* ss_sqlsrv_conn::resource_name = static_cast("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 // resource. diff --git a/source/sqlsrv/php_sqlsrv.h b/source/sqlsrv/php_sqlsrv.h index 043a108b..71328a19 100644 --- a/source/sqlsrv/php_sqlsrv.h +++ b/source/sqlsrv/php_sqlsrv.h @@ -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 // 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; // initialize with default values @@ -184,7 +184,7 @@ struct ss_sqlsrv_stmt : public sqlsrv_stmt { int fetch_fields_count; // 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; }; @@ -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); CHECK_CUSTOM_ERROR(( zr == FAILURE ), reinterpret_cast( rsrc_pointer ), SS_SQLSRV_ERROR_REGISTER_RESOURCE, diff --git a/source/sqlsrv/stmt.cpp b/source/sqlsrv/stmt.cpp index 7834aa83..7558e1ab 100644 --- a/source/sqlsrv/stmt.cpp +++ b/source/sqlsrv/stmt.cpp @@ -28,7 +28,7 @@ // // our resource descriptor assigned in minit int ss_sqlsrv_stmt::descriptor = 0; -char* ss_sqlsrv_stmt::resource_name = static_cast("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 {