Skip to content

Commit

Permalink
Remove macro redefinitions that cause issues with Open XL
Browse files Browse the repository at this point in the history
Couple instances where the toupper() and tolower() macros
are undef and re-defined that cause problems with the
native headers. These may be unnecessary and are removed.

Signed-off-by: Gaurav Chaudhari <[email protected]>
  • Loading branch information
Deigue committed Jan 21, 2025
1 parent 1c2b08d commit 1e0dce1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 6 additions & 3 deletions ddr/include/ddr/std/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@
#if defined(J9ZOS390)

#include <ctype.h>
#if !defined(__open_xl__)
#undef toupper
#undef tolower

#endif /* !defined(__open_xl__) */
#include <string>

#define toupper(c) (islower(c) ? (c & _XUPPER_ASCII) : c)
#define tolower(c) (isupper(c) ? (c | _XLOWER_ASCII) : c)
#if !defined(__open_xl__)
#define toupper(c) (islower(c) ? (c & _XUPPER_ASCII) : c)
#define tolower(c) (isupper(c) ? (c | _XLOWER_ASCII) : c)
#endif /* defined(__open_xl__) */

#else /* defined(J9ZOS390) */
#include <string>
Expand Down
10 changes: 6 additions & 4 deletions ddr/include/ddr/std/unordered_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@

#if defined(J9ZOS390)
#include <ctype.h>
#if !defined(__open_xl__)
#undef toupper
#undef tolower
#endif /* !defined(__open_xl__) */
#endif /* defined(J9ZOS390) */

#include <unordered_map>
Expand All @@ -38,9 +40,9 @@ using std::unordered_map;
using std::tr1::unordered_map;
#endif /* defined(OMR_HAVE_CXX11) */

#if defined(J9ZOS390)
#define toupper(c) (islower(c) ? (c & _XUPPER_ASCII) : c)
#define tolower(c) (isupper(c) ? (c | _XLOWER_ASCII) : c)
#endif /* defined(J9ZOS390) */
#if defined(J9ZOS390) && !defined(__open_xl__)
#define toupper(c) (islower(c) ? (c & _XUPPER_ASCII) : c)
#define tolower(c) (isupper(c) ? (c | _XLOWER_ASCII) : c)
#endif /* defined(J9ZOS390) && !defined(__open_xl__) */

#endif /* DDR_UNORDERED_MAP */

0 comments on commit 1e0dce1

Please sign in to comment.