MSVC: Delete deprecated stuff related to MSVC < 2008

v0.27.3
Luis Díaz Más 7 years ago
parent e84b812d8a
commit 8bf9ca8e6d

@ -8,13 +8,6 @@
#define _MSC_VER_2010 1600 #define _MSC_VER_2010 1600
#define _MSC_VER_2008 1500 #define _MSC_VER_2008 1500
#define _MSC_VER_2005 1400
#if _MSC_VER >= _MSC_VER_2005
#define MSDEV_2005 1
#else
#define MSDEV_2003 1
#endif
// Constants required by Microsoft SDKs to define SHGetFolderPathA and others // Constants required by Microsoft SDKs to define SHGetFolderPathA and others
@ -31,7 +24,7 @@
#define HAVE_NTOHLL 1 #define HAVE_NTOHLL 1
#endif #endif
#if _MSC_VER >= _MSC_VER_2005 #if _MSC_VER >= _MSC_VER_2008
#pragma warning(disable : 4996) // Disable warnings about 'deprecated' standard functions #pragma warning(disable : 4996) // Disable warnings about 'deprecated' standard functions
#pragma warning(disable : 4251) // Disable warnings from std templates about exporting interfaces #pragma warning(disable : 4251) // Disable warnings from std templates about exporting interfaces
#endif #endif

@ -149,11 +149,7 @@ static int error(std::string& errors, const char* msg, const char* x, const char
static const size_t buffer_size = 512; static const size_t buffer_size = 512;
char buffer[buffer_size]; char buffer[buffer_size];
memset(buffer, 0, buffer_size); memset(buffer, 0, buffer_size);
#ifdef MSDEV_2003
sprintf(buffer,msg,x,y,z);
#else
snprintf(buffer, buffer_size, msg, x, y, z) ; snprintf(buffer, buffer_size, msg, x, y, z) ;
#endif
if ( errno ) { if ( errno ) {
perror(buffer) ; perror(buffer) ;
} else { } else {
@ -300,11 +296,7 @@ int Exiv2::http(Exiv2::Dictionary& request,Exiv2::Dictionary& response,std::stri
//////////////////////////////////// ////////////////////////////////////
// format the request // format the request
#ifdef MSDEV_2003
int n = sprintf(buffer,httpTemplate,verb,page,version,servername,header) ;
#else
int n = snprintf(buffer,buff_l,httpTemplate,verb,page,version,servername,header) ; int n = snprintf(buffer,buff_l,httpTemplate,verb,page,version,servername,header) ;
#endif
buffer[n] = 0 ; buffer[n] = 0 ;
response["requestheaders"]=std::string(buffer,n); response["requestheaders"]=std::string(buffer,n);
@ -386,21 +378,12 @@ int Exiv2::http(Exiv2::Dictionary& request,Exiv2::Dictionary& response,std::stri
} }
if ( n != FINISH || !OK(status) ) { if ( n != FINISH || !OK(status) ) {
#ifdef MSDEV_2003
sprintf(buffer,"wsa_error = %d,n = %d,sleep_ = %d status = %d"
, WSAGetLastError()
, n
, sleep_
, status
) ;
#else
snprintf(buffer,sizeof buffer,"wsa_error = %d,n = %d,sleep_ = %d status = %d" snprintf(buffer,sizeof buffer,"wsa_error = %d,n = %d,sleep_ = %d status = %d"
, WSAGetLastError() , WSAGetLastError()
, n , n
, sleep_ , sleep_
, status , status
) ; ) ;
#endif
error(errors,buffer,NULL,NULL,0) ; error(errors,buffer,NULL,NULL,0) ;
} else if ( bSearching && OK(status) ) { } else if ( bSearching && OK(status) ) {
if ( end ) { if ( end ) {

@ -28,11 +28,6 @@ namespace Exiv2
{ {
namespace Internal namespace Internal
{ {
#ifdef MSDEV_2003
#undef vsnprintf
#define vsnprintf _vsnprintf
#endif
std::string stringFormat(const char* format, ...) std::string stringFormat(const char* format, ...)
{ {
std::string result; std::string result;

Loading…
Cancel
Save