move some z/OS definitions to a platform file: very tentative

Not yet really tested on z/OS, so I expect things to break there.  But Unix
should keep working.  Waiting for feedback from Lev.
pull/63/head
positron 1 year ago
parent a1ba59faec
commit dc1c18061f

@ -100,8 +100,11 @@ ifeq ($(BUILD_FOR),OS/390)
CFLAGS+= -I/usr/include
CFLAGS+= -DZOS -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L -qlanglvl=NOLIBEXT
else ifeq ($(BUILD_FOR),Linux)
CFLAGS+= -DUNIX
CFLAGS+=-fPIC -fstrict-aliasing -fdiagnostics-color=auto
else ifeq ($(BUILD_FOR),Darwin)
CFLAGS+= -DUNIX
CFLAGS+= -DDARWIN
CFLAGS+=-pthread -fPIC -fstrict-aliasing -fcolor-diagnostics
endif

@ -128,7 +128,8 @@ HEADERS_TO_INSTALL = \
timestamp.h identity_list.h bloblist.h stringpair.h message.h mime.h group.h \
cryptotech.h sync_api.h pEp_string.h openpgp_compat.h engine_sql.h \
labeled_int_list.h key_reset.h base64.h sync_codec.h distribution_codec.h \
storage_codec.h status_to_string.h keyreset_command.h platform.h platform_unix.h \
storage_codec.h status_to_string.h keyreset_command.h platform.h \
platform_unix.h platform_windows.h platform_zos.h \
transport.h growing_buf.h $(wildcard ../asn.1/*.h)
# CAVEAT:

@ -11,10 +11,14 @@
extern "C" {
#endif
#ifdef _WIN32
#include "platform_windows.h"
#if defined (_WIN32)
# include "platform_windows.h"
#elif defined (UNIX)
# include "platform_unix.h"
#elif defined (ZOS)
# include "platform_zos.h"
#else
#include "platform_unix.h"
# error "unknown platform"
#endif
#ifdef __cplusplus

@ -0,0 +1,15 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
/* 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
#include "pEpEngine.h"
#include "platform_zos.h"
#include "dynamic_api.h"
/* Nothing useful here at this time. */
#endif // #ifdef ZOS

@ -0,0 +1,32 @@
/**
* @file platform_zos.h
* @brief z/OS platform-specific implementation details
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#ifndef PEP_PLATFORM_ZOS_H
#define PEP_PLATFORM_ZOS_H
#if ! defined (ZOS)
# error "this header should only ever be included on z/OS"
#endif
/* Workaround standard header problems. */
#ifdef __cplusplus
# undef _EXT
# define _NO_EXT
#endif
#include_next <stdlib.h>
#ifndef __cplusplus
char * stpcpy (char *dst, const char *src);
char * strndup (const char *s, size_t n);
size_t strnlen (const char *s, size_t maxlen);
#endif
#include <strings.h>
#include_next <string.h>
#endif // #ifndef PEP_PLATFORM_ZOS_H

@ -1,8 +0,0 @@
#ifdef ZOS
#ifdef __cplusplus
#undef _EXT
#define _NO_EXT
#endif
#endif
#include_next <stdlib.h>

@ -1,10 +0,0 @@
#ifdef ZOS
#ifndef __cplusplus
char * stpcpy (char *dst, const char *src);
char * strndup (const char *s, size_t n);
size_t strnlen (const char *s, size_t maxlen);
#endif
#include <strings.h>
#endif
#include_next <string.h>
Loading…
Cancel
Save