Index: common.h
===================================================================
--- common.h	(revision 339)
+++ common.h	(revision 340)
@@ -19,14 +19,26 @@
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#ifdef MAIN_H
-#define __global extern
+#ifdef RAYDLL
+#   ifdef MAIN_H
+#       define __global __declspec(dllimport)
+#       define __rayapi __declspec(dllimport)
+#   endif
+#   ifdef MAIN_C
+#       define __global __declspec(dllexport)
+#       define __rayapi __declspec(dllexport)
+#   endif
+#else
+#    ifdef MAIN_H
+#       define __global extern
+#       define __rayapi
+#    endif
+#    ifdef MAIN_C
+#       define __global
+#       define __rayapi
+#    endif
 #endif
 
-#ifdef MAIN_C
-#define __global
-#endif
-
 #ifdef SWIG
 #define __global
 #endif