diff --git a/include/trick/MonteCarlo.hh b/include/trick/MonteCarlo.hh index 5c9d46bf..745d3743 100644 --- a/include/trick/MonteCarlo.hh +++ b/include/trick/MonteCarlo.hh @@ -7,16 +7,13 @@ #include #include +#include #include "trick/MonteVar.hh" #include "trick/Executive.hh" #include "trick/RemoteShell.hh" #include "trick/tc.h" -#ifndef HOST_NAME_MAX -#define HOST_NAME_MAX 128 -#endif - namespace Trick { /** diff --git a/trick_source/sim_services/MonteCarlo/MonteCarlo.cpp b/trick_source/sim_services/MonteCarlo/MonteCarlo.cpp index e367d4a3..05809a59 100644 --- a/trick_source/sim_services/MonteCarlo/MonteCarlo.cpp +++ b/trick_source/sim_services/MonteCarlo/MonteCarlo.cpp @@ -22,8 +22,8 @@ Trick::MonteCarlo::MonteCarlo() : slaves_head = NULL; - char hostname[HOST_NAME_MAX + 1]; - gethostname(hostname, HOST_NAME_MAX); + char hostname[_POSIX_HOST_NAME_MAX + 1]; + gethostname(hostname, _POSIX_HOST_NAME_MAX); machine_name = hostname; memset(&listen_device, 0, sizeof(TCDevice)) ; diff --git a/trick_source/sim_services/MonteCarlo/MonteCarlo_receive_slave_results.cpp b/trick_source/sim_services/MonteCarlo/MonteCarlo_receive_slave_results.cpp index fa1e7017..22c8b417 100644 --- a/trick_source/sim_services/MonteCarlo/MonteCarlo_receive_slave_results.cpp +++ b/trick_source/sim_services/MonteCarlo/MonteCarlo_receive_slave_results.cpp @@ -131,7 +131,7 @@ void Trick::MonteCarlo::read_slave_port(Trick::MonteSlave *curr_slave) { void Trick::MonteCarlo::read_machine_name(Trick::MonteSlave *curr_slave) { int num_bytes; - char slave_name[HOST_NAME_MAX]; + char slave_name[_POSIX_HOST_NAME_MAX]; tc_read(&connection_device, (char *)&num_bytes, (int)sizeof(num_bytes)); num_bytes = ntohl(num_bytes) ; diff --git a/trick_source/sim_services/MonteCarlo/MonteCarlo_slave_init.cpp b/trick_source/sim_services/MonteCarlo/MonteCarlo_slave_init.cpp index 70f235ca..248858d8 100644 --- a/trick_source/sim_services/MonteCarlo/MonteCarlo_slave_init.cpp +++ b/trick_source/sim_services/MonteCarlo/MonteCarlo_slave_init.cpp @@ -51,7 +51,7 @@ int Trick::MonteCarlo::slave_init() { int id = htonl(slave_id); tc_write(&connection_device, (char *)&id, (int)sizeof(id)); - char hostname[HOST_NAME_MAX]; + char hostname[_POSIX_HOST_NAME_MAX]; gethostname(hostname, sizeof(hostname)-1); int num_bytes = htonl(strlen(hostname));