Fix for 64 bit machines.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@152 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
parent
41cb45146c
commit
bdda54a66b
@ -41,12 +41,14 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#ifndef UPNP_USE_BCBPP
|
#ifndef UPNP_USE_BCBPP
|
||||||
#ifndef UPNP_USE_MSVCPP
|
#ifndef UPNP_USE_MSVCPP
|
||||||
|
#include <inttypes.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@ -54,7 +56,6 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#else
|
#else
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
@ -1908,7 +1909,7 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
{
|
{
|
||||||
bignum = ( off_t )va_arg( argp, off_t );
|
bignum = ( off_t )va_arg( argp, off_t );
|
||||||
|
|
||||||
sprintf( tempbuf, "%lld", (int64_t)bignum );
|
sprintf( tempbuf, "%"PRId64, (int64_t)bignum );
|
||||||
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
|
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,8 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifndef UPNP_USE_BCBPP
|
#ifndef UPNP_USE_BCBPP
|
||||||
#ifndef UPNP_USE_MSVCPP
|
#ifndef UPNP_USE_MSVCPP
|
||||||
#include <stdint.h>
|
#include <inttypes.h>
|
||||||
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
@ -54,7 +55,7 @@
|
|||||||
#include "ssdplib.h"
|
#include "ssdplib.h"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
@ -990,7 +991,7 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
|||||||
Instr->RangeOffset = FirstByte;
|
Instr->RangeOffset = FirstByte;
|
||||||
Instr->ReadSendSize = LastByte - FirstByte + 1;
|
Instr->ReadSendSize = LastByte - FirstByte + 1;
|
||||||
sprintf( Instr->RangeHeader,
|
sprintf( Instr->RangeHeader,
|
||||||
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
|
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
|
||||||
(int64_t)FirstByte,
|
(int64_t)FirstByte,
|
||||||
(int64_t)LastByte,
|
(int64_t)LastByte,
|
||||||
(int64_t)FileLength ); //Data between two range.
|
(int64_t)FileLength ); //Data between two range.
|
||||||
@ -999,7 +1000,7 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
|||||||
Instr->RangeOffset = FirstByte;
|
Instr->RangeOffset = FirstByte;
|
||||||
Instr->ReadSendSize = FileLength - FirstByte;
|
Instr->ReadSendSize = FileLength - FirstByte;
|
||||||
sprintf( Instr->RangeHeader,
|
sprintf( Instr->RangeHeader,
|
||||||
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
|
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
|
||||||
(int64_t)FirstByte,
|
(int64_t)FirstByte,
|
||||||
(int64_t)(FileLength - 1),
|
(int64_t)(FileLength - 1),
|
||||||
(int64_t)FileLength );
|
(int64_t)FileLength );
|
||||||
@ -1008,14 +1009,14 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
|||||||
Instr->RangeOffset = 0;
|
Instr->RangeOffset = 0;
|
||||||
Instr->ReadSendSize = FileLength;
|
Instr->ReadSendSize = FileLength;
|
||||||
sprintf( Instr->RangeHeader,
|
sprintf( Instr->RangeHeader,
|
||||||
"CONTENT-RANGE: bytes 0-%lld/%lld\r\n",
|
"CONTENT-RANGE: bytes 0-%"PRId64"/%"PRId64"\r\n",
|
||||||
(int64_t)(FileLength - 1),
|
(int64_t)(FileLength - 1),
|
||||||
(int64_t)FileLength );
|
(int64_t)FileLength );
|
||||||
} else {
|
} else {
|
||||||
Instr->RangeOffset = FileLength - LastByte;
|
Instr->RangeOffset = FileLength - LastByte;
|
||||||
Instr->ReadSendSize = LastByte;
|
Instr->ReadSendSize = LastByte;
|
||||||
sprintf( Instr->RangeHeader,
|
sprintf( Instr->RangeHeader,
|
||||||
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
|
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
|
||||||
(int64_t)(FileLength - LastByte + 1),
|
(int64_t)(FileLength - LastByte + 1),
|
||||||
(int64_t)FileLength,
|
(int64_t)FileLength,
|
||||||
(int64_t)FileLength );
|
(int64_t)FileLength );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user