From e610fd143b66af5d3390484edbac0ed4302dcc76 Mon Sep 17 00:00:00 2001 From: Luiz Rafael Culik Date: Sun, 10 Jun 2001 22:37:39 +0000 Subject: [PATCH] See changelog 2001-06-10 19:40 GMT -3 --- harbour/ChangeLog | 4 ++++ harbour/source/rtl/net.c | 30 +++++++++++++++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2062f04ac1..b668388047 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2001-06-10 19:40 GMT -3 Luiz Rafael Culik + * source/rtl/net.c + *Added missing include file needed by DJGPP/GNUC + 2001-06-10 08:30 GMT -3 Luiz Rafael Culik * source/rtl/net.c + Support for DJGPP/RSXNT/GNUC compilers diff --git a/harbour/source/rtl/net.c b/harbour/source/rtl/net.c index a39808c1d2..e7793310f0 100644 --- a/harbour/source/rtl/net.c +++ b/harbour/source/rtl/net.c @@ -57,7 +57,9 @@ #include "hbapi.h" #include "hb_io.h" - +#if defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__) + #include "sys/param.h" +#endif /* NOTE: Clipper will only return a maximum of 15 bytes from this function. And it will be padded with spaces. Harbour does the same in the DOS platform. @@ -65,7 +67,20 @@ HB_FUNC( NETNAME ) { -#if defined(HB_OS_DOS) +#if defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__) + + { + char * pszValue = (char *) hb_xgrab(MAXGETHOSTNAME+1); + pszValue[ 0 ] = '\0'; + + gethostname (pszValue, MAXGETHOSTNAME); + + hb_retc( pszValue ); + hb_xfree( pszValue ); +} + + +#elif defined(HB_OS_DOS) { char szValue[ 16 ]; union REGS regs; @@ -95,17 +110,6 @@ HB_FUNC( NETNAME ) hb_retc( pszValue ); hb_xfree( pszValue ); } -#elif defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__) - { - char * pszValue = (char *) hb_xgrab(MAXGETHOSTNAME+1) - pszValue[ 0 ] = '\0'; - - gethostname (pszValue, MAXGETHOSTNAME) - - hb_retc( pszValue ); - hb_xfree( pszValue ); -} - #else hb_retc( "" ); #endif