2025-01-24 15:02 UTC+0100 Aleksander Czajczynski (hb fki.pl)

* contrib/hbct/dattime3.c
    ! fixed in block variable declaration for strict ANSI C compat
    * code formatting
    ; both borrowed from Viktor's fork, thanks
      aa4665f16f
      d9f37296b0

  * src/rdd/dbcmd.c
    * note about C5.3/5.2 DBAPPEND( [<lUnlockAll>=.t.] ) updated again
      upon Przemek notification, thanks
This commit is contained in:
Aleksander Czajczynski
2025-01-24 15:02:38 +01:00
parent 8d5afdcac1
commit a30e2091db
3 changed files with 27 additions and 9 deletions

View File

@@ -154,13 +154,15 @@ HB_FUNC( SETTIME )
lNewTime = iTime[ 0 ] * 3600 + iTime[ 1 ] * 60 + iTime[ 2 ];
tm = time( NULL );
tm += lNewTime - ( tm % 86400 );
# if ( defined( __GLIBC__ ) && ( ( __GLIBC__ > 2 ) || ( ( __GLIBC__ == 2 ) && ( __GLIBC_MINOR__ >= 31 ) ) ) )
/* stime() is deprecated in glibc 2.31+ */
struct timespec ts = { tm, 0 };
fResult = clock_settime( CLOCK_REALTIME, &ts ) == 0;
# if defined( __GLIBC__ ) && ( ( __GLIBC__ > 2 ) || ( ( __GLIBC__ == 2 ) && ( __GLIBC_MINOR__ >= 31 ) ) )
{
/* stime() is deprecated in glibc 2.31+ */
struct timespec ts = { tm, 0 };
fResult = clock_settime( CLOCK_REALTIME, &ts ) == 0;
}
# else
/* stime() exists only in SVr4, SVID, X/OPEN and Linux */
fResult = stime( &tm ) == 0;
fResult = stime( &tm ) == 0;
# endif
#endif
}
@@ -191,12 +193,12 @@ HB_FUNC( SETDATE )
#elif defined( HB_OS_LINUX ) && ! defined( HB_OS_ANDROID ) && ! defined( __WATCOMC__ )
/* stime() exists only in SVr4, SVID, X/OPEN and Linux */
long lNewDate = lDate - hb_dateEncode( 1970, 1, 1 );
# if ( defined( __GLIBC__ ) && ( ( __GLIBC__ > 2 ) || ( ( __GLIBC__ == 2 ) && ( __GLIBC_MINOR__ >= 31 ) ) ) )
# if defined( __GLIBC__ ) && ( ( __GLIBC__ > 2 ) || ( ( __GLIBC__ == 2 ) && ( __GLIBC_MINOR__ >= 31 ) ) )
/* stime() is deprecated in glibc 2.31+ */
struct timespec ts = { 0 };
clock_gettime(CLOCK_REALTIME, &ts); /* keep tv_nsec */
clock_gettime( CLOCK_REALTIME, &ts ); /* keep tv_nsec */
ts.tv_sec = lNewDate * 86400 + ( ts.tv_sec % 86400 );
fResult = clock_settime( CLOCK_REALTIME, &ts ) == 0;
fResult = clock_settime( CLOCK_REALTIME, &ts ) == 0;
# else
time_t tm;
tm = time( NULL );