diff -Naur inline/R/cfunction.R inline.new/R/cfunction.R
--- inline/R/cfunction.R	2007-05-23 10:42:00.000000000 -0400
+++ inline.new/R/cfunction.R	2007-05-23 13:13:38.625000000 -0400
@@ -23,11 +23,12 @@
   code <- paste( code, "\n  warning(\"your C program does not return anything!\");\n  return R_NilValue;\n}\n", sep="");
   
   ## WRITE AND COMPILE THE CODE
-  if ( length(grep("windows", tolower(version))) > 0 ) {
+  if ( .Platform$OS.type == "windows" ) {
     ## windows files
-    libCFile  <- paste(tempdir(), "\\", f, ".cpp", sep="")
-    libLFile  <- paste(tempdir(), "\\", f, ".dll", sep="")
-    libLFile2 <- paste(tempdir(), "\\", f, ".dll", sep="")
+    dir <- gsub("\\\\", "/", tempdir())
+    libCFile  <- paste(dir, "/", f, ".cpp", sep="")
+    libLFile  <- paste(dir, "/", f, ".dll", sep="")
+    libLFile2 <- paste(dir, "/", f, ".dll", sep="")
   } else {
     ## UNIX-alike build
     libCFile  <- paste(tempdir(), "/", f, ".cpp", sep="")
diff -Naur inline/R/cmethods.R inline.new/R/cmethods.R
--- inline/R/cmethods.R	2007-05-23 11:29:54.000000000 -0400
+++ inline.new/R/cmethods.R	2007-05-23 13:18:34.015625000 -0400
@@ -15,12 +15,12 @@
     fSigs <- paste( "SEXP ", fIDs, "(", fSigs, ")", sep="")
     ## library c/cpp and so file ids
     libID <- basename(tempfile())
-    if ( length(grep("windows", tolower(version))) > 0 ) {
+    if ( .Platform$OS.type == "windows" ) {
       ## windows files
-      if ( cpp )
-      libCFile  <- paste(tempdir(), "\\", libID, ".cpp", sep="")
-      libLFile  <- paste(tempdir(), "\\", libID, ".dll", sep="")
-      libLFile2 <- paste(tempdir(), "\\", libID, ".dll", sep="")
+      dir <- gsub("\\\\", "/", tempdir())
+      libCFile  <- paste(dir, "/", libID, ".cpp", sep="")
+      libLFile  <- paste(dir, "/", libID, ".dll", sep="")
+      libLFile2 <- paste(dir, "/", libID, ".dll", sep="")
     } else {
       ## UNIX-alike build
       libCFile  <- paste(tempdir(), "/", libID, ".cpp", sep="")
