Browse Source

z/OS support: Fix C function collision

This hack works around the fact that z/OS already has a function
in the stlib, which is called release(void *), by making use of the
_Generic macro available on the platform.
master
David Lanzendörfer 4 weeks ago
parent
commit
a0254400b4
2 changed files with 11 additions and 2 deletions
  1. +1
    -1
      src/pEpEngine.c
  2. +10
    -1
      src/pEpEngine.h

+ 1
- 1
src/pEpEngine.c View File

@ -133,7 +133,7 @@ pEp_error:
return status;
}
DYNAMIC_API void release(PEP_SESSION session)
DYNAMIC_API void pep_release(PEP_SESSION session)
{
bool out_last = false;
int _count = --init_count;


+ 10
- 1
src/pEpEngine.h View File

@ -11,6 +11,10 @@
extern "C" {
#endif
#define release _release
#include <stdlib.h>
#undef release
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
@ -382,7 +386,12 @@ DYNAMIC_API PEP_STATUS init(
*
*/
DYNAMIC_API void release(PEP_SESSION session);
DYNAMIC_API void pep_release(PEP_SESSION session);
#if defined (__MVS__)
#define release(X) _Generic(X, void *:_release, struct _pEpSession *:pep_release)(X)
#else
#define release(X) pep_release(X)
#endif
/**
* <!-- config_passive_mode() -->


Loading…
Cancel
Save