typedefs corrected, made MS VC++ specific to fix problems of that compiler

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@140 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Oxy 2007-03-02 13:53:08 +00:00
parent 0d451c9c8e
commit 2ac3819f8c
4 changed files with 24 additions and 17 deletions

View File

@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /D "PTW32_STATIC_LIB" /D "UPNP_STATIC_LIB" /FR /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /D "PTW32_STATIC_LIB" /D "UPNP_STATIC_LIB" /D "UPNP_USE_MSVCPP" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "NDEBUG"
@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /machine:I386
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "libupnp - Win32 Debug"
@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I "..\build\inc" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /FR /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I "..\build\inc" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /D "UPNP_USE_MSVCPP" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG"

View File

@ -65,10 +65,11 @@
#else
#define EXPORT_SPEC
#endif
typedef __int64 ulong64;
#ifdef UPNP_USE_MSVCPP // define some things the stupid M$ VC++ doesn't knows
typedef __int64 int64_t;
#endif
#else
#define EXPORT_SPEC
typedef long long ulong64;
#endif
#ifndef WIN32

View File

@ -39,6 +39,9 @@
#include <assert.h>
#include <stdarg.h>
#ifndef UPNP_USE_MSVCPP
#include <stdint.h>
#endif
#ifndef WIN32
#include <arpa/inet.h>
@ -1903,7 +1906,7 @@ http_MakeMessage( INOUT membuffer * buf,
{
bignum = ( off_t )va_arg( argp, off_t );
sprintf( tempbuf, "%lld", (ulong64)bignum );
sprintf( tempbuf, "%lld", (int64_t)bignum );
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
goto error_handler;
}

View File

@ -37,6 +37,9 @@
#include "config.h"
#include <assert.h>
#include <fcntl.h>
#ifndef UPNP_USE_MSVCPP
#include <stdint.h>
#endif
#include "util.h"
#include "strintmap.h"
#include "membuffer.h"
@ -986,34 +989,34 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
Instr->ReadSendSize = LastByte - FirstByte + 1;
sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
(ulong64)FirstByte,
(ulong64)LastByte,
(ulong64)FileLength ); //Data between two range.
(int64_t)FirstByte,
(int64_t)LastByte,
(int64_t)FileLength ); //Data between two range.
} else if( FirstByte >= 0 && LastByte == -1
&& FirstByte < FileLength ) {
Instr->RangeOffset = FirstByte;
Instr->ReadSendSize = FileLength - FirstByte;
sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
(ulong64)FirstByte,
(ulong64)(FileLength - 1),
(ulong64)FileLength );
(int64_t)FirstByte,
(int64_t)(FileLength - 1),
(int64_t)FileLength );
} else if( FirstByte == -1 && LastByte > 0 ) {
if( LastByte >= FileLength ) {
Instr->RangeOffset = 0;
Instr->ReadSendSize = FileLength;
sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes 0-%lld/%lld\r\n",
(ulong64)(FileLength - 1),
(ulong64)FileLength );
(int64_t)(FileLength - 1),
(int64_t)FileLength );
} else {
Instr->RangeOffset = FileLength - LastByte;
Instr->ReadSendSize = LastByte;
sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
(ulong64)(FileLength - LastByte + 1),
(ulong64)FileLength,
(ulong64)FileLength );
(int64_t)(FileLength - LastByte + 1),
(int64_t)FileLength,
(int64_t)FileLength );
}
} else {
free( RangeInput );