2010-09-08 08:42 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/config/c.mk
  * harbour/config/rules.mk
    * use .sx file extension instead of .S to avoid problems with
      non case sensitive filesystems

  * harbour/src/rtl/fstemp.c
    ! fixed DOS version of hb_fsTempDir() - tmpnam() may return pure
      file name without path i.e. in OpenWartcom builds
    * accept optionally TEMP, TMP and TMPDIR environment variables in
      DOS and OS2 build looking for directory with temporary files
This commit is contained in:
Przemyslaw Czerpak
2010-09-08 06:42:18 +00:00
parent c5d84a756f
commit cb705d015e
4 changed files with 60 additions and 41 deletions

View File

@@ -16,6 +16,18 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-09-08 08:42 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/config/c.mk
* harbour/config/rules.mk
* use .sx file extension instead of .S to avoid problems with
non case sensitive filesystems
* harbour/src/rtl/fstemp.c
! fixed DOS version of hb_fsTempDir() - tmpnam() may return pure
file name without path i.e. in OpenWartcom builds
* accept optionally TEMP, TMP and TMPDIR environment variables in
DOS and OS2 build looking for directory with temporary files
2010-09-07 21:00 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
+ contrib/hbqt/qtgui/qth/QPrinterInfo.qth
+ Added: new class.

View File

@@ -3,7 +3,7 @@
#
C_OBJS := $(C_SOURCES:.c=$(OBJ_EXT)) $(CPP_SOURCES:.cpp=$(OBJ_EXT))
S_OBJS := $(S_SOURCES:.s=$(OBJ_EXT)) $(SS_SOURCES:.S=$(OBJ_EXT))
S_OBJS := $(S_SOURCES:.s=$(OBJ_EXT)) $(SX_SOURCES:.sx=$(OBJ_EXT))
C_MAIN_OBJ := $(C_MAIN:.c=$(OBJ_EXT))

View File

@@ -57,12 +57,10 @@ ifeq ($(CC_RULE),)
endif
ifeq ($(S_RULE),)
# the hack with .s => .S translation is workaround for
# some filesystems which can change filename to lowercase
S_RULE = $(CC) $(subst $(CC_DIRSEPFROM),$(CC_DIRSEPTO),$(CC_FLAGS) $(HB_USER_CFLAGS) $(CC_OUT)$(<F:.s=$(OBJ_EXT)) $(HB_CFLAGS_STA) $(CC_IN) $(<:.s=.S))
S_RULE = $(CC) $(subst $(CC_DIRSEPFROM),$(CC_DIRSEPTO),$(CC_FLAGS) $(HB_USER_CFLAGS) $(CC_OUT)$(<F:.s=$(OBJ_EXT)) $(HB_CFLAGS_STA) $(CC_IN) $<)
endif
ifeq ($(SS_RULE),)
SS_RULE = $(CC) $(subst $(CC_DIRSEPFROM),$(CC_DIRSEPTO),$(CC_FLAGS) $(HB_USER_CFLAGS) $(CC_OUT)$(<F:.S=$(OBJ_EXT)) $(HB_CFLAGS_STA) $(CC_IN) $<)
ifeq ($(SX_RULE),)
SX_RULE = $(CC) $(subst $(CC_DIRSEPFROM),$(CC_DIRSEPTO),$(CC_FLAGS) $(HB_USER_CFLAGS) $(CC_OUT)$(<F:.sx=$(OBJ_EXT)) $(HB_CFLAGS_STA) $(CC_IN) $<)
endif
# The rule to compile a C++ source file.
@@ -114,12 +112,12 @@ endif
%$(OBJ_EXT) : %.s
$(S_RULE)
# Rule to generate an object file from a assembler .S file.
%$(OBJ_EXT) : $(GRANDP)%.S
$(SS_RULE)
# Rule to generate an object file from a assembler .sx file.
%$(OBJ_EXT) : $(GRANDP)%.sx
$(SX_RULE)
%$(OBJ_EXT) : %.S
$(SS_RULE)
%$(OBJ_EXT) : %.sx
$(SX_RULE)
%$(RES_EXT) : %.rc
$(RC_RULE)

View File

@@ -96,7 +96,7 @@
#endif
#endif
#if !defined( HB_OS_WIN ) && !defined( HB_OS_DOS )
#if !defined( HB_OS_WIN )
static HB_BOOL fsGetTempDirByCase( char * pszName, const char * pszTempDir )
{
HB_BOOL fOK = HB_FALSE;
@@ -353,7 +353,8 @@ HB_ERRCODE hb_fsTempDir( char * pszTempDir )
#endif
{
pszTempDir[ 0 ] = '.';
pszTempDir[ 1 ] = '\0';
pszTempDir[ 1 ] = HB_OS_PATH_DELIM_CHR;
pszTempDir[ 2 ] = '\0';
}
else
nResult = 0;
@@ -385,40 +386,12 @@ HB_ERRCODE hb_fsTempDir( char * pszTempDir )
HB_TCHAR_COPYFROM( pszTempDir, lpDir, HB_PATH_MAX - 1 );
}
}
#elif defined( HB_OS_OS2 )
{
char * pszTempDirEnv = hb_getenv( "TEMP" );
if( ! fsGetTempDirByCase( pszTempDir, pszTempDirEnv ) )
{
pszTempDir[ 0 ] = '.';
pszTempDir[ 1 ] = '\0';
}
else
nResult = 0;
if( pszTempDirEnv )
hb_xfree( pszTempDirEnv );
if( pszTempDir[ 0 ] != '\0' )
{
int len = ( int ) strlen( pszTempDir );
if( pszTempDir[ len - 1 ] != HB_OS_PATH_DELIM_CHR )
{
pszTempDir[ len ] = HB_OS_PATH_DELIM_CHR;
pszTempDir[ len + 1 ] = '\0';
}
}
}
#else
{
char szBuffer[ L_tmpnam ];
if( tmpnam( szBuffer ) != NULL )
{
nResult = 0;
# if defined( __DJGPP__ )
{
/* convert '/' to '\' */
@@ -432,6 +405,42 @@ HB_ERRCODE hb_fsTempDir( char * pszTempDir )
PHB_FNAME pTempName = hb_fsFNameSplit( szBuffer );
hb_strncpy( pszTempDir, pTempName->szPath, HB_PATH_MAX - 1 );
hb_xfree( pTempName );
if( hb_fsDirExists( pszTempDir ) )
nResult = 0;
}
}
if( nResult != 0 )
{
static const char * env_tmp[] = { "TEMP", "TMP", "TMPDIR", NULL };
const char ** tmp = env_tmp;
while( *tmp && nResult != 0 )
{
char * pszTempDirEnv = hb_getenv( *tmp++ );
if( pszTempDirEnv )
{
if( fsGetTempDirByCase( pszTempDir, pszTempDirEnv ) )
nResult = 0;
hb_xfree( pszTempDirEnv );
}
}
if( pszTempDir[ 0 ] != '\0' )
{
int len = ( int ) strlen( pszTempDir );
if( pszTempDir[ len - 1 ] != HB_OS_PATH_DELIM_CHR )
{
pszTempDir[ len ] = HB_OS_PATH_DELIM_CHR;
pszTempDir[ len + 1 ] = '\0';
}
}
else
{
pszTempDir[ 0 ] = '.';
pszTempDir[ 1 ] = HB_OS_PATH_DELIM_CHR;
pszTempDir[ 2 ] = '\0';
}
}
}