Browse Source

z/OS: remove our ZOS feature macros, using the predefined alternative __MVS__ instead

master
Luca Saiu 4 weeks ago
parent
commit
6f67623901
8 changed files with 18 additions and 29 deletions
  1. +2
    -13
      Makefile.conf
  2. +3
    -3
      src/etpan_mime.c
  3. +1
    -1
      src/pEp_internal.h
  4. +3
    -3
      src/platform_unix.c
  5. +5
    -5
      src/platform_unix.h
  6. +2
    -2
      src/platform_zos.c
  7. +1
    -1
      src/platform_zos.h
  8. +1
    -1
      src/timestamp.c

+ 2
- 13
Makefile.conf View File

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


+ 3
- 3
src/etpan_mime.c View File

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


+ 1
- 1
src/pEp_internal.h View File

@ -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 <dlfcn.h>


+ 3
- 3
src/platform_unix.c View File

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


+ 5
- 5
src/platform_unix.h View File

@ -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 <unistd.h>
#include <strings.h>
#include <sys/select.h>
#ifndef ZOS
#ifndef __MVS__
#include <sys/param.h>
#endif
#include <regex.h>
#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 <uuid/uuid.h>
@ -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);


+ 2
- 2
src/platform_zos.c View File

@ -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__

+ 1
- 1
src/platform_zos.h View File

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


+ 1
- 1
src/timestamp.c View File

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


Loading…
Cancel
Save