Skip to content

Commit 6500444

Browse files
authored
Merge pull request #7072 from farazrbx/rbx
PlayStation compatibility
2 parents daf43cd + 3c6651e commit 6500444

8 files changed

Lines changed: 44 additions & 17 deletions

File tree

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,15 @@ if(HAVE___UINT128_T)
130130
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE___UINT128_T")
131131
endif()
132132

133-
include(TestBigEndian)
134-
135-
test_big_endian(WORDS_BIGENDIAN)
133+
if(CMAKE_VERSION VERSION_LESS "3.20")
134+
# TestBigEndian was deprecated in 3.20
135+
include(TestBigEndian)
136+
test_big_endian(IS_BIG_ENDIAN)
137+
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
138+
if(IS_BIG_ENDIAN)
139+
set(CMAKE_C_BYTE_ORDER "BIG_ENDIAN")
140+
endif()
141+
endif()
136142

137143
# Thread local storage
138144
include(CheckCSourceCompiles)
@@ -576,7 +582,7 @@ if(WOLFSSL_LEAN_PSK OR (WOLFSSL_LEAN_TLS AND NOT WOLFSSL_TLS13))
576582
override_cache(WOLFSSL_AESGCM "no")
577583
endif()
578584

579-
if(WOLFSSL_AESGCM AND NOT WORDS_BIGENDIAN)
585+
if(WOLFSSL_AESGCM AND CMAKE_C_BYTE_ORDER STREQUAL "LITTLE_ENDIAN")
580586
override_cache(WOLFSSL_AESGCM "4bit")
581587
endif()
582588

@@ -2081,7 +2087,7 @@ endif()
20812087
# Suppress some warnings about separate compilation, inlining
20822088
add_definitions("-DWOLFSSL_IGNORE_FILE_WARN")
20832089
# Generate user options header
2084-
message("Generating user options header...")
2090+
message(STATUS "Generating user options header...")
20852091
if (${CMAKE_DISABLE_SOURCE_CHANGES})
20862092
set(WOLFSSL_BUILD_OUT_OF_TREE_DEFAULT "${CMAKE_DISABLE_SOURCE_CHANGES}")
20872093
else()

cmake/config.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/* Define to 1 if you have the <arpa/inet.h> header file. */
22
#cmakedefine HAVE_ARPA_INET_H @HAVE_ARPA_INET_H@
33

4+
/* Define to 1 if you have the <sys/ioctl.h> header file. */
5+
#cmakedefine HAVE_SYS_IOCTL_H @HAVE_SYS_IOCTL_H@
6+
7+
/* Define to 1 if you have the <netdb.h> header file. */
8+
#cmakedefine HAVE_NETDB_H @HAVE_NETDB_H@
9+
410
/* Define to 1 if you have the <sys/socket.h> header file. */
511
#cmakedefine HAVE_SYS_SOCKET_H @HAVE_SYS_SOCKET_H@
612

wolfssl/openssl/crypto.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,8 @@ WOLFSSL_API int wolfSSL_OPENSSL_init_crypto(word64 opts, const OPENSSL_INIT_SETT
9696
#define SSLeay_version wolfSSLeay_version
9797
#define SSLeay wolfSSLeay
9898
#define OpenSSL_version_num wolfSSL_OpenSSL_version_num
99+
#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
99100

100-
#if defined(WOLFSSL_QT) || defined(WOLFSSL_HITCH)
101-
#define SSLEAY_VERSION 0x10001000L
102-
#else
103-
#define SSLEAY_VERSION 0x0090600fL
104-
#endif
105-
#define SSLEAY_VERSION_NUMBER SSLEAY_VERSION
106101
#define CRYPTO_lock wc_LockMutex_ex
107102

108103
/* this function was used to set the default malloc, free, and realloc */

wolfssl/openssl/opensslv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
#define OPENSSL_VERSION_TEXT "wolfSSL " LIBWOLFSSL_VERSION_STRING
5858
#define OPENSSL_VERSION 0
5959

60+
#ifndef OPENSSL_IS_WOLFSSL
61+
#define OPENSSL_IS_WOLFSSL
62+
#endif
63+
6064
#endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
6165

6266
#endif /* header */

wolfssl/quic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
#ifdef WOLFSSL_QUIC
3434

35+
#include <stdint.h>
36+
3537
/* QUIC operates on three encryption levels which determine
3638
* which keys/algos are used for de-/encryption. These are
3739
* kept separately for incoming and outgoing data and.

wolfssl/wolfcrypt/types.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,12 @@ typedef struct w64wrapper {
911911

912912
#if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
913913
#ifndef XGETENV
914-
#include <stdlib.h>
915-
#define XGETENV getenv
914+
#ifdef NO_GETENV
915+
#define XGETENV(x) (NULL)
916+
#else
917+
#include <stdlib.h>
918+
#define XGETENV getenv
919+
#endif
916920
#endif
917921
#endif /* !NO_FILESYSTEM && !NO_STDIO_FILESYSTEM */
918922

@@ -927,7 +931,11 @@ typedef struct w64wrapper {
927931
#endif
928932
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
929933
#define XISALNUM(c) isalnum((c))
930-
#define XISASCII(c) isascii((c))
934+
#ifdef NO_STDLIB_ISASCII
935+
#define XISASCII(c) (((c) >= 0 && (c) <= 127) ? 1 : 0)
936+
#else
937+
#define XISASCII(c) isascii((c))
938+
#endif
931939
#define XISSPACE(c) isspace((c))
932940
#endif
933941
/* needed by wolfSSL_check_domain_name() */

wolfssl/wolfcrypt/wc_port.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,9 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
732732
#define SEPARATOR_CHAR ':'
733733

734734
#else
735-
#include <dirent.h>
735+
#ifndef NO_WOLFSSL_DIR
736+
#include <dirent.h>
737+
#endif
736738
#include <unistd.h>
737739
#include <sys/stat.h>
738740
#define XWRITE write

wolfssl/wolfio.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,15 @@
163163
#include <sys/socket.h>
164164
#include <arpa/inet.h>
165165
#include <netinet/in.h>
166-
#include <netdb.h>
166+
#ifdef HAVE_NETDB_H
167+
#include <netdb.h>
168+
#endif
167169
#ifdef __PPU
168170
#include <netex/errno.h>
169171
#else
170-
#include <sys/ioctl.h>
172+
#ifdef HAVE_SYS_IOCTL_H
173+
#include <sys/ioctl.h>
174+
#endif
171175
#endif
172176
#endif
173177
#endif

0 commit comments

Comments
 (0)