Simplify doc_/comp_ examples using quickbook macros instead of in-code #ifdefs.

This commit is contained in:
Ion Gaztañaga
2024-08-05 00:39:23 +02:00
parent 86855f7c70
commit 6be5872ef7
41 changed files with 74 additions and 692 deletions

View File

@@ -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);