# HG changeset patch # User John Tsiombikas # Date 1280611437 -3600 # Node ID d9a1bab1c3f57ded4f241a6ae43a062343f6eb68 # Parent 2da57bedc5509385307d054ba0d0a9ae6573c5d2 ported to windows diff -r 2da57bedc550 -r d9a1bab1c3f5 clray.vcproj --- a/clray.vcproj Fri Jul 30 19:28:18 2010 +0100 +++ b/clray.vcproj Sat Jul 31 22:23:57 2010 +0100 @@ -41,7 +41,7 @@ #include "mesh.h" +#ifndef PATH_MAX +#define PATH_MAX 512 +#endif + using namespace std; #define COMMANDS \ diff -r 2da57bedc550 -r d9a1bab1c3f5 src/ocl.cc --- a/src/ocl.cc Fri Jul 30 19:28:18 2010 +0100 +++ b/src/ocl.cc Sat Jul 31 22:23:57 2010 +0100 @@ -5,7 +5,11 @@ #include #include #include +#ifndef _MSC_VER #include +#else +#include +#endif #include #include "ocl.h" #include "ocl_errstr.h" diff -r 2da57bedc550 -r d9a1bab1c3f5 src/rt.cc --- a/src/rt.cc Fri Jul 30 19:28:18 2010 +0100 +++ b/src/rt.cc Sat Jul 31 22:23:57 2010 +0100 @@ -5,19 +5,33 @@ #include "ocl.h" #include "mesh.h" +#ifdef __GNUC__ +#define PACKED __attribute__((packed)) +#else +#define PACKED +#endif + +#ifdef _MSC_VER +#pragma push(pack, 1) +#endif + struct RendInfo { int xsz, ysz; int num_faces, num_lights; int max_iter; -} __attribute__((packed)); +} PACKED; struct Ray { float origin[4], dir[4]; -} __attribute__((packed)); +} PACKED; struct Light { float pos[4], color[4]; -} __attribute__((packed)); +} PACKED; + +#ifdef _MSC_VER +#pragma pop(pack) +#endif static Ray get_primary_ray(int x, int y, int w, int h, float vfov_deg);