summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2023-01-16 18:49:33 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2023-01-16 18:49:33 +0100
commit3f2b66203cbef9985486a6e9ce4ef33feb5cfb20 (patch)
tree6420a856157011b8966840b9d67315ddbbe5bed3
parent5182f2ef12f8ab7bdb298a2e5f19087cb67c056c (diff)
downloadATCD-3f2b66203cbef9985486a6e9ce4ef33feb5cfb20.tar.gz
Cleanup several macros which are not set by any config file
* ACE/ace/OS_NS_Thread.cpp: * ACE/ace/OS_NS_dirent.inl: * ACE/ace/OS_NS_sys_stat.inl: * ACE/ace/OS_NS_time.cpp: * ACE/ace/OS_NS_time.h: * ACE/ace/OS_NS_time.inl: * ACE/ace/OS_NS_unistd.inl: * ACE/ace/README: * ACE/ace/TLI.cpp: * ACE/ace/os_include/os_stropts.h: * ACE/ace/os_include/sys/os_mman.h:
-rw-r--r--ACE/ace/OS_NS_Thread.cpp3
-rw-r--r--ACE/ace/OS_NS_dirent.inl2
-rw-r--r--ACE/ace/OS_NS_sys_stat.inl6
-rw-r--r--ACE/ace/OS_NS_time.cpp132
-rw-r--r--ACE/ace/OS_NS_time.h6
-rw-r--r--ACE/ace/OS_NS_time.inl2
-rw-r--r--ACE/ace/OS_NS_unistd.inl16
-rw-r--r--ACE/ace/README31
-rw-r--r--ACE/ace/TLI.cpp8
-rw-r--r--ACE/ace/os_include/os_stropts.h2
-rw-r--r--ACE/ace/os_include/sys/os_mman.h3
11 files changed, 8 insertions, 203 deletions
diff --git a/ACE/ace/OS_NS_Thread.cpp b/ACE/ace/OS_NS_Thread.cpp
index 3a5a8d99242..58dd6b343fb 100644
--- a/ACE/ace/OS_NS_Thread.cpp
+++ b/ACE/ace/OS_NS_Thread.cpp
@@ -3670,9 +3670,6 @@ ACE_OS::thr_create (ACE_THR_FUNC func,
# if defined (ACE_HAS_ONLY_SCHED_OTHER)
// SunOS, thru version 5.6, only supports SCHED_OTHER.
spolicy = SCHED_OTHER;
-# elif defined (ACE_HAS_ONLY_SCHED_FIFO)
- // NonStop OSS standard pthread supports only SCHED_FIFO.
- spolicy = SCHED_FIFO;
# else
// Make sure to enable explicit scheduling, in case we didn't
// enable it above (for non-default priority).
diff --git a/ACE/ace/OS_NS_dirent.inl b/ACE/ace/OS_NS_dirent.inl
index f55ec13406e..d9415fbdfaf 100644
--- a/ACE/ace/OS_NS_dirent.inl
+++ b/ACE/ace/OS_NS_dirent.inl
@@ -37,8 +37,6 @@ opendir (const ACE_TCHAR *filename)
return ::ACE_OS::opendir_emulation (filename);
# elif defined (ACE_HAS_WOPENDIR) && defined (ACE_USES_WCHAR)
return ::wopendir (filename);
-# elif defined (ACE_HAS_NONCONST_OPENDIR)
- return ::opendir (const_cast<char *> (filename));
# else /* ! ACE_WIN32 && ACE_LACKS_OPENDIR */
return ::opendir (ACE_TEXT_ALWAYS_CHAR (filename));
# endif /* ACE_WIN32 && ACE_LACKS_OPENDIR */
diff --git a/ACE/ace/OS_NS_sys_stat.inl b/ACE/ace/OS_NS_sys_stat.inl
index 9dec20de7f9..3e266681896 100644
--- a/ACE/ace/OS_NS_sys_stat.inl
+++ b/ACE/ace/OS_NS_sys_stat.inl
@@ -192,9 +192,7 @@ namespace ACE_OS
stat (const char *file, ACE_stat *stp)
{
ACE_OS_TRACE ("ACE_OS::stat");
-#if defined (ACE_HAS_NONCONST_STAT)
- return ::stat (const_cast <char *> (file), stp);
-#elif defined (ACE_LACKS_STAT)
+#if defined (ACE_LACKS_STAT)
ACE_NOTSUP_RETURN (-1);
#elif defined (ACE_HAS_X86_STAT_MACROS)
// Solaris for intel uses an macro for stat(), this macro is a
@@ -204,7 +202,7 @@ namespace ACE_OS
return MQX_Filesystem::inst ().stat (file, stp);
#else
return ACE_STAT_FUNC_NAME (file, stp);
-#endif /* ACE_HAS_NONCONST_STAT */
+#endif /* ACE_LACKS_STAT */
}
#if defined (ACE_HAS_WCHAR)
diff --git a/ACE/ace/OS_NS_time.cpp b/ACE/ace/OS_NS_time.cpp
index 24afd54da5e..3303e0588b4 100644
--- a/ACE/ace/OS_NS_time.cpp
+++ b/ACE/ace/OS_NS_time.cpp
@@ -13,138 +13,6 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-# if defined (ACE_LACKS_DIFFTIME)
-double
-ACE_OS::difftime (time_t t1, time_t t0)
-{
- /* return t1 - t0 in seconds */
- struct tm tms[2], *ptms[2], temp;
- double seconds;
- int swap = 0;
-
- /* extract the tm structure from time_t */
- ptms[1] = ::gmtime_r (&t1, &tms[1]);
- if (ptms[1] == 0) return 0.0;
-
- ptms[0] = ::gmtime_r (&t0, &tms[0]);
- if (ptms[0] == 0) return 0.0;
-
- /* make sure t1 is > t0 */
- if (tms[1].tm_year < tms[0].tm_year)
- swap = 1;
- else if (tms[1].tm_year == tms[0].tm_year)
- {
- if (tms[1].tm_yday < tms[0].tm_yday)
- swap = 1;
- else if (tms[1].tm_yday == tms[0].tm_yday)
- {
- if (tms[1].tm_hour < tms[0].tm_hour)
- swap = 1;
- else if (tms[1].tm_hour == tms[0].tm_hour)
- {
- if (tms[1].tm_min < tms[0].tm_min)
- swap = 1;
- else if (tms[1].tm_min == tms[0].tm_min)
- {
- if (tms[1].tm_sec < tms[0].tm_sec)
- swap = 1;
- }
- }
- }
- }
-
- if (swap)
- temp = tms[0], tms[0] = tms[1], tms[1] = temp;
-
- seconds = 0.0;
- if (tms[1].tm_year > tms[0].tm_year)
- {
- // Accumulate the time until t[0] catches up to t[1]'s year.
- seconds = 60 - tms[0].tm_sec;
- tms[0].tm_sec = 0;
- tms[0].tm_min += 1;
- seconds += 60 * (60 - tms[0].tm_min);
- tms[0].tm_min = 0;
- tms[0].tm_hour += 1;
- seconds += 60*60 * (24 - tms[0].tm_hour);
- tms[0].tm_hour = 0;
- tms[0].tm_yday += 1;
-
-# define ISLEAPYEAR(y) ((y)&3u?0:(y)%25u?1:(y)/25u&12?0:1)
-
- if (ISLEAPYEAR(tms[0].tm_year))
- seconds += 60*60*24 * (366 - tms[0].tm_yday);
- else
- seconds += 60*60*24 * (365 - tms[0].tm_yday);
-
- tms[0].tm_yday = 0;
- tms[0].tm_year += 1;
-
- while (tms[1].tm_year > tms[0].tm_year)
- {
- if (ISLEAPYEAR(tms[0].tm_year))
- seconds += 60*60*24 * 366;
- else
- seconds += 60*60*24 * 365;
-
- tms[0].tm_year += 1;
- }
-
-# undef ISLEAPYEAR
-
- }
- else
- {
- // Normalize
- if (tms[1].tm_sec < tms[0].tm_sec)
- {
- if (tms[1].tm_min == 0)
- {
- if (tms[1].tm_hour == 0)
- {
- tms[1].tm_yday -= 1;
- tms[1].tm_hour += 24;
- }
- tms[1].tm_hour -= 1;
- tms[1].tm_min += 60;
- }
- tms[1].tm_min -= 1;
- tms[1].tm_sec += 60;
- }
- tms[1].tm_sec -= tms[0].tm_sec;
-
- if (tms[1].tm_min < tms[0].tm_min)
- {
- if (tms[1].tm_hour == 0)
- {
- tms[1].tm_yday -= 1;
- tms[1].tm_hour += 24;
- }
- tms[1].tm_hour -= 1;
- tms[1].tm_min += 60;
- }
- tms[1].tm_min -= tms[0].tm_min;
-
- if (tms[1].tm_hour < tms[0].tm_hour)
- {
- tms[1].tm_yday -= 1;
- tms[1].tm_hour += 24;
- }
- tms[1].tm_hour -= tms[0].tm_hour;
-
- tms[1].tm_yday -= tms[0].tm_yday;
- }
-
- // accumulate the seconds
- seconds += tms[1].tm_sec;
- seconds += 60 * tms[1].tm_min;
- seconds += 60*60 * tms[1].tm_hour;
- seconds += 60*60*24 * tms[1].tm_yday;
-
- return seconds;
-}
-# endif /* ACE_LACKS_DIFFTIME */
-
struct tm *
ACE_OS::localtime_r (const time_t *t, struct tm *res)
{
diff --git a/ACE/ace/OS_NS_time.h b/ACE/ace/OS_NS_time.h
index 3ae89c72ba2..615d591c424 100644
--- a/ACE/ace/OS_NS_time.h
+++ b/ACE/ace/OS_NS_time.h
@@ -116,7 +116,6 @@ inline struct tm *ace_localtime_r_helper (const time_t *clock, struct tm *res)
}
#endif /* !ACE_LACKS_LOCALTIME_R */
-#if !defined (ACE_LACKS_DIFFTIME)
/// Helper for the ACE_OS::difftime() function
/**
* We moved the difftime code that used to be in ACE_OS::difftime()
@@ -130,7 +129,6 @@ inline double ace_difftime(time_t t1, time_t t0)
{
return difftime (t1, t0);
}
-#endif /* !ACE_LACKS_DIFFTIME */
# if defined (ACE_WIN32)
typedef unsigned __int64 ACE_hrtime_t;
@@ -181,11 +179,7 @@ namespace ACE_OS
ACE_NAMESPACE_INLINE_FUNCTION
ACE_TCHAR *ctime_r (const time_t *clock, ACE_TCHAR *buf, int buflen);
-#if !defined (ACE_LACKS_DIFFTIME)
ACE_NAMESPACE_INLINE_FUNCTION
-#else
- extern ACE_Export
-#endif /* ! ACE_LACKS_DIFFTIME */
double difftime (time_t t1,
time_t t0);
diff --git a/ACE/ace/OS_NS_time.inl b/ACE/ace/OS_NS_time.inl
index 1a334f65916..c9403c45a1e 100644
--- a/ACE/ace/OS_NS_time.inl
+++ b/ACE/ace/OS_NS_time.inl
@@ -235,13 +235,11 @@ ACE_OS::localtime_r (const unsigned long *clock,
#endif
-#if !defined (ACE_LACKS_DIFFTIME)
ACE_INLINE double
ACE_OS::difftime (time_t t1, time_t t0)
{
return ::ace_difftime (t1, t0);
}
-#endif /* ! ACE_LACKS_DIFFTIME */
ACE_INLINE ACE_hrtime_t
ACE_OS::gethrtime (const ACE_HRTimer_Op op)
diff --git a/ACE/ace/OS_NS_unistd.inl b/ACE/ace/OS_NS_unistd.inl
index 7c7ac47e56d..67de5e58951 100644
--- a/ACE/ace/OS_NS_unistd.inl
+++ b/ACE/ace/OS_NS_unistd.inl
@@ -109,13 +109,11 @@ ACE_INLINE int
ACE_OS::chdir (const char *path)
{
ACE_OS_TRACE ("ACE_OS::chdir");
-#if defined (ACE_HAS_NONCONST_CHDIR)
- return ::chdir (const_cast<char *> (path));
-#elif defined (ACE_CHDIR_EQUIVALENT)
+#if defined (ACE_CHDIR_EQUIVALENT)
return ACE_CHDIR_EQUIVALENT (path);
#else
return ::chdir (path);
-#endif /* ACE_HAS_NONCONST_CHDIR */
+#endif /* ACE_CHDIR_EQUIVALENT */
}
#if defined (ACE_HAS_WCHAR)
@@ -1174,16 +1172,14 @@ ACE_INLINE int
ACE_OS::unlink (const char *path)
{
ACE_OS_TRACE ("ACE_OS::unlink");
-# if defined (ACE_HAS_NONCONST_UNLINK)
- return ::unlink (const_cast<char *> (path));
-# elif defined (ACE_LACKS_UNLINK)
+#if defined (ACE_LACKS_UNLINK)
ACE_UNUSED_ARG (path);
ACE_NOTSUP_RETURN (-1);
-# elif defined (ACE_UNLINK_EQUIVALENT)
+#elif defined (ACE_UNLINK_EQUIVALENT)
return ACE_UNLINK_EQUIVALENT (path);
-# else
+#else
return ::unlink (path);
-# endif /* ACE_HAS_NONCONST_UNLINK */
+#endif /* ACE_LACKS_UNLINK */
}
#if defined (ACE_HAS_WCHAR)
diff --git a/ACE/ace/README b/ACE/ace/README
index d041eb53623..67e364a294f 100644
--- a/ACE/ace/README
+++ b/ACE/ace/README
@@ -330,8 +330,6 @@ ACE_HAS_LINUX_NPTL Linux platform (with kernel >= 2.6.x)
ACE_HAS_LOG_MSG_NT_EVENT_LOG Platform supports Windows NT event
log so we can create an
ACE_Log_Msg_Backend to log to it.
-ACE_HAS_LONG_MAP_FAILED Platform defines MAP_FAILED as
- a long constant.
ACE_HAS_MALLOC_STATS Enabled malloc statistics
collection.
ACE_HAS_MEMCHR Use native implementation of memchr.
@@ -346,15 +344,9 @@ ACE_HAS_MT_SAFE_MKTIME Platform supports MT safe
ACE_HAS_MUTEX_TIMEOUTS Compiler supports timed mutex
acquisitions
(e.g. pthread_mutex_timedlock()).
-ACE_HAS_NONCONST_CHDIR Platform uses non-const char *
- in call to chdir
ACE_HAS_NONCONST_CLOCK_SETTIME Platform uses non-const
struct timespec * in call to
clock_settime
-ACE_HAS_NONCONST_OPENDIR Platform uses non-const char *
- in call to opendir
-ACE_HAS_NONCONST_UNLINK Platform uses non-const char *
- in call to unlink
ACE_HAS_NONCONST_GETBY Platform uses non-const char *
in calls to gethostbyaddr,
gethostbyname, getservbyname
@@ -371,26 +363,16 @@ ACE_HAS_NONCONST_SENDMSG Platform omits const qualifier
ACE_HAS_NONCONST_SETRLIMIT Platform omits const qualifier
from rlimit parameter in setrlimit()
prototype.
-ACE_HAS_NONCONST_STAT Platform's stat function has non const
- name argument
ACE_HAS_NONCONST_SWAB Platform's swab function has non
const src argument
ACE_HAS_NONCONST_WRITEV Platform omits const qualifier from
iovec parameter in writev() prototype.
-ACE_HAS_OLD_MALLOC Compiler/platform uses old
- malloc()/free() prototypes
- (ugh)
-ACE_HAS_ONLY_SCHED_FIFO Platform, e.g., HP NonStop OSS,
- only supports SCHED_FIFO
- POSIX scheduling policy.
ACE_HAS_ONLY_SCHED_OTHER Platform, e.g., Solaris 2.5,
only supports SCHED_OTHER
POSIX scheduling policy.
ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R Uses ctime_r & asctime_r with
only two parameters
vs. three.
-ACE_HAS_OSF_TIMOD_H Platform supports the OSF TLI
- timod STREAMS module
ACE_HAS_3_PARAM_WCSTOK Platform has 3-parameter version
of wcstok(), which was added in
1994 in the ISO C standard Normative
@@ -476,8 +458,6 @@ ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL For Win32: Use Select_Reactor
ACE_HAS_SEMUN Compiler/platform defines a
union semun for SysV shared
memory
-ACE_HAS_SET_T_ERRNO Platform has a function to set
- t_errno (e.g., Tandem).
ACE_HAS_SIGACTION_CONSTP2 Platform's sigaction() function takes
const sigaction* as 2nd parameter.
ACE_HAS_SIGINFO_T Platform supports SVR4
@@ -506,9 +486,6 @@ ACE_HAS_SOCKLEN_T Platform provides socklen_t
glibc2.
ACE_HAS_SOCK_BUF_SIZE_MAX Platform limits the maximum socket
message size.
-ACE_HAS_SPARCWORKS_401_SIGNALS Compiler has brain-damaged
- SPARCwork SunOS 4.x signal
- prototype...
ACE_HAS_SSIZE_T Compiler supports the ssize_t
typedef
ACE_HAS_STHREADS Platform supports Solaris
@@ -530,8 +507,6 @@ ACE_HAS_STRICT Use the STRICT compilation mode on Win32
ACE_HAS_STRUCT_NETDB_DATA Compiler/platform has strange
hostent API for socket *_r()
calls
-ACE_HAS_SUNOS4_SIGNAL_T Compiler has horrible SunOS
- 4.x signal handlers...
ACE_HAS_SVR4_DYNAMIC_LINKING Compiler/platform supports
SVR4 dynamic linking semantics
ACE_HAS_SVR4_GETTIMEOFDAY Compiler/platform supports
@@ -641,8 +616,6 @@ ACE_HAS_VERSIONED_NAMESPACE Wrap all library code within a
defining preprocessor symbol
ACE_VERSIONED_NAMESPACE_NAME
to desired name.
-ACE_LACKS_INTMAX_T Platform lacks the intmax_t type
-ACE_LACKS_UINTMAX_T Platform lacks the uintmax_t type.
ACE_LACKS_INTPTR_T Platform lacks the intptr_t type
ACE_LACKS_UINTPTR_T Platform lacks the uintptr_t type.
@@ -713,9 +686,6 @@ ACE_HAS_XTI Platform has XTI
ACE_INITIALIZE_MEMORY_BEFORE_USE Memory is explicitly initialized before
use. Useful when using a profiler like
purify or valgrind
-ACE_HRTIME_T_IS_BASIC_TYPE ACE_hrtime_t is a basic type that
- doesn't require ACE_U64_TO_U32
- conversion
ACE_LACKS_ACCESS Platform lacks access() (e.g.,
VxWorks)
ACE_LACKS_ACE_IOSTREAM Platform can not build
@@ -747,7 +717,6 @@ ACE_LACKS_CONDATTR_PSHARED Platform has no implementation
pthread_condattr_setpshared(),
even though it supports
pthreads!
-ACE_LACKS_DIFFTIME Platform lacks difftime() implementation
ACE_LACKS_DUP2 Platform lacks dup2().
ACE_LACKS_FCNTL Platform lacks POSIX-style fcntl ().
ACE_LACKS_FSYNC Platform lacks fsync().
diff --git a/ACE/ace/TLI.cpp b/ACE/ace/TLI.cpp
index cdfa1db8514..1aeafeeb68a 100644
--- a/ACE/ace/TLI.cpp
+++ b/ACE/ace/TLI.cpp
@@ -156,11 +156,7 @@ ACE_TLI::set_option (int level, int option, void *optval, int optlen)
if (this->so_opt_req.opt.len > this->so_opt_req.opt.maxlen)
{
-# if !defined (ACE_HAS_SET_T_ERRNO)
t_errno = TBUFOVFLW;
-# else
- set_t_errno (TBUFOVFLW);
-# endif /* ACE_HAS_SET_T_ERRNO */
return -1;
}
@@ -235,11 +231,7 @@ ACE_TLI::get_option (int level, int option, void *optval, int &optlen)
if (this->so_opt_ret.opt.len > this->so_opt_ret.opt.maxlen)
{
-#if !defined (ACE_HAS_SET_T_ERRNO)
t_errno = TBUFOVFLW;
-#else
- set_t_errno (TBUFOVFLW);
-#endif /* ACE_HAS_SET_T_ERRNO */
return -1;
}
diff --git a/ACE/ace/os_include/os_stropts.h b/ACE/ace/os_include/os_stropts.h
index 4ed4c4b44da..30ffe98a0a8 100644
--- a/ACE/ace/os_include/os_stropts.h
+++ b/ACE/ace/os_include/os_stropts.h
@@ -26,8 +26,6 @@
#if defined (ACE_HAS_TIMOD_H)
# include /**/ <sys/timod.h>
-#elif defined (ACE_HAS_OSF_TIMOD_H)
-# include /**/ <tli/timod.h>
#endif /* ACE_HAS_TIMOD_H */
#if !defined (ACE_LACKS_SYS_IOCTL_H)
diff --git a/ACE/ace/os_include/sys/os_mman.h b/ACE/ace/os_include/sys/os_mman.h
index 2f98bf4b798..d2b9a713f56 100644
--- a/ACE/ace/os_include/sys/os_mman.h
+++ b/ACE/ace/os_include/sys/os_mman.h
@@ -81,9 +81,6 @@ PAGE_NOCACHE */
# if !defined (MAP_FAILED)
# define MAP_FAILED ((void *) -1)
-# elif defined (ACE_HAS_LONG_MAP_FAILED)
-# undef MAP_FAILED
-# define MAP_FAILED ((void *) -1L)
# endif /* !MAP_FAILED */
#if !defined (PROT_RDWR)