Browse Source

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.
IOSAD-230
Luca Saiu 7 months ago
committed by Newgitea
parent
commit
19a4d2eda4
7 changed files with 59 additions and 22 deletions
  1. +3
    -0
      Makefile.conf
  2. +2
    -1
      src/Makefile
  3. +7
    -3
      src/platform.h
  4. +15
    -0
      src/platform_zos.c
  5. +32
    -0
      src/platform_zos.h
  6. +0
    -8
      src/stdlib.h
  7. +0
    -10
      src/string.h

+ 3
- 0
Makefile.conf View File

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


+ 2
- 1
src/Makefile View File

@ -117,7 +117,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:


+ 7
- 3
src/platform.h View File

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


+ 15
- 0
src/platform_zos.c View File

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

+ 32
- 0
src/platform_zos.h View File

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

+ 0
- 8
src/stdlib.h View File

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

+ 0
- 10
src/string.h View File

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