summaryrefslogtreecommitdiff
path: root/boost/interprocess/mapped_region.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/interprocess/mapped_region.hpp')
-rw-r--r--boost/interprocess/mapped_region.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/boost/interprocess/mapped_region.hpp b/boost/interprocess/mapped_region.hpp
index 4037a919db..1fb64086b5 100644
--- a/boost/interprocess/mapped_region.hpp
+++ b/boost/interprocess/mapped_region.hpp
@@ -621,7 +621,10 @@ inline mapped_region::mapped_region
throw interprocess_exception(err);
}
//Attach memory
- void *base = ::shmat(map_hnd.handle, (void*)address, flag);
+ //Some old shmat implementation take the address as a non-const void pointer
+ //so uncast it to make code portable.
+ void *const final_address = const_cast<void *>(address);
+ void *base = ::shmat(map_hnd.handle, final_address, flag);
if(base == (void*)-1){
error_info err(system_error_code());
throw interprocess_exception(err);