2009-03-22 18:16 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbstack.h
    * added alternative asm inline function to __MINGW32__ builds which
      operates on 64bit pointers. It's used when __MINGW64__ macro is
      defined. I do not know if such macro existing in 64bit MinGW version.

  * harbour/include/hbdefs.h
    + added HB_PTRUINT

  * harbour/source/common/hbprintf.c
    * used HB_PTRUINT for %p casting
This commit is contained in:
Przemyslaw Czerpak
2009-03-22 17:10:43 +00:00
parent 26cad22e55
commit 1834b0d653
4 changed files with 24 additions and 1 deletions

View File

@@ -8,6 +8,18 @@
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2009-03-22 18:16 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
* added alternative asm inline function to __MINGW32__ builds which
operates on 64bit pointers. It's used when __MINGW64__ macro is
defined. I do not know if such macro existing in 64bit MinGW version.
* harbour/include/hbdefs.h
+ added HB_PTRUINT
* harbour/source/common/hbprintf.c
* used HB_PTRUINT for %p casting
2009-03-21 09:01 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/hbqt/Makefile
+ Added new files.

View File

@@ -585,8 +585,10 @@ typedef unsigned long HB_COUNTER;
/* type for memory pointer diff */
#if defined( HB_OS_WIN_64 )
typedef LONGLONG HB_PTRDIFF;
typedef ULONGLONG HB_PTRUINT;
#else
typedef long HB_PTRDIFF;
typedef unsigned long HB_PTRUINT;
#endif
#ifdef HB_LONG_LONG_OFF

View File

@@ -213,12 +213,21 @@ typedef struct
static __inline__ __attribute__ ((pure, malloc)) void * hb_stack_ptr_from_tls( void )
{
void * p;
# if defined( __MINGW64__ )
__asm__ (
"movq %%fs:(0x18), %0\n\t"
"movq 0x0e10(%0,%1,4), %0\n\t"
:"=a" (p)
:"c" (hb_stack_key)
);
# else
__asm__ (
"movl %%fs:(0x18), %0\n\t"
"movl 0x0e10(%0,%1,4), %0\n\t"
:"=a" (p)
:"c" (hb_stack_key)
);
# endif
return p;
}
# define hb_stack_ptr ( ( PHB_STACK ) hb_stack_ptr_from_tls() )

View File

@@ -1145,7 +1145,7 @@ int hb_snprintf( char * buffer, size_t bufsize, const char * format, ... )
case 'p': /* void * pointer */
argval.value.as_x_ptr = va_arg_n( args, _x_ptr, param );
if( argval.value.as_x_ptr )
size = put_hex( buffer, bufsize, size, ( unsigned long ) argval.value.as_x_ptr,
size = put_hex( buffer, bufsize, size, ( HB_PTRUINT ) argval.value.as_x_ptr,
flags | _F_ALTERNATE, width, precision, 0 );
else
size = put_str( buffer, bufsize, size, "(nil)",