Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-05-03 22:29:11 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-05-03 22:29:11 +0400
commit2996f08f845c4b67b0231d5832668da5ddb2d227 (patch)
tree419f3dbd78a19398883a405606f7a7de83084d90
parent170f8c8c4109afb366bac0f385d9e2f59af6c8e2 (diff)
Cycles: first batch of windows build fixes, not quite there yet.
-rw-r--r--intern/cycles/blender/CMakeLists.txt25
-rw-r--r--intern/cycles/blender/blender_camera.cpp2
-rw-r--r--intern/cycles/blender/blender_util.h4
-rw-r--r--intern/cycles/bvh/bvh.cpp2
-rw-r--r--intern/cycles/bvh/bvh.h2
-rw-r--r--intern/cycles/bvh/bvh_build.cpp4
-rw-r--r--intern/cycles/cmake/external_libs.cmake9
-rw-r--r--intern/cycles/cmake/platforms.cmake2
-rw-r--r--intern/cycles/device/CMakeLists.txt2
-rw-r--r--intern/cycles/device/device_cuda.cpp23
-rw-r--r--intern/cycles/kernel/kernel_film.h6
-rw-r--r--intern/cycles/kernel/svm/svm_noise.h6
-rw-r--r--intern/cycles/kernel/svm/svm_texture.h4
-rw-r--r--intern/cycles/render/CMakeLists.txt10
-rw-r--r--intern/cycles/render/buffers.h2
-rw-r--r--intern/cycles/render/nodes.cpp4
-rw-r--r--intern/cycles/render/object.h2
-rw-r--r--intern/cycles/render/shader.h2
-rw-r--r--intern/cycles/render/svm.h2
-rw-r--r--intern/cycles/subd/subd_build.cpp18
-rw-r--r--intern/cycles/subd/subd_split.cpp4
-rw-r--r--intern/cycles/util/util_map.h2
-rw-r--r--intern/cycles/util/util_math.h3
-rw-r--r--intern/cycles/util/util_set.h2
-rw-r--r--intern/cycles/util/util_types.h5
-rw-r--r--intern/guardedalloc/MEM_guardedalloc.h4
-rw-r--r--source/blender/makesrna/RNA_types.h6
-rw-r--r--source/blender/makesrna/intern/makesrna.c12
28 files changed, 112 insertions, 57 deletions
diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt
index 096363e5d9f..56d08b61b65 100644
--- a/intern/cycles/blender/CMakeLists.txt
+++ b/intern/cycles/blender/CMakeLists.txt
@@ -29,7 +29,8 @@ INCLUDE_DIRECTORIES(
../util
../subd
${BLENDER_INCLUDE_DIRS}
- ${PYTHON_INCLUDE_DIRS})
+ ${PYTHON_INCLUDE_DIRS}
+ ${GLEW_INCLUDE_PATH})
SET(LIBRARIES
cycles_render
@@ -41,7 +42,6 @@ SET(LIBRARIES
${Boost_LIBRARIES}
${OPENGL_LIBRARIES}
${OPENIMAGEIO_LIBRARY}
- ${PYTHON_LIBRARIES}
${GLUT_LIBRARIES}
${GLEW_LIBRARIES}
${BLENDER_LIBRARIES})
@@ -58,10 +58,21 @@ IF(WITH_CYCLES_OPENCL)
LIST(APPEND LIBRARIES ${OPENCL_LIBRARIES})
ENDIF()
+LINK_DIRECTORIES(${PYTHON_LIBPATH})
SET(CMAKE_MODULE_LINKER_FLAGS ${PYTHON_MODULE_FLAGS})
ADD_LIBRARY(cycles_blender MODULE ${sources} ${headers})
ADD_DEPENDENCIES(cycles_blender bf_rna)
+
+IF(WIN32)
+ TARGET_LINK_LIBRARIES(cycles_blender ${PYTHON_LINKFLAGS})
+ TARGET_LINK_LIBRARIES(cycles_blender debug ${PYTHON_LIBRARY}_d)
+ TARGET_LINK_LIBRARIES(cycles_blender optimized ${PYTHON_LIBRARY})
+
+ SET_TARGET_PROPERTIES(cycles_blender PROPERTIES PREFIX "lib")
+ SET_TARGET_PROPERTIES(cycles_blender PROPERTIES SUFFIX ".pyd")
+ENDIF()
+
TARGET_LINK_LIBRARIES(cycles_blender ${LIBRARIES})
INSTALL(FILES ${addonfiles} DESTINATION ${CYCLES_INSTALL_PATH}/cycles)
@@ -71,3 +82,13 @@ IF(UNIX AND NOT APPLE)
SET_TARGET_PROPERTIES(cycles_blender PROPERTIES INSTALL_RPATH $ORIGIN/lib)
ENDIF()
+# Install DLL's
+
+IF(WIN32)
+ FILE(GLOB OIIO_DLLS "${CYCLES_OIIO}/bin/*.dll")
+ FILE(GLOB BOOST_DLLS "${CYCLES_BOOST}/lib/*.dll")
+ INSTALL(FILES ${OIIO_DLLS} ${BOOST_DLLS}
+ DESTINATION ${CYCLES_INSTALL_PATH}/cycles)
+ENDIF()
+
+
diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp
index cc4cfda8793..530193247ae 100644
--- a/intern/cycles/blender/blender_camera.cpp
+++ b/intern/cycles/blender/blender_camera.cpp
@@ -218,7 +218,7 @@ void BlenderSync::sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int
blender_camera_from_object(&bcam, b_ob);
/* magic zoom formula */
- bcam.zoom = b_rv3d.view_camera_zoom();
+ bcam.zoom = (float)b_rv3d.view_camera_zoom();
bcam.zoom = (1.41421f + bcam.zoom/50.0f);
bcam.zoom *= bcam.zoom;
bcam.zoom = 2.0f/bcam.zoom;
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index 9da1c1dfe05..715dc7e6fb0 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -77,7 +77,7 @@ static inline void object_free_duplilist(BL::Object self)
static inline bool object_is_modified(BL::Object self, BL::Scene scene, bool preview)
{
- return rna_Object_is_modified(self.ptr.data, scene.ptr.data, (preview)? (1<<0): (1<<1));
+ return rna_Object_is_modified(self.ptr.data, scene.ptr.data, (preview)? (1<<0): (1<<1))? true: false;
}
/* Utilities */
@@ -139,7 +139,7 @@ static inline uint get_layer(BL::Array<int, 20> array)
static inline bool get_boolean(PointerRNA& ptr, const char *name)
{
- return RNA_boolean_get(&ptr, name);
+ return RNA_boolean_get(&ptr, name)? true: false;
}
static inline float get_float(PointerRNA& ptr, const char *name)
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index ab230794774..664bdd98b1f 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -467,7 +467,7 @@ void RegularBVH::refit_nodes()
assert(!params.top_level);
BoundBox bbox;
- refit_node(0, pack.is_leaf[0], bbox);
+ refit_node(0, (pack.is_leaf[0])? true: false, bbox);
}
void RegularBVH::refit_node(int idx, bool leaf, BoundBox& bbox)
diff --git a/intern/cycles/bvh/bvh.h b/intern/cycles/bvh/bvh.h
index acc25291da3..6b877594422 100644
--- a/intern/cycles/bvh/bvh.h
+++ b/intern/cycles/bvh/bvh.h
@@ -26,7 +26,7 @@
CCL_NAMESPACE_BEGIN
class BVHNode;
-class BVHStackEntry;
+struct BVHStackEntry;
class BVHParams;
class BoundBox;
class CacheData;
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp
index 6a9cc915f01..3e47cb75014 100644
--- a/intern/cycles/bvh/bvh_build.cpp
+++ b/intern/cycles/bvh/bvh_build.cpp
@@ -359,8 +359,8 @@ BVHBuild::SpatialSplit BVHBuild::find_spatial_split(const NodeSpec& spec, float
const Reference& ref = references[refIdx];
float3 firstBinf = (ref.bounds.min - origin) * invBinSize;
float3 lastBinf = (ref.bounds.max - origin) * invBinSize;
- int3 firstBin = make_int3(firstBinf.x, firstBinf.y, firstBinf.z);
- int3 lastBin = make_int3(lastBinf.x, lastBinf.y, lastBinf.z);
+ int3 firstBin = make_int3((int)firstBinf.x, (int)firstBinf.y, (int)firstBinf.z);
+ int3 lastBin = make_int3((int)lastBinf.x, (int)lastBinf.y, (int)lastBinf.z);
firstBin = clamp(firstBin, 0, BVHParams::NUM_SPATIAL_BINS - 1);
lastBin = clamp(lastBin, firstBin, BVHParams::NUM_SPATIAL_BINS - 1);
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index 5d1ed868574..cfd997a6469 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -8,9 +8,6 @@ SET(Boost_ADDITIONAL_VERSIONS "1.45" "1.44"
"1.41" "1.41.0" "1.40" "1.40.0"
"1.39" "1.39.0" "1.38" "1.38.0"
"1.37" "1.37.0" "1.34.1" "1_34_1")
-IF(LINKSTATIC)
- SET(Boost_USE_STATIC_LIBS ON)
-ENDIF()
SET(Boost_USE_MULTITHREADED ON)
@@ -25,6 +22,8 @@ MESSAGE(STATUS "Boost libraries ${Boost_LIBRARIES}")
INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}")
LINK_DIRECTORIES("${Boost_LIBRARY_DIRS}")
+ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB)
+
IF(WITH_CYCLES_NETWORK)
ADD_DEFINITIONS(-DWITH_NETWORK)
ENDIF()
@@ -126,8 +125,10 @@ IF(WITH_CYCLES_BLENDER)
${CMAKE_SOURCE_DIR}/source/blender/blenloader
${CMAKE_BINARY_DIR}/source/blender/makesrna/intern)
IF(WIN32)
- SET(BLENDER_LIBRARIES ${CMAKE_BINARY_DIR}/bin/Release/blender.lib)
+ SET(BLENDER_LIBRARIES ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/blender.lib)
ENDIF()
+
+ ADD_DEFINITIONS(-DBLENDER_PLUGIN)
ENDIF()
###########################################################################
diff --git a/intern/cycles/cmake/platforms.cmake b/intern/cycles/cmake/platforms.cmake
index 075b4761a85..659fd5dcad3 100644
--- a/intern/cycles/cmake/platforms.cmake
+++ b/intern/cycles/cmake/platforms.cmake
@@ -11,7 +11,7 @@ IF(APPLE)
ENDIF(APPLE)
IF(WIN32)
- SET(CMAKE_CXX_FLAGS "-D_CRT_SECURE_NO_WARNINGS /EHsc /fp:fast")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS /EHsc /fp:fast")
SET(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
SET(PYTHON_MODULE_FLAGS "-DLL")
ENDIF(WIN32)
diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt
index 0885cd6fc20..712351b9558 100644
--- a/intern/cycles/device/CMakeLists.txt
+++ b/intern/cycles/device/CMakeLists.txt
@@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES(
../util
../render
${OPENGL_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR})
+ ${GLEW_INCLUDE_PATH})
SET(sources
device.cpp
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 76692ba8657..0537e231f44 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -356,7 +356,8 @@ public:
cuda_assert(cuParamSetv(cuPathTrace, offset, &d_rng_state, sizeof(d_rng_state)))
offset += sizeof(d_rng_state);
- offset = cuda_align_up(offset, __alignof(task.pass));
+ int pass = task.pass;
+ offset = cuda_align_up(offset, __alignof(pass));
cuda_assert(cuParamSeti(cuPathTrace, offset, task.pass))
offset += sizeof(task.pass);
@@ -413,7 +414,8 @@ public:
cuda_assert(cuParamSetv(cuFilmConvert, offset, &d_buffer, sizeof(d_buffer)))
offset += sizeof(d_buffer);
- offset = cuda_align_up(offset, __alignof(task.pass));
+ int pass = task.pass;
+ offset = cuda_align_up(offset, __alignof(pass));
cuda_assert(cuParamSeti(cuFilmConvert, offset, task.pass))
offset += sizeof(task.pass);
@@ -475,7 +477,8 @@ public:
cuda_assert(cuParamSetv(cuDisplace, offset, &d_offset, sizeof(d_offset)))
offset += sizeof(d_offset);
- offset = cuda_align_up(offset, __alignof(task.displace_x));
+ int displace_x = task.displace_x;
+ offset = cuda_align_up(offset, __alignof(displace_x));
cuda_assert(cuParamSeti(cuDisplace, offset, task.displace_x))
offset += sizeof(task.displace_x);
@@ -621,18 +624,18 @@ public:
glColor3f(1.0f, 1.0f, 1.0f);
glPushMatrix();
- glTranslatef(0, y, 0.0f);
+ glTranslatef(0.0f, (float)y, 0.0f);
glBegin(GL_QUADS);
- glTexCoord2f(0, 0);
- glVertex2f(0, 0);
+ glTexCoord2f(0.0f, 0.0f);
+ glVertex2f(0.0f, 0.0f);
glTexCoord2f((float)w/(float)width, 0);
- glVertex2f(width, 0);
+ glVertex2f((float)width, 0.0f);
glTexCoord2f((float)w/(float)width, (float)h/(float)height);
- glVertex2f(width, height);
- glTexCoord2f(0, (float)h/(float)height);
- glVertex2f(0, height);
+ glVertex2f((float)width, (float)height);
+ glTexCoord2f(0.0f, (float)h/(float)height);
+ glVertex2f(0.0f, (float)height);
glEnd();
diff --git a/intern/cycles/kernel/kernel_film.h b/intern/cycles/kernel/kernel_film.h
index 04ea889f4c0..0bbd6c202a1 100644
--- a/intern/cycles/kernel/kernel_film.h
+++ b/intern/cycles/kernel/kernel_film.h
@@ -44,9 +44,9 @@ __device uchar4 film_float_to_byte(float4 color)
uchar4 result;
/* simple float to byte conversion */
- result.x = clamp(color.x*255.0f, 0.0f, 255.0f);
- result.y = clamp(color.y*255.0f, 0.0f, 255.0f);
- result.z = clamp(color.z*255.0f, 0.0f, 255.0f);
+ result.x = (uchar)clamp(color.x*255.0f, 0.0f, 255.0f);
+ result.y = (uchar)clamp(color.y*255.0f, 0.0f, 255.0f);
+ result.z = (uchar)clamp(color.z*255.0f, 0.0f, 255.0f);
result.w = 255;
return result;
diff --git a/intern/cycles/kernel/svm/svm_noise.h b/intern/cycles/kernel/svm/svm_noise.h
index 745744e142c..f41caa99772 100644
--- a/intern/cycles/kernel/svm/svm_noise.h
+++ b/intern/cycles/kernel/svm/svm_noise.h
@@ -143,9 +143,9 @@ __device float perlin_periodic(float x, float y, float z, float3 pperiod)
int3 p;
- p.x = fmaxf(quick_floor(pperiod.x), 1);
- p.y = fmaxf(quick_floor(pperiod.y), 1);
- p.z = fmaxf(quick_floor(pperiod.z), 1);
+ p.x = max(quick_floor(pperiod.x), 1);
+ p.y = max(quick_floor(pperiod.y), 1);
+ p.z = max(quick_floor(pperiod.z), 1);
float u = fade(fx);
float v = fade(fy);
diff --git a/intern/cycles/kernel/svm/svm_texture.h b/intern/cycles/kernel/svm/svm_texture.h
index c5f71c0d5bd..c5ded6d975f 100644
--- a/intern/cycles/kernel/svm/svm_texture.h
+++ b/intern/cycles/kernel/svm/svm_texture.h
@@ -64,12 +64,12 @@ __device void voronoi(float3 p, NodeDistanceMetric distance_metric, float e, flo
for(xx = xi-1; xx <= xi+1; xx++) {
for(yy = yi-1; yy <= yi+1; yy++) {
for(zz = zi-1; zz <= zi+1; zz++) {
- float3 ip = make_float3(xx, yy, zz);
+ float3 ip = make_float3((float)xx, (float)yy, (float)zz);
float3 vp = cellnoise_color(ip);
float3 pd = p - (vp + ip);
float d = voronoi_distance(distance_metric, pd, e);
- vp += make_float3(xx, yy, zz);
+ vp += make_float3((float)xx, (float)yy, (float)zz);
if(d < da[0]) {
da[3] = da[2];
diff --git a/intern/cycles/render/CMakeLists.txt b/intern/cycles/render/CMakeLists.txt
index f2342c9032a..9a0583c48aa 100644
--- a/intern/cycles/render/CMakeLists.txt
+++ b/intern/cycles/render/CMakeLists.txt
@@ -1,5 +1,13 @@
-INCLUDE_DIRECTORIES(. ../device ../kernel ../kernel/svm ../kernel/osl ../bvh ../util)
+INCLUDE_DIRECTORIES(
+ .
+ ../device
+ ../kernel
+ ../kernel/svm
+ ../kernel/osl
+ ../bvh
+ ../util
+ ${GLEW_INCLUDE_PATH})
SET(sources
attribute.cpp
diff --git a/intern/cycles/render/buffers.h b/intern/cycles/render/buffers.h
index f31ddd1e9bd..1922f875d86 100644
--- a/intern/cycles/render/buffers.h
+++ b/intern/cycles/render/buffers.h
@@ -28,7 +28,7 @@
CCL_NAMESPACE_BEGIN
class Device;
-class float4;
+struct float4;
/* Render Buffers */
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 42cadb8faa7..ea1b794b176 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -990,8 +990,8 @@ void BsdfNode::compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *
compiler.add_node(NODE_CLOSURE_BSDF,
closure,
- (param1)? __float_as_int(param1->value.x): 0.0f,
- (param2)? __float_as_int(param2->value.x): 0.0f);
+ __float_as_int((param1)? param1->value.x: 0.0f),
+ __float_as_int((param2)? param2->value.x: 0.0f));
}
void BsdfNode::compile(SVMCompiler& compiler)
diff --git a/intern/cycles/render/object.h b/intern/cycles/render/object.h
index ff92b381063..7a12a06853b 100644
--- a/intern/cycles/render/object.h
+++ b/intern/cycles/render/object.h
@@ -31,7 +31,7 @@ class DeviceScene;
class Mesh;
class Progress;
class Scene;
-class Transform;
+struct Transform;
/* Object */
diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h
index 0712100b3e7..cc8bc473a3f 100644
--- a/intern/cycles/render/shader.h
+++ b/intern/cycles/render/shader.h
@@ -35,7 +35,7 @@ class Mesh;
class Progress;
class Scene;
class ShaderGraph;
-class float3;
+struct float3;
/* Shader describing the appearance of a Mesh, Light or Background.
*
diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h
index 346d2a73801..f76649e4a6f 100644
--- a/intern/cycles/render/svm.h
+++ b/intern/cycles/render/svm.h
@@ -30,7 +30,7 @@ CCL_NAMESPACE_BEGIN
class Device;
class DeviceScene;
class ImageManager;
-class KernelSunSky;
+struct KernelSunSky;
class Scene;
class ShaderGraph;
class ShaderInput;
diff --git a/intern/cycles/subd/subd_build.cpp b/intern/cycles/subd/subd_build.cpp
index 4c2a6299014..640c30eba9d 100644
--- a/intern/cycles/subd/subd_build.cpp
+++ b/intern/cycles/subd/subd_build.cpp
@@ -228,7 +228,7 @@ void SubdAccBuilder::computeEdgeStencil(SubdFaceRing *ring, GregoryAccStencil *s
computeBoundaryTangentStencils(ring, vert, r0, r1);
int k = valence - 1;
- float omega = M_PI / k;
+ float omega = M_PI_F / k;
int eid1 = edge1Indices[primitiveOffset + v];
int eid2 = edge2Indices[primitiveOffset + v];
@@ -298,7 +298,7 @@ void SubdAccBuilder::computeEdgeStencil(SubdFaceRing *ring, GregoryAccStencil *s
}
}
else {
- float costerm = cosf(M_PI / valence);
+ float costerm = cosf(M_PI_F / valence);
float sqrtterm = sqrtf(4.0f + costerm*costerm);
/* float tangentScale = 1.0f; */
@@ -319,11 +319,11 @@ void SubdAccBuilder::computeEdgeStencil(SubdFaceRing *ring, GregoryAccStencil *s
SubdEdge *edge = eit.current();
assert(vert->co == edge->from()->co);
- float costerm1_a = cosf(M_PI * 2 * (j-i1) / valence);
- float costerm1_b = cosf(M_PI * (2 * (j-i1)-1) / valence); /* -1 instead of +1 b/c of edge->next->to() */
+ float costerm1_a = cosf(M_PI_F * 2 * (j-i1) / valence);
+ float costerm1_b = cosf(M_PI_F * (2 * (j-i1)-1) / valence); /* -1 instead of +1 b/c of edge->next->to() */
- float costerm2_a = cosf(M_PI * 2 * (j-i2) / valence);
- float costerm2_b = cosf(M_PI * (2 * (j-i2)-1) / valence); /* -1 instead of +1 b/c of edge->next->to() */
+ float costerm2_a = cosf(M_PI_F * 2 * (j-i2) / valence);
+ float costerm2_b = cosf(M_PI_F * (2 * (j-i2)-1) / valence); /* -1 instead of +1 b/c of edge->next->to() */
stencil->get(eid1, edge->to()) += alpha * costerm1_a;
@@ -413,10 +413,10 @@ void SubdAccBuilder::computeInteriorStencil(SubdFaceRing *ring, GregoryAccStenci
}
else {
SubdVert *e0 = edge->from();
- float costerm0 = cosf(2.0f * M_PI / pseudoValence(e0));
+ float costerm0 = cosf(2.0f * M_PI_F / pseudoValence(e0));
SubdVert *f0 = edge->to();
- float costerm1 = cosf(2.0f * M_PI / pseudoValence(f0));
+ float costerm1 = cosf(2.0f * M_PI_F / pseudoValence(f0));
/* p0 +------+ q0
* | |
@@ -566,7 +566,7 @@ void SubdAccBuilder::computeBoundaryTangentStencils(SubdFaceRing *ring, SubdVert
int valence = vert->valence();
int k = valence - 1;
- float omega = M_PI / k;
+ float omega = M_PI_F / k;
float s = sinf(omega);
float c = cosf(omega);
diff --git a/intern/cycles/subd/subd_split.cpp b/intern/cycles/subd/subd_split.cpp
index 712bd041e64..d61a42e4dcf 100644
--- a/intern/cycles/subd/subd_split.cpp
+++ b/intern/cycles/subd/subd_split.cpp
@@ -82,8 +82,8 @@ int DiagSplit::T(Patch *patch, float2 Pstart, float2 Pend)
Plast = P;
}
- int tmin = ceil(Lsum/dicing_rate);
- int tmax = ceil((test_steps-1)*Lmax/dicing_rate); // XXX paper says N instead of N-1, seems wrong?
+ int tmin = (int)ceil(Lsum/dicing_rate);
+ int tmax = (int)ceil((test_steps-1)*Lmax/dicing_rate); // XXX paper says N instead of N-1, seems wrong?
if(tmax - tmin > split_threshold)
return DSPLIT_NON_UNIFORM;
diff --git a/intern/cycles/util/util_map.h b/intern/cycles/util/util_map.h
index 884f45c3b27..f0abe70f785 100644
--- a/intern/cycles/util/util_map.h
+++ b/intern/cycles/util/util_map.h
@@ -20,7 +20,7 @@
#define __UTIL_MAP_H__
#include <map>
-#include <tr1/unordered_map>
+#include <boost/tr1/unordered_map.hpp>
CCL_NAMESPACE_BEGIN
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 26d6d429b7a..0ab06f94701 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -48,7 +48,8 @@ CCL_NAMESPACE_BEGIN
#ifdef _WIN32
-#define copysignf _copysign
+#define copysignf(x, y) ((float)_copysign(x, y))
+#define hypotf(x, y) _hypotf(x, y)
__device_inline float fmaxf(float a, float b)
{
diff --git a/intern/cycles/util/util_set.h b/intern/cycles/util/util_set.h
index ac310e93e80..8904063dd86 100644
--- a/intern/cycles/util/util_set.h
+++ b/intern/cycles/util/util_set.h
@@ -20,7 +20,7 @@
#define __UTIL_SET_H__
#include <set>
-#include <tr1/unordered_set>
+#include <boost/tr1/unordered_set.hpp>
CCL_NAMESPACE_BEGIN
diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h
index a0e352128d1..bc7ba056390 100644
--- a/intern/cycles/util/util_types.h
+++ b/intern/cycles/util/util_types.h
@@ -34,7 +34,12 @@
#define __local
#define __shared
#define __constant
+
+#ifdef __GNUC__
#define __device_inline static inline __attribute__((always_inline))
+#else
+#define __device_inline static __forceinline
+#endif
#endif
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h
index 1bc7f7c59dd..a4beea6d8d5 100644
--- a/intern/guardedalloc/MEM_guardedalloc.h
+++ b/intern/guardedalloc/MEM_guardedalloc.h
@@ -63,7 +63,11 @@
#ifndef LIBEXPORT
#ifdef _WIN32
+#ifdef BLENDER_PLUGIN
+#define LIBEXPORT __declspec(dllimport)
+#else
#define LIBEXPORT __declspec(dllexport)
+#endif
#else
#define LIBEXPORT
#endif
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 63cc0bb737c..229d0fdb020 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -36,11 +36,17 @@
extern "C" {
#endif
+#ifndef LIBEXPORT
#ifdef _WIN32
+#ifdef BLENDER_PLUGIN
+#define LIBEXPORT __declspec(dllimport)
+#else
#define LIBEXPORT __declspec(dllexport)
+#endif
#else
#define LIBEXPORT
#endif
+#endif
struct ParameterList;
struct FunctionRNA;
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index e056c545ead..49f2969f72d 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -2450,11 +2450,17 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
" Do not edit manually, changes will be overwritten. */\n\n"
"#define RNA_RUNTIME\n\n");
+ fprintf(f, "#ifndef LIBEXPORT\n");
fprintf(f, "#ifdef _WIN32\n");
+ fprintf(f, "#ifdef BLENDER_PLUGIN\n");
+ fprintf(f, "#define LIBEXPORT __declspec(dllimport)\n");
+ fprintf(f, "#else\n");
fprintf(f, "#define LIBEXPORT __declspec(dllexport)\n");
+ fprintf(f, "#endif\n");
fprintf(f, "#else\n");
fprintf(f, "#define LIBEXPORT\n");
- fprintf(f, "#endif\n\n");
+ fprintf(f, "#endif\n");
+ fprintf(f, "#endif\n");
fprintf(f, "#include <float.h>\n");
fprintf(f, "#include <stdio.h>\n");
@@ -2580,7 +2586,7 @@ static const char *cpp_classes = ""
"namespace BL {\n"
"\n"
"#define BOOLEAN_PROPERTY(sname, identifier) \\\n"
-" inline bool sname::identifier(void) { return (bool)sname##_##identifier##_get(&ptr); }\n"
+" inline bool sname::identifier(void) { return sname##_##identifier##_get(&ptr)? true: false; }\n"
"\n"
"#define BOOLEAN_ARRAY_PROPERTY(sname, size, identifier) \\\n"
" inline Array<int,size> sname::identifier(void) \\\n"
@@ -2622,7 +2628,7 @@ static const char *cpp_classes = ""
"public:\n"
" Pointer(const PointerRNA& p) : ptr(p) { }\n"
" operator const PointerRNA&() { return ptr; }\n"
-" bool is_a(StructRNA *type) { return RNA_struct_is_a(ptr.type, type); }\n"
+" bool is_a(StructRNA *type) { return RNA_struct_is_a(ptr.type, type)? true: false; }\n"
" operator void*() { return ptr.data; }\n"
" operator bool() { return ptr.data != NULL; }\n"
"\n"