[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs
From:       Michael Pyne <mpyne () purinchu ! net>
Date:       2009-06-08 21:28:03
Message-ID: 1244496483.010903.8494.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 979086 by mpyne:

Fix compilation errors on Solaris for good by using a different function \
that does the exact same thing but has a different name, except this time \
the interface is defined properly.

Or in other words s/madvise/posix_madvise/

Configure checks have also been updated.  Not backporting to 4.2, but will \
be in KDE 4.3.

BUG:195262


 M  +3 -3      ConfigureChecks.cmake  
 M  +3 -7      kdecore/sycoca/ksycoca.cpp  
 M  +2 -2      kdeui/util/kpixmapcache.cpp  


--- trunk/KDE/kdelibs/ConfigureChecks.cmake #979085:979086
@@ -99,15 +99,15 @@
 check_symbol_exists(strtoll         "stdlib.h"                 \
HAVE_STRTOLL)     # kioslave  check_symbol_exists(S_ISSOCK        \
"sys/stat.h"               HAVE_S_ISSOCK)    # config.h  \
check_symbol_exists(vsnprintf       "stdio.h"                  \
HAVE_VSNPRINTF)   # config.h +check_symbol_exists(posix_madvise   \
"sys/mman.h"               HAVE_MADVISE)     # kdecore, kdeui  
-
 check_function_exists(posix_fadvise    HAVE_FADVISE)                  # \
kioslave  check_function_exists(backtrace        HAVE_BACKTRACE)            \
# kdecore, kio  check_function_exists(getpagesize      HAVE_GETPAGESIZE)    \
# khtml  check_function_exists(getpeereid       HAVE_GETPEEREID)            \
# kdesu  check_function_exists(fdatasync        HAVE_FDATASYNC)             \
                # kdecore
-check_function_exists(madvise         HAVE_MADVISE)                   # \
                kdecore
-check_function_exists(mmap            HAVE_MMAP)                      # \
kdecore, khtml +check_function_exists(mmap             HAVE_MMAP)           \
# kdecore, khtml +
 if(NOT WIN32)
   # we don't have it on windows but need to export it to be backward \
compatible  # can be removed when 4.1 is out
--- trunk/KDE/kdelibs/kdecore/sycoca/ksycoca.cpp #979085:979086
@@ -62,14 +62,10 @@
  */
 #define KSYCOCA_FILENAME "ksycoca4"
 
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
+#if HAVE_MADVISE
+#include <sys/mman.h> // This #include was checked when looking for \
posix_madvise  #endif
 
-#ifdef Q_OS_SOLARIS
-extern "C" int madvise(caddr_t, size_t, int);
-#endif
-
 #ifndef MAP_FAILED
 #define MAP_FAILED ((void *) -1)
 #endif
@@ -142,7 +138,7 @@
         return false;
     } else {
 #ifdef HAVE_MADVISE
-        (void) madvise((char*)sycoca_mmap, sycoca_size, MADV_WILLNEED);
+        (void) posix_madvise((void*)sycoca_mmap, sycoca_size, \
MADV_WILLNEED);  #endif // HAVE_MADVISE
         return true;
     }
--- trunk/KDE/kdelibs/kdeui/util/kpixmapcache.cpp #979085:979086
@@ -50,7 +50,7 @@
 #include <sys/types.h>
 #include <string.h>
 
-#if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MADVISE)
+#if defined(HAVE_MADVISE)
 #include <sys/mman.h>
 #endif
 
@@ -472,7 +472,7 @@
     }
     info->indexHeader = reinterpret_cast<KPixmapCacheIndexHeader \
*>(indexMem);  #ifdef HAVE_MADVISE
-    madvise(indexMem, info->size, MADV_WILLNEED);
+    posix_madvise(indexMem, info->size, MADV_WILLNEED);
 #endif
 
     info->file->close();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic