diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-31 21:48:20 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-31 21:48:20 +0000 |
commit | 86c5f836d1a679208716a422839d7da38ba41059 (patch) | |
tree | 1b3da514a0eb2064d0b27c62011db9492387b7dc /examples/System_V_IPC | |
parent | 13c10349a654c59c85bb62c7f7b9ab8e1424814c (diff) | |
download | ATCD-86c5f836d1a679208716a422839d7da38ba41059.tar.gz |
added ACE_HAS_INSTANTIATION_PRAGMA support
Diffstat (limited to 'examples/System_V_IPC')
4 files changed, 47 insertions, 27 deletions
diff --git a/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp b/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp index 8b1b4e74a0a..2e1cbd933e0 100644 --- a/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp +++ b/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp @@ -4,7 +4,7 @@ #include "test.h" -int +int main (void) { long pid = long (ACE_OS::getpid ()); @@ -13,9 +13,9 @@ main (void) Message_Data msg_data (pid, ACE_OS::cuserid (0), "did you get this?"); - ACE_Typed_SV_Message<Message_Data> send_msg (msg_data, - SRV_ID, - msg_data.length ()), + ACE_Typed_SV_Message<Message_Data> send_msg (msg_data, + SRV_ID, + msg_data.length ()), recv_msg (pid); if (msgque.send (send_msg) < 0) @@ -26,18 +26,22 @@ main (void) Message_Data &recv_msg_data = recv_msg.data (); - cout << "a message of length " + cout << "a message of length " << recv_msg_data.length () - << " received from server " - << recv_msg_data.pid () - << " (user " - << recv_msg_data.user () << "): " + << " received from server " + << recv_msg_data.pid () + << " (user " + << recv_msg_data.user () << "): " << recv_msg_data.text () << "\n"; return 0; } -#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Typed_SV_Message_Queue<Message_Data>; template class ACE_Typed_SV_Message<Message_Data>; -#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Typed_SV_Message_Queue<Message_Data> +#pragma instantiate ACE_Typed_SV_Message<Message_Data> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp b/examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp index 59fd705b33a..dbf265fd279 100644 --- a/examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp +++ b/examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp @@ -6,7 +6,7 @@ #include "test.h" // Must be global for signal Message... -static ACE_Typed_SV_Message_Queue<Message_Data> msgque +static ACE_Typed_SV_Message_Queue<Message_Data> msgque (SRV_KEY, ACE_Typed_SV_Message_Queue<Message_Data>::ACE_CREATE); extern "C" void @@ -17,8 +17,8 @@ handler (int) ACE_OS::exit (0); } -int -main (void) +int +main (void) { char *username = ACE_OS::cuserid (0); Message_Data msg_data ((int) ACE_OS::getpid (), username, "I received your message."); @@ -33,15 +33,15 @@ main (void) { if (msgque.recv (recv_msg) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "msgque.recv"), 1); - + Message_Data &recv_msg_data = recv_msg.data (); cout << "a msg of length " << recv_msg_data.length () - << " sent from client " - << recv_msg_data.pid () - << " (user " - << recv_msg_data.user () << "): " + << " sent from client " + << recv_msg_data.pid () + << " (user " + << recv_msg_data.user () << "): " << recv_msg_data.text () << "\n"; cout.flush (); @@ -55,7 +55,11 @@ main (void) return 0; } -#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Typed_SV_Message_Queue<Message_Data>; template class ACE_Typed_SV_Message<Message_Data>; -#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Typed_SV_Message_Queue<Message_Data> +#pragma instantiate ACE_Typed_SV_Message<Message_Data> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/examples/System_V_IPC/SV_Semaphores/Semaphores_1.cpp b/examples/System_V_IPC/SV_Semaphores/Semaphores_1.cpp index 6830b49052d..32686eef1f6 100644 --- a/examples/System_V_IPC/SV_Semaphores/Semaphores_1.cpp +++ b/examples/System_V_IPC/SV_Semaphores/Semaphores_1.cpp @@ -78,15 +78,21 @@ main (void) #else int main (void) { - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "SYSV IPC is not supported on this platform\n")); return 0; } #endif /* ACE_HAS_SYSV_IPC */ -#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Guard<ACE_SV_Semaphore_Simple>; template class ACE_Malloc<ACE_SHARED_MEMORY_POOL, ACE_SV_Semaphore_Simple>; template class ACE_Read_Guard<ACE_SV_Semaphore_Simple>; template class ACE_Write_Guard<ACE_SV_Semaphore_Simple>; -#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Guard<ACE_SV_Semaphore_Simple> +#pragma instantiate ACE_Malloc<ACE_SHARED_MEMORY_POOL, ACE_SV_Semaphore_Simple> +#pragma instantiate ACE_Read_Guard<ACE_SV_Semaphore_Simple> +#pragma instantiate ACE_Write_Guard<ACE_SV_Semaphore_Simple> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/examples/System_V_IPC/SV_Semaphores/Semaphores_2.cpp b/examples/System_V_IPC/SV_Semaphores/Semaphores_2.cpp index d361bd5dd5e..deac90bc9c6 100644 --- a/examples/System_V_IPC/SV_Semaphores/Semaphores_2.cpp +++ b/examples/System_V_IPC/SV_Semaphores/Semaphores_2.cpp @@ -89,15 +89,21 @@ main (void) #else int main (void) { - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "SYSV IPC is not supported on this platform\n")); return 0; } #endif /* ACE_HAS_SYSV_IPC */ -#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Guard<ACE_SV_Semaphore_Simple>; template class ACE_Malloc<ACE_SHARED_MEMORY_POOL, ACE_SV_Semaphore_Simple>; template class ACE_Read_Guard<ACE_SV_Semaphore_Simple>; template class ACE_Write_Guard<ACE_SV_Semaphore_Simple>; -#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Guard<ACE_SV_Semaphore_Simple> +#pragma instantiate ACE_Malloc<ACE_SHARED_MEMORY_POOL, ACE_SV_Semaphore_Simple> +#pragma instantiate ACE_Read_Guard<ACE_SV_Semaphore_Simple> +#pragma instantiate ACE_Write_Guard<ACE_SV_Semaphore_Simple> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + |