mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 04:12:13 +00:00
Simplify doc_/comp_ examples using quickbook macros instead of in-code #ifdefs.
This commit is contained in:
@@ -28,15 +28,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if(argc == 1){ //Parent process
|
||||
//Create a native windows shared memory object.
|
||||
//<-
|
||||
#if 1
|
||||
windows_shared_memory shm (create_only, test::get_process_id_name(), read_write, 1000);
|
||||
#else
|
||||
//->
|
||||
windows_shared_memory shm (create_only, "MySharedMemory", read_write, 1000);
|
||||
//<-
|
||||
#endif
|
||||
//->
|
||||
|
||||
//Map the whole shared memory in this process
|
||||
mapped_region region(shm, read_write);
|
||||
@@ -55,15 +47,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else{
|
||||
//Open already created shared memory object.
|
||||
//<-
|
||||
#if 1
|
||||
windows_shared_memory shm (open_only, argv[2], read_only);
|
||||
#else
|
||||
//->
|
||||
windows_shared_memory shm (open_only, "MySharedMemory", read_only);
|
||||
//<-
|
||||
#endif
|
||||
//->
|
||||
|
||||
//Map the whole shared memory in this process
|
||||
mapped_region region(shm, read_only);
|
||||
|
||||
Reference in New Issue
Block a user