2025-01-29 13:50 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbssl/bio.c
! respect OPENSSL_NO_SOCK macro
* contrib/hbssl/bio.c
* contrib/hbssl/err.c
* contrib/hbssl/evp.c
* contrib/hbssl/pem.c
* disabled deprecated functions which do nothinng in OpenSSL 3.0
* src/rtl/filesys.c
* src/rtl/hbcom.c
* src/rtl/hbproces.c
* src/rtl/hbsocket.c
* src/rtl/net.c
* src/rtl/netusr.c
* src/vm/dynlibhb.c
* updated for OpenWatcom 2.0 builds
This commit is contained in:
@@ -7,6 +7,25 @@
|
||||
Entries may not always be in chronological/commit order.
|
||||
See license at the end of file. */
|
||||
|
||||
2025-01-29 13:50 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* contrib/hbssl/bio.c
|
||||
! respect OPENSSL_NO_SOCK macro
|
||||
|
||||
* contrib/hbssl/bio.c
|
||||
* contrib/hbssl/err.c
|
||||
* contrib/hbssl/evp.c
|
||||
* contrib/hbssl/pem.c
|
||||
* disabled deprecated functions which do nothinng in OpenSSL 3.0
|
||||
|
||||
* src/rtl/filesys.c
|
||||
* src/rtl/hbcom.c
|
||||
* src/rtl/hbproces.c
|
||||
* src/rtl/hbsocket.c
|
||||
* src/rtl/net.c
|
||||
* src/rtl/netusr.c
|
||||
* src/vm/dynlibhb.c
|
||||
* updated for OpenWatcom 2.0 builds
|
||||
|
||||
2025-01-28 20:27 UTC+0100 Aleksander Czajczynski (hb fki.pl)
|
||||
* config/global.mk
|
||||
! fixed OpenWatcom target platform autodetection to conform with
|
||||
|
||||
@@ -149,9 +149,11 @@ static BIO_METHOD * hb_BIO_METHOD_par( int iParam )
|
||||
case HB_BIO_METHOD_S_FILE: p = BIO_s_file(); break;
|
||||
#endif
|
||||
case HB_BIO_METHOD_S_MEM: p = BIO_s_mem(); break;
|
||||
#ifndef OPENSSL_NO_SOCK
|
||||
case HB_BIO_METHOD_S_SOCKET: p = BIO_s_socket(); break;
|
||||
case HB_BIO_METHOD_S_CONNECT: p = BIO_s_connect(); break;
|
||||
case HB_BIO_METHOD_S_ACCEPT: p = BIO_s_accept(); break;
|
||||
#endif
|
||||
case HB_BIO_METHOD_S_FD: p = BIO_s_fd(); break;
|
||||
#if 0 /* BIO_s_log() isn't exported via implibs on Windows at version 0.9.8k. [vszakats] */
|
||||
#ifndef OPENSSL_SYS_OS2
|
||||
@@ -185,9 +187,11 @@ static int hb_BIO_METHOD_ptr_to_id( const BIO_METHOD * p )
|
||||
else if( p == BIO_s_file() ) n = HB_BIO_METHOD_S_FILE;
|
||||
#endif
|
||||
else if( p == BIO_s_mem() ) n = HB_BIO_METHOD_S_MEM;
|
||||
#ifndef OPENSSL_NO_SOCK
|
||||
else if( p == BIO_s_socket() ) n = HB_BIO_METHOD_S_SOCKET;
|
||||
else if( p == BIO_s_connect() ) n = HB_BIO_METHOD_S_CONNECT;
|
||||
else if( p == BIO_s_accept() ) n = HB_BIO_METHOD_S_ACCEPT;
|
||||
#endif
|
||||
else if( p == BIO_s_fd() ) n = HB_BIO_METHOD_S_FD;
|
||||
#if 0 /* BIO_s_log() isn't exported via implibs on Windows at version 0.9.8k. [vszakats] */
|
||||
#ifndef OPENSSL_SYS_OS2
|
||||
@@ -848,7 +852,9 @@ HB_FUNC( BIO_DO_CONNECT )
|
||||
|
||||
HB_FUNC( ERR_LOAD_BIO_STRINGS )
|
||||
{
|
||||
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
||||
ERR_load_BIO_strings();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -113,7 +113,11 @@ HB_FUNC( ERR_GET_ERROR_LINE )
|
||||
const char * file = NULL;
|
||||
int line = 0;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
||||
hb_retnint( ERR_get_error_line( &file, &line ) );
|
||||
#else
|
||||
hb_retni( 0 );
|
||||
#endif
|
||||
|
||||
hb_storc( file, 1 );
|
||||
hb_storni( line, 2 );
|
||||
@@ -132,20 +136,17 @@ HB_FUNC( ERR_PEEK_ERROR_LINE )
|
||||
|
||||
HB_FUNC( ERR_PEEK_LAST_ERROR_LINE )
|
||||
{
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
|
||||
const char * file = NULL;
|
||||
int line = 0;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
|
||||
hb_retnint( ERR_peek_last_error_line( &file, &line ) );
|
||||
#else
|
||||
hb_retni( -1 );
|
||||
#endif
|
||||
|
||||
hb_storc( file, 1 );
|
||||
hb_storni( line, 2 );
|
||||
#else
|
||||
hb_retnint( -1 );
|
||||
|
||||
hb_storc( NULL, 1 );
|
||||
hb_storni( 0, 2 );
|
||||
#endif
|
||||
}
|
||||
|
||||
HB_FUNC( ERR_GET_ERROR_LINE_DATA )
|
||||
@@ -155,7 +156,11 @@ HB_FUNC( ERR_GET_ERROR_LINE_DATA )
|
||||
const char * data = NULL;
|
||||
int flags = 0;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
||||
hb_retnint( ERR_get_error_line_data( &file, &line, &data, &flags ) );
|
||||
#else
|
||||
hb_retni( 0 );
|
||||
#endif
|
||||
|
||||
hb_storc( file, 1 );
|
||||
hb_storni( line, 2 );
|
||||
@@ -170,7 +175,11 @@ HB_FUNC( ERR_PEEK_ERROR_LINE_DATA )
|
||||
const char * data = NULL;
|
||||
int flags = 0;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
||||
hb_retnint( ERR_peek_error_line_data( &file, &line, &data, &flags ) );
|
||||
#else
|
||||
hb_retni( 0 );
|
||||
#endif
|
||||
|
||||
hb_storc( file, 1 );
|
||||
hb_storni( line, 2 );
|
||||
@@ -186,7 +195,11 @@ HB_FUNC( ERR_PEEK_LAST_ERROR_LINE_DATA )
|
||||
const char * data = NULL;
|
||||
int flags = 0;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
||||
hb_retnint( ERR_peek_last_error_line_data( &file, &line, &data, &flags ) );
|
||||
#else
|
||||
hb_retni( 0 );
|
||||
#endif
|
||||
|
||||
hb_storc( file, 1 );
|
||||
hb_storni( line, 2 );
|
||||
|
||||
@@ -73,7 +73,9 @@ HB_FUNC( EVP_CLEANUP )
|
||||
|
||||
HB_FUNC( ERR_LOAD_EVP_STRINGS )
|
||||
{
|
||||
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
||||
ERR_load_EVP_strings();
|
||||
#endif
|
||||
}
|
||||
|
||||
HB_FUNC( EVP_PKEY_FREE )
|
||||
|
||||
@@ -91,7 +91,9 @@ static int hb_ssl_pem_password_cb( char * buf, int size, int rwflag, void * user
|
||||
|
||||
HB_FUNC( ERR_LOAD_PEM_STRINGS )
|
||||
{
|
||||
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
||||
ERR_load_PEM_strings();
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef void * PEM_READ_BIO ( BIO * bp, void ** x, pem_password_cb * cb, void * u );
|
||||
|
||||
@@ -329,6 +329,8 @@ static void _datamatrix_do_placement( PHB_BITBUFFER pBits, unsigned char * pCW,
|
||||
/* Calculate placement size without L-patterns and clock tracks */
|
||||
iPRow = pSize->iRow - 2 * ( pSize->iRow / pSize->iRegionRow );
|
||||
iPCol = pSize->iCol - 2 * ( pSize->iCol / pSize->iRegionCol );
|
||||
if( iPCol < 0 )
|
||||
iPCol = 0;
|
||||
|
||||
pArr = ( int * ) hb_xgrab( sizeof( int ) * iPCol * iPRow );
|
||||
hb_xmemset( pArr, 0, sizeof( int ) * iPCol * iPRow );
|
||||
|
||||
@@ -80,6 +80,9 @@
|
||||
#define D_HB_ITEMPUTSTR( itm, str ) hb_itemPutStrU16( itm, HB_CDP_ENDIAN_NATIVE, str )
|
||||
#define D_HB_ITEMPUTSTRLEN( itm, str, len ) hb_itemPutStrLenU16( itm, HB_CDP_ENDIAN_NATIVE, str, len )
|
||||
#define D_HB_CHAR HB_WCHAR
|
||||
#ifndef ostrlen
|
||||
#define ostrlen wcslen
|
||||
#endif
|
||||
#else
|
||||
#define D_HB_ARRAYGETSTR( arr, n, phstr, plen ) hb_arrayGetStr( arr, n, hb_setGetOSCP(), phstr, plen )
|
||||
#define D_HB_ITEMCOPYSTR( itm, str, len ) hb_itemCopyStr( itm, hb_setGetOSCP(), str, len )
|
||||
@@ -87,6 +90,9 @@
|
||||
#define D_HB_ITEMPUTSTR( itm, str ) hb_itemPutStr( itm, hb_setGetOSCP(), str )
|
||||
#define D_HB_ITEMPUTSTRLEN( itm, str, len ) hb_itemPutStrLen( itm, hb_setGetOSCP(), str, len )
|
||||
#define D_HB_CHAR char
|
||||
#ifndef ostrlen
|
||||
#define ostrlen strlen
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -104,10 +104,11 @@
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#if ( defined( __DMC__ ) || defined( __BORLANDC__ ) || \
|
||||
#if ( ( defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE ) ) || \
|
||||
defined( HB_OS_DOS ) || defined( HB_OS_OS2 ) ) && \
|
||||
( defined( __DMC__ ) || defined( __BORLANDC__ ) || \
|
||||
defined( __IBMCPP__ ) || defined( _MSC_VER ) || \
|
||||
defined( __MINGW32__ ) || defined( __WATCOMC__ ) ) && \
|
||||
! defined( HB_OS_UNIX ) && ! defined( HB_OS_WIN_CE )
|
||||
defined( __MINGW32__ ) || defined( __WATCOMC__ ) )
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <process.h>
|
||||
@@ -205,7 +206,8 @@
|
||||
* functions on 32-bit machines.
|
||||
*/
|
||||
#define HB_USE_LARGEFILE64
|
||||
#elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE ) && ! defined( __WATCOMC__ )
|
||||
#elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE ) && \
|
||||
! ( defined( __WATCOMC__ ) && __WATCOMC__ <= 1300 )
|
||||
#define HB_USE_LARGEFILE64
|
||||
#endif
|
||||
#endif
|
||||
@@ -3113,7 +3115,8 @@ void hb_fsCommit( HB_FHANDLE hFileHandle )
|
||||
* As workaround we are using this trick to check non zero version
|
||||
* number but on some systems it may disable using fdatasync() [druzus]
|
||||
*/
|
||||
# if defined( _POSIX_SYNCHRONIZED_IO ) && _POSIX_SYNCHRONIZED_IO - 0 > 0
|
||||
# if ( defined( _POSIX_SYNCHRONIZED_IO ) && _POSIX_SYNCHRONIZED_IO - 0 > 0 ) || \
|
||||
( defined( __WATCOMC__ ) && __WATCOMC__ >= 1300 )
|
||||
/* faster - flushes data buffers only, without updating directory info
|
||||
*/
|
||||
HB_FAILURE_RETRY( iResult, fdatasync( hFileHandle ) );
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
# define INCL_DOSDEVICES
|
||||
# define INCL_DOSDEVIOCTL
|
||||
# include <os2.h>
|
||||
#elif defined( HB_OS_LINUX ) && defined( __WATCOMC__ ) && ( __WATCOMC__ <= 1290 )
|
||||
#elif defined( HB_OS_LINUX ) && defined( __WATCOMC__ )
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -1368,7 +1368,10 @@ int hb_comInit( int iPort, int iBaud, int iParity, int iSize, int iStop )
|
||||
hb_comSetOsError( pCom, iResult == -1 );
|
||||
if( iResult == 0 )
|
||||
{
|
||||
#if defined( cfmakeraw ) || defined( HB_OS_LINUX )
|
||||
#if defined( __WATCOMC__ ) && __WATCOMC__ <= 1300
|
||||
/* cfmakeraw is declared only in header files
|
||||
but does not exist in CRTL in OpenWatcom 2.0 */
|
||||
#elif defined( cfmakeraw ) || defined( HB_OS_LINUX )
|
||||
/* Raw input from device */
|
||||
cfmakeraw( &tio );
|
||||
#endif
|
||||
|
||||
@@ -1730,8 +1730,7 @@ int hb_fsProcessRun( const char * pszFileName,
|
||||
}
|
||||
|
||||
/* temporary hack for still missing sysconf() and chroot() in Watcom 1.9 */
|
||||
#if defined( HB_OS_LINUX ) && defined( __WATCOMC__ ) && \
|
||||
__WATCOMC__ <= 1290
|
||||
#if defined( HB_OS_LINUX ) && defined( __WATCOMC__ ) && __WATCOMC__ <= 1290
|
||||
_WCRTLINK long sysconf( int __name )
|
||||
{
|
||||
int iTODO;
|
||||
|
||||
@@ -120,7 +120,12 @@
|
||||
|
||||
#if defined( HB_OS_UNIX )
|
||||
# define HB_HAS_UNIX
|
||||
# if ! defined( __WATCOMC__ )
|
||||
# if defined( __WATCOMC__ )
|
||||
# if __WATCOMC__ >= 1300
|
||||
# define HB_HAS_INET_ATON
|
||||
# define HB_HAS_GETHOSTBYADDR
|
||||
# endif
|
||||
# else
|
||||
# define HB_HAS_INET_ATON
|
||||
# define HB_HAS_INET_PTON
|
||||
# define HB_HAS_INET_NTOP
|
||||
@@ -2463,7 +2468,9 @@ int hb_socketShutdown( HB_SOCKET sd, int iMode )
|
||||
iMode = SO_SND_SHUTDOWN;
|
||||
else if( iMode == HB_SOCKET_SHUT_RDWR )
|
||||
iMode = SO_RCV_SHUTDOWN | SO_SND_SHUTDOWN;
|
||||
#elif defined( __WATCOMC__ )
|
||||
#elif defined( __WATCOMC__ ) && ( __WATCOMC__ <= 1290 )
|
||||
/* In WATCOM < 2.0 SHUT_* values are undefined but
|
||||
Harbour's HB_SOCKET_SHUT_* are equal expected values */
|
||||
if( iMode == HB_SOCKET_SHUT_RD ||
|
||||
iMode == HB_SOCKET_SHUT_WR ||
|
||||
iMode == HB_SOCKET_SHUT_RDWR )
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include "hb_io.h"
|
||||
#if defined( __DJGPP__ ) || defined( __RSX32__ ) || defined( __GNUC__ )
|
||||
#include <sys/param.h>
|
||||
#define HB_HAS_GETHOSTNAME
|
||||
#endif
|
||||
|
||||
#elif defined( HB_OS_OS2 ) && defined( __GNUC__ )
|
||||
@@ -73,19 +74,19 @@
|
||||
#include <emx/syscalls.h>
|
||||
#define gethostname __gethostname
|
||||
#endif
|
||||
#define HB_HAS_GETHOSTNAME
|
||||
|
||||
#elif defined( HB_OS_UNIX ) && ! defined( __WATCOMC__ )
|
||||
#elif defined( HB_OS_UNIX ) && ! ( defined( __WATCOMC__ ) && __WATCOMC__ <= 1290 )
|
||||
|
||||
#if defined( HB_OS_VXWORKS )
|
||||
#include <hostLib.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#define HB_HAS_GETHOSTNAME
|
||||
|
||||
#endif
|
||||
|
||||
#if ! defined( MAXGETHOSTNAME ) && ( defined( HB_OS_UNIX ) || \
|
||||
( ( defined( HB_OS_OS2 ) || defined( HB_OS_DOS ) ) && \
|
||||
defined( __GNUC__ ) ) )
|
||||
#if ! defined( MAXGETHOSTNAME ) && defined( HB_HAS_GETHOSTNAME )
|
||||
#define MAXGETHOSTNAME 256 /* should be enough for a host name */
|
||||
#endif
|
||||
|
||||
@@ -110,32 +111,7 @@ char * hb_netname( void )
|
||||
if( lpValue[ 0 ] )
|
||||
return HB_OSSTRDUP( lpValue );
|
||||
|
||||
#elif defined( HB_OS_DOS )
|
||||
|
||||
# if defined( __DJGPP__ ) || defined( __RSX32__ ) || defined( __GNUC__ )
|
||||
char szValue[ MAXGETHOSTNAME + 1 ];
|
||||
szValue[ 0 ] = szValue[ MAXGETHOSTNAME ] = '\0';
|
||||
gethostname( szValue, MAXGETHOSTNAME );
|
||||
if( szValue[ 0 ] )
|
||||
return hb_osStrDecode( szValue );
|
||||
# else
|
||||
union REGS regs;
|
||||
struct SREGS sregs;
|
||||
char szValue[ 16 ];
|
||||
szValue[ 0 ] = szValue[ 15 ] = '\0';
|
||||
|
||||
regs.HB_XREGS.ax = 0x5E00;
|
||||
regs.HB_XREGS.dx = FP_OFF( szValue );
|
||||
sregs.ds = FP_SEG( szValue );
|
||||
|
||||
HB_DOS_INT86X( 0x21, ®s, ®s, &sregs );
|
||||
|
||||
if( regs.h.ch != 0 && szValue[ 0 ] )
|
||||
return hb_osStrDecode( szValue );
|
||||
# endif
|
||||
|
||||
#elif ( defined( HB_OS_UNIX ) && ! defined( __WATCOMC__ ) ) || \
|
||||
( defined( HB_OS_OS2 ) && defined( __GNUC__ ) )
|
||||
#elif defined( HB_HAS_GETHOSTNAME )
|
||||
|
||||
char szValue[ MAXGETHOSTNAME + 1 ];
|
||||
szValue[ 0 ] = szValue[ MAXGETHOSTNAME ] = '\0';
|
||||
@@ -143,6 +119,22 @@ char * hb_netname( void )
|
||||
if( szValue[ 0 ] )
|
||||
return hb_osStrDecode( szValue );
|
||||
|
||||
#elif defined( HB_OS_DOS )
|
||||
|
||||
union REGS regs;
|
||||
struct SREGS sregs;
|
||||
char szValue[ 16 ];
|
||||
szValue[ 0 ] = szValue[ 15 ] = '\0';
|
||||
|
||||
regs.HB_XREGS.ax = 0x5E00;
|
||||
regs.HB_XREGS.dx = FP_OFF( szValue );
|
||||
sregs.ds = FP_SEG( szValue );
|
||||
|
||||
HB_DOS_INT86X( 0x21, ®s, ®s, &sregs );
|
||||
|
||||
if( regs.h.ch != 0 && szValue[ 0 ] )
|
||||
return hb_osStrDecode( szValue );
|
||||
|
||||
#endif
|
||||
|
||||
return hb_getenv( "HOSTNAME" );
|
||||
|
||||
@@ -67,12 +67,14 @@
|
||||
#if defined( __EMX__ ) && __GNUC__ * 1000 + __GNUC_MINOR__ < 3002
|
||||
#include <emx/syscalls.h>
|
||||
#endif
|
||||
#define HB_HAS_PWD
|
||||
|
||||
#elif defined( HB_OS_UNIX ) && ! defined( HB_OS_VXWORKS ) && ! defined( __WATCOMC__ )
|
||||
|
||||
#include <pwd.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#define HB_HAS_PWD
|
||||
|
||||
#endif
|
||||
|
||||
@@ -92,8 +94,7 @@ char * hb_username( void )
|
||||
if( lpValue[ 0 ] )
|
||||
return HB_OSSTRDUP( lpValue );
|
||||
|
||||
#elif ( defined( HB_OS_OS2 ) && defined( __GNUC__ ) ) || \
|
||||
( defined( HB_OS_UNIX ) && ! defined( HB_OS_VXWORKS ) && ! defined( __WATCOMC__ ) )
|
||||
#elif defined( HB_HAS_PWD )
|
||||
|
||||
struct passwd * pwd = getpwuid( getuid() );
|
||||
if( pwd && pwd->pw_name )
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
# endif
|
||||
#elif defined( HB_OS_OS2 )
|
||||
# include <os2.h>
|
||||
#elif defined( HB_OS_DOS ) && defined( __WATCOMC__ ) && !defined( HB_CAUSEWAY_DLL )
|
||||
#elif defined( HB_OS_DOS ) && defined( __WATCOMC__ ) && ! defined( HB_CAUSEWAY_DLL )
|
||||
/* it's broken in recent OpenWatcom builds so enable it
|
||||
for tests only in harbour.dll [druzus] */
|
||||
# if defined( HB_DYNLIB )
|
||||
|
||||
Reference in New Issue
Block a user