Author: [email protected]
Date: Wed Mar 18 08:20:26 2009
New Revision: 1538

Modified:
    branches/bleeding_edge/samples/shell.cc
    branches/bleeding_edge/src/conversions-inl.h
    branches/bleeding_edge/src/platform-linux.cc
    branches/bleeding_edge/src/unicode.cc

Log:
Misc. portability fixes.
Review URL: http://codereview.chromium.org/42337

Modified: branches/bleeding_edge/samples/shell.cc
==============================================================================
--- branches/bleeding_edge/samples/shell.cc     (original)
+++ branches/bleeding_edge/samples/shell.cc     Wed Mar 18 08:20:26 2009
@@ -26,9 +26,10 @@
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

  #include <v8.h>
-#include <cstring>
-#include <cstdio>
-#include <cstdlib>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>


  void RunShell(v8::Handle<v8::Context> context);

Modified: branches/bleeding_edge/src/conversions-inl.h
==============================================================================
--- branches/bleeding_edge/src/conversions-inl.h        (original)
+++ branches/bleeding_edge/src/conversions-inl.h        Wed Mar 18 08:20:26 2009
@@ -30,6 +30,7 @@

  #include <math.h>
  #include <float.h>         // required for DBL_MAX and on Win32 for  
finite()
+#include <stdarg.h>

  //  
----------------------------------------------------------------------------
  // Extra POSIX/ANSI functions for Win32/MSVC.

Modified: branches/bleeding_edge/src/platform-linux.cc
==============================================================================
--- branches/bleeding_edge/src/platform-linux.cc        (original)
+++ branches/bleeding_edge/src/platform-linux.cc        Wed Mar 18 08:20:26 2009
@@ -42,8 +42,8 @@
  #include <sys/types.h>  // mmap & munmap
  #include <sys/mman.h>   // mmap & munmap
  #include <sys/stat.h>   // open
-#include <sys/fcntl.h>  // open
-#include <unistd.h>     // getpagesize
+#include <fcntl.h>      // open
+#include <unistd.h>     // sysconf
  #include <execinfo.h>   // backtrace, backtrace_symbols
  #include <strings.h>    // index
  #include <errno.h>
@@ -230,14 +230,14 @@


  size_t OS::AllocateAlignment() {
-  return getpagesize();
+  return sysconf(_SC_PAGESIZE);
  }


  void* OS::Allocate(const size_t requested,
                     size_t* allocated,
                     bool executable) {
-  const size_t msize = RoundUp(requested, getpagesize());
+  const size_t msize = RoundUp(requested, sysconf(_SC_PAGESIZE));
    int prot = PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0);
    void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANONYMOUS, -1,  
0);
    if (mbase == MAP_FAILED) {

Modified: branches/bleeding_edge/src/unicode.cc
==============================================================================
--- branches/bleeding_edge/src/unicode.cc       (original)
+++ branches/bleeding_edge/src/unicode.cc       Wed Mar 18 08:20:26 2009
@@ -28,8 +28,8 @@
  // This file was generated at 2008-11-25 16:02:40.592795

  #include "unicode-inl.h"
-#include <cstdlib>
-#include <cstdio>
+#include <stdlib.h>
+#include <stdio.h>

  namespace unibrow {


--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to