fix for building on windows, clear some warnings too

This commit is contained in:
Campbell Barton
2011-09-27 01:32:27 +00:00
parent 2170301204
commit f4dec97cef
6 changed files with 23 additions and 12 deletions

View File

@@ -1153,14 +1153,19 @@ endif()
# set the endian define # set the endian define
include(TestBigEndian) if(MSVC)
test_big_endian(_SYSTEM_BIG_ENDIAN) # for some reason this fails on msvc
if(_SYSTEM_BIG_ENDIAN)
add_definitions(-D__BIG_ENDIAN__)
else()
add_definitions(-D__LITTLE_ENDIAN__) add_definitions(-D__LITTLE_ENDIAN__)
else()
include(TestBigEndian)
test_big_endian(_SYSTEM_BIG_ENDIAN)
if(_SYSTEM_BIG_ENDIAN)
add_definitions(-D__BIG_ENDIAN__)
else()
add_definitions(-D__LITTLE_ENDIAN__)
endif()
unset(_SYSTEM_BIG_ENDIAN)
endif() endif()
unset(_SYSTEM_BIG_ENDIAN)
if(WITH_IMAGE_OPENJPEG) if(WITH_IMAGE_OPENJPEG)

View File

@@ -257,7 +257,11 @@ int frameserver_loop(RenderData *rd, ReportList *UNUSED(reports))
struct timeval tv; struct timeval tv;
struct sockaddr_in addr; struct sockaddr_in addr;
int len, rval; int len, rval;
#ifdef FREE_WINDOWS
int socklen;
#else
unsigned int socklen; unsigned int socklen;
#endif
char buf[4096]; char buf[4096];
if (connsock != -1) { if (connsock != -1) {

View File

@@ -488,7 +488,7 @@ LinkNode *BLI_read_file_as_lines(const char *name)
buf= MEM_mallocN(size, "file_as_lines"); buf= MEM_mallocN(size, "file_as_lines");
if (buf) { if (buf) {
int i, last= 0; size_t i, last= 0;
/* /*
* size = because on win32 reading * size = because on win32 reading

View File

@@ -301,7 +301,7 @@ char* dirname(char *path)
{ {
char *p; char *p;
if( path == NULL || *path == '\0' ) if( path == NULL || *path == '\0' )
return "."; return ".";
p = path + strlen(path) - 1; p = path + strlen(path) - 1;
while( *p == '/' ) { while( *p == '/' ) {
if( p == path ) if( p == path )
@@ -309,11 +309,11 @@ char* dirname(char *path)
*p-- = '\0'; *p-- = '\0';
} }
while( p >= path && *p != '/' ) while( p >= path && *p != '/' )
p--; p--;
return return
p < path ? "." : p < path ? "." :
p == path ? "/" : p == path ? "/" :
(*p = '\0', path); (*p = '\0', path);
} }
/* End of copied part */ /* End of copied part */

View File

@@ -34,6 +34,7 @@
#ifndef UI_INTERFACE_H #ifndef UI_INTERFACE_H
#define UI_INTERFACE_H #define UI_INTERFACE_H
#include "BLO_sys_types.h" /* size_t */
#include "RNA_types.h" #include "RNA_types.h"
#include "DNA_userdef_types.h" #include "DNA_userdef_types.h"

View File

@@ -33,6 +33,7 @@
#ifndef ED_NODE_INTERN_H #ifndef ED_NODE_INTERN_H
#define ED_NODE_INTERN_H #define ED_NODE_INTERN_H
#include <stddef.h> /* for size_t */
#include "UI_interface.h" #include "UI_interface.h"
/* internal exports only */ /* internal exports only */