diff --git a/Makefile.conf b/Makefile.conf index fc27d98c..1b46f3e8 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -96,22 +96,11 @@ else ifeq ($(BUILD_FOR),Darwin) CC=clang endif -# Define platform-identification feature macros. -ifeq ($(BUILD_FOR),Linux) - CPPFLAGS+= -DUNIX -else ifeq ($(BUILD_FOR),Darwin) - CPPFLAGS+= -DUNIX -DDARWIN -else ifeq ($(BUILD_FOR),OS/390) - CPPFLAGS+= -DZOS - # z/OS, the way we use it, is a flavour of Unix. - CPPFLAGS+= -DUNIX -endif - # Add platform-specific compilation options. ifeq ($(BUILD_FOR),OS/390) CFLAGS= -Wno-gnu-include-next -qnosearch -I$(HERE) -I. CFLAGS+= -I/usr/include - CFLAGS+= -DZOS -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L -qlanglvl=NOLIBEXT + CFLAGS+= -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L -qlanglvl=NOLIBEXT else ifeq ($(BUILD_FOR),Linux) CFLAGS+=-fPIC -fstrict-aliasing -fdiagnostics-color=auto else ifeq ($(BUILD_FOR),Darwin) @@ -189,7 +178,7 @@ endif ifeq ($(BUILD_FOR),OS/390) CXXFLAGS+= -fdiagnostics-color=auto -Wno-gnu-include-next CXXFLAGS+= -qnosearch -I$(HERE) -I. -I../src -I../asn.1 $(ETPAN_INC) -I/usr/lpp/java/J8.0_64/include -I/usr/include - CXXFLAGS+= -DZOS -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L + CXXFLAGS+= -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L ifdef WARN CXXFLAGS+= else diff --git a/src/etpan_mime.c b/src/etpan_mime.c index 755336b2..d54eb28f 100644 --- a/src/etpan_mime.c +++ b/src/etpan_mime.c @@ -566,7 +566,7 @@ struct mailimf_date_time * timestamp_to_etpantime(const timestamp *ts) result->dt_day = ts->tm_mday; result->dt_month = ts->tm_mon + 1; result->dt_year = ts->tm_year + 1900; -#ifndef ZOS +#ifndef __MVS__ result->dt_zone = (int) (ts->tm_gmtoff / 36L); #endif return result; @@ -587,14 +587,14 @@ timestamp * etpantime_to_timestamp(const struct mailimf_date_time *et) result->tm_mday = et->dt_day; result->tm_mon = et->dt_month - 1; result->tm_year = et->dt_year - 1900; -#ifndef ZOS +#ifndef __MVS__ result->tm_gmtoff = 36L * (long) et->dt_zone; #endif // Normalize to UTC and then forget the offset. time_t t = timegm_with_gmtoff(result); gmtime_r(&t, result); -#ifndef ZOS +#ifndef __MVS__ result->tm_gmtoff = 0; #endif return result; diff --git a/src/pEp_internal.h b/src/pEp_internal.h index 38ff0c22..a5fb82e7 100644 --- a/src/pEp_internal.h +++ b/src/pEp_internal.h @@ -75,7 +75,7 @@ #define LOCAL_DB windoze_local_db() #define SYSTEM_DB windoze_system_db() #else // UNIX -#ifndef ZOS +#ifndef __MVS__ #define _POSIX_C_SOURCE 200809L #endif #include diff --git a/src/platform_unix.c b/src/platform_unix.c index 57edbba2..68b0c30b 100644 --- a/src/platform_unix.c +++ b/src/platform_unix.c @@ -4,7 +4,7 @@ // This file is under GNU General Public License 3.0 // see LICENSE.txt -#ifndef ZOS +#ifndef __MVS__ #define _POSIX_C_SOURCE 200809L #endif @@ -88,7 +88,7 @@ void *alloca(unsigned long x) } #endif -#if defined(ANDROID) || defined(ZOS) +#if defined(ANDROID) || defined(__MVS__) /* FIXME : timegm will miss when linking for x86_64 on android, when supported */ #ifndef __LP64__ time_t timegm(struct tm* const t) { @@ -165,7 +165,7 @@ static char *_android_system_db(void) } #endif -#ifdef ZOS +#ifdef __MVS__ char * e2as(const char * str) { char *ret = (char *)malloc(strlen(str)); diff --git a/src/platform_unix.h b/src/platform_unix.h index 85080a18..c962d16a 100644 --- a/src/platform_unix.h +++ b/src/platform_unix.h @@ -7,7 +7,7 @@ #ifndef PLATFORM_UNIX_H #define PLATFORM_UNIX_H -#if !defined(__APPLE__) && !defined(ZOS) +#if !defined(__APPLE__) && !defined(__MVS__) #define _POSIX_C_SOURCE 200809L #endif @@ -15,17 +15,17 @@ #include #include #include -#ifndef ZOS +#ifndef __MVS__ #include #endif #include -#ifdef ZOS +#ifdef __MVS__ char * e2as(const char * str); char * as2e(const char * str); #endif -#if defined(ANDROID) || defined(ZOS) +#if defined(ANDROID) || defined(__MVS__) typedef unsigned char uuid_t[16]; #else #include @@ -168,7 +168,7 @@ typedef char uuid_string_t[37]; // on *nix, uuid_t is an array and already implements pointer semantics #define UUID uuid_t -#if defined(ANDROID) || defined(ZOS) +#if defined(ANDROID) || defined(__MVS__) typedef char pEpUUID[16]; void uuid_generate_random(pEpUUID out); void uuid_unparse_upper(pEpUUID uu, uuid_string_t out); diff --git a/src/platform_zos.c b/src/platform_zos.c index 32bc3c6a..0efb6c40 100644 --- a/src/platform_zos.c +++ b/src/platform_zos.c @@ -4,7 +4,7 @@ /* Include the entire useful part of this compilation unit within a CPP conditional, so that the entire file expands to nothing if this is not the platform it is used on. */ -#ifdef ZOS +#ifdef __MVS__ #include "pEpEngine.h" #include "platform_zos.h" @@ -12,4 +12,4 @@ /* Nothing useful here at this time. */ -#endif // #ifdef ZOS +#endif // #ifdef __MVS__ diff --git a/src/platform_zos.h b/src/platform_zos.h index 28f82f41..68ed599d 100644 --- a/src/platform_zos.h +++ b/src/platform_zos.h @@ -7,7 +7,7 @@ #ifndef PEP_PLATFORM_ZOS_H #define PEP_PLATFORM_ZOS_H -#if ! defined (ZOS) +#if ! defined (__MVS__) # error "this header should only ever be included on z/OS" #endif diff --git a/src/timestamp.c b/src/timestamp.c index d5ac322b..79ba653e 100644 --- a/src/timestamp.c +++ b/src/timestamp.c @@ -22,7 +22,7 @@ DYNAMIC_API time_t timegm_with_gmtoff(const timestamp* ts) _ts = timestamp_dup(ts); if (_ts) { -#if defined(ZOS) +#if defined(__MVS__) const time_t raw_time = mktime(_ts); if (raw_time != -1) { retval = raw_time;