newLISP Fan Club

Forum => newLISP newS => Topic started by: Lutz on July 08, 2015, 08:23:46 AM

Title: newLISP Development Release v.10.6.3
Post by: Lutz on July 08, 2015, 08:23:46 AM
This development release adds new functionality to existing functions and fixes bugs.



Files and release notes: http://www.newlisp.org/downloads



Thanks to everybody participating in this release. Special thanks to Kosh, who did most of the work for the Windows 64-bit release.
Title: Re: newLISP Development Release v.10.6.3
Post by: HPW on July 08, 2015, 10:05:31 AM
Hello,



Thanks Lutz for the ongoing development.



Unfourtunatly my Norton Internet Security delete the windows installers because it reports WS.Reputation.1



But Virustotal scans without problem:



https://www.virustotal.com/de/file/590ff4f8c68cfec4ed3d2322345650349ec1505fe7e3bf7ca87379c4afb9cdc0/analysis/1436374630/



https://www.virustotal.com/de/file/2c9bc62618261419bd428792adbd46d42e16ea95356f2071dfeb4e787847209f/analysis/1436374825/



I will report a false positiv.



Regards
Title: Re: newLISP Development Release v.10.6.3
Post by: HPW on July 08, 2015, 11:10:03 AM
Hello,



In my regular testing against my neobook demo app, I get a error with commands which get imported into the newlsip.dll (32 bit). They now throw a access violation in my (Turtle3:run).



Until 10.602 all run without problems.



I noticed a different DLL-size from 10602 to 10603:

301.568 Bytes

286.734 Bytes



Any changes how Dll-callbacks were done?



The following command throws the violation:

(hpwImageTextOut "RImage1" "Dragon Fractal" "380" "70" "Times" "12" "clWhite" "clNavy")



> hpwImageTextOut      

(lambda (nbpara1 nbpara2 nbpara3 nbpara4  nbpara5 nbpara6 nbpara7 nbpara8) (hpwImageExec

  "" "9" nbpara1 nbpara2 nbpara3 nbpara4 nbpara5 nbpara6 nbpara7 nbpara8))



> hpwImageExec

hpwImageExec@2D814CC



hpwImageExec is the imported command from the neobook dll.



Regards
Title: Re: newLISP Development Release v.10.6.3
Post by: rickyboy on July 08, 2015, 12:16:26 PM
Quote from: "Lutz"This development release adds new functionality to existing functions and fixes bugs.  [...] Special thanks to Kosh, who did most of the work for the Windows 64-bit release.

Thanks, Lutz!  Thanks, kosh[04]!
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on July 08, 2015, 02:06:34 PM
Since the new development v.10.6.3, a newer development systems with GCC version 4.9.2 from the TDM system is used and running on Windows 7. Before v.10.6.3, Windows newLISP development was on Windows XP. It was time to move on to Windows 7 as a minimum, to take advantage of 64-bit Windows.



This is how simple ffi and extended ffi 'import' and 'callback' are tested:



newlisp-10.6.3/qa-specifif-tests/qa-libffi : simple and extended ffi for callbacks and imports

newlisp-10.6.3/qa-specifif-tests/qa-libc-libffi : extended ffi only and using system libraries

newlisp-10.6.3/examples/opengl-demo.lsp : simple ffi and callback 32-bit only

newlisp-10.6.3/examples/opengl-demo-ffi.lsp : extended ffi and callback 32-bit and 64-bit (UNIX only)



specifically for Windows 32-bit, great example how to work with various Windows DLLs:



newlisp-10.6.3/examples/win32demo.lsp : simple ffi only and with callbacks



When importing self compiled libs on Windows and using the simple ffi, try importing with "cdecl". See these changes in the qa-libffi file from v10.6.2 to v10.6.3. Try also the extended ffi, present on all Windows versions and all shipped installers for OSX and Linux. Also, the extended ffi does not need to specify "cdecl" versus using the default stdcall on Windows.
Title: Re: newLISP Development Release v.10.6.3
Post by: HPW on July 08, 2015, 10:51:00 PM
Hello,



The exported function hpwImageExec is compiled with stdcall-option.

It has worked for years now with the newlisp.dll

I have also other exported functions with stdcall which still works with 10603.



I have to further investigate where the access vioaltion occurs.





Regards
Title: Re: newLISP Development Release v.10.6.3
Post by: HPW on July 09, 2015, 12:30:53 AM
Hello,



The only difference I see between the working and non-working calls,

are the fact that the working calls are exported from the DLL which loads the newlisp.dll



The non-working (they do there work/drawing but the boolean-return seems to throw the access violation) are in a DLL which is loaded in the main-app parralel to the newlisp-caller DLL.



Not sure if that can make a difference now.



Edit:



There is a second working command in the DLL: hpwImageCmdList

It return a 1 for result=True



> hpwImageCmdList

hpwImageCmdList@376ECEC

> hpwImageExec

hpwImageExec@37714CC



Here the delphi function which throw the access violation:

FUNCTION hpwImageExec( password,cmdid,Params0,Params1,Params2,Params3,Params4,Params5,Params6,Params7,Params8,Params9 : PChar ) : BOOLEAN;  stdcall;
VAR
  IDNum : Integer;
BEGIN
  Result := FALSE;
  IF ExtPasswordcheck(password) Then
    BEGIN
      IDNum := StrToInt(cmdid);
      { Examine the Action string to determine which Plug-In command to execute... }
      CASE IDNum OF    
        1 : Result := CreateImageControl( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7 );
        2 : Result := RemoveImageControl( Params0, FALSE );
        3 : Result := ImageDrawLine( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7 );
        4 : Result := ImageDrawLines( Params0, Params1, Params2, Params3, Params4, Params5 );
        5 : Result := ImageFillRect( Params0, Params1, Params2, Params3, Params4, Params5 );
        6 : Result := ImageRectangle( Params0, Params1, Params2, Params3, Params4, Params5, Params6 );
        7 : Result := ImageFrameRect( Params0, Params1, Params2, Params3, Params4, Params5 );
        8 : Result := ImagePixels( Params0, Params1, Params2, Params3);
        9 : Result := ImageTextOut( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7);
       10 : Result := ImageTextOutAngle( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7, Params8);
       11 : Result := ImageFloodFill( Params0, Params1, Params2, Params3);
       13 : Result := ImageColorSwap( Params0, Params1, Params2, Params3, Params4, Params5, Params6);
       15 : Result := ImageLoadFromFile( Params0, Params1, Params2, Params3, Params4, Params5);
       16 : Result := ImageSaveToFile( Params0, Params1, Params2, Params3, Params4, Params5);
       17 : Result := ImageSize( Params0, Params1, Params2);
       18 : Result := ImageScaleFromFile( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7);
       19 : Result := ImageFileTurn( Params0, Params1, Params2);
       20 : Result := ImageLoadFromExe( Params0, Params1, Params2, Params3, Params4, Params5);
       21 : Result := ImageLoadFromMimeStream( Params0, Params1, Params2, Params3, Params4, Params5);
       22 : Result := ImageSaveToMimeStream( Params0, Params1, Params2, Params3, Params4, Params5);
       27 : Result := ImageCopyFromClip( Params0, Params1, Params2, Params3, Params4);
       28 : Result := ImageCopyToClip( Params0, Params1, Params2, Params3, Params4 );
       29 : Result := ImageScaleFromClip( Params0, Params1, Params2, Params3, Params4, Params5, Params6 );
       30 : Result := ImageToClip( Params0, Params1, Params2);
       31 : Result := ImageToRTF( Params0, Params1, Params2, Params3, Params4, Params5);
       32 : Result := ImageNViewLibSetLanguage( Params0, Params1);
       33 : Result := ImageNViewLibLoad( Params0, Params1, Params2, Params3, Params4, Params5);
       34 : Result := ImageNViewLibImageSize( Params0, Params1, Params2, Params3);
       40 : Result := ImageLoadFromWMF( Params0, Params1, Params2, Params3, Params4, Params5);
       70 : Result := ImageSetAlign( Params0, Params1);
       71 : Result := ImageSetPos( Params0, Params1, Params2);
       72 : Result := ImageSetSize( Params0, Params1, Params2);
       73 : Result := ImageMove( Params0, Params1, Params2);
       74 : Result := ImageSetCursor( Params0, Params1, Params2);
       75 : Result := ImageSetHint( Params0, Params1, Params2);
       76 : Result := ImageDragAndDrop( Params0, Params1, Params2, Params3, Params4);
       77 : Result := ImageCheckHotspot( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7 );
       78 : Result := ImageSetCheckDrop( Params0, Params1, Params2, Params3, Params4 );
       79 : Result := ImageSetDragImage( Params0, Params1, Params2, Params3, Params4, Params5 );
       80 : Result := ImageSetActions( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7 );
       81 : Result := ImageGetPixel( Params0, Params1, Params2, Params3);
       82 : Result := ImageGetColor( Params0, Params1, Params2, Params3, Params4);
       83 : Result := ImageCompare( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7, Params8);
       84 : Result := ImageFind( Params0, Params1, Params2, Params3, Params4, Params5);
       90 : Result := CreateScrollBarControl( Params0, Params1, Params2 );
       91 : Result := RemoveScrollBarControl( Params0, FALSE );
       92 : Result := ScrollbarSetParams( Params0, Params1, Params2, Params3);
       93 : Result := ScrollbarSmallChange( Params0, Params1);
       94 : Result := ScrollbarLargeChange( Params0, Params1);
       95 : Result := ScrollbarPageSize( Params0, Params1);
      100 : Result := ActivatePopup( Params0, Params1, Params2);
      101 : Result := SetPopupItem( Params0, Params1, Params2);
      102 : Result := ImageLoadCursor( Params0, Params1);
      103 : Result := ImageLoadCursorBitmap( Params0, Params1, Params2, Params3, Params4);
      104 : Result := ImageLoadFromFileEx( Params0, Params1, Params2, Params3, Params4, Params5);
      105 : Result := ImageFileOpenPictureBox( Params0, Params1, Params2, Params3, Params4, Params5);
      106 : Result := ImageLoadStamp( Params0, Params1, Params2, Params3);
      107 : Result := ImageStampConfig( Params0, Params1, Params2, Params3, Params4, Params5, Params6);
      108 : Result := ImageBitBlt( Params0, Params1, Params2, Params3, Params4, Params5);
      109 : Result := ImageDrawShadow( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7, Params8);
      110 : Result := ImageFontBox( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7, Params8);
      111 : Result := ImageColorBox( Params0, Params1, Params2);
      112 : Result := ImageGetRectArea( Params0, Params1);
      113 : Result := ImageConvToHSL( Params0, Params1, Params2, Params3);
      114 : Result := ImageColorCircle( Params0, Params1, Params2, Params3, Params4);
      115 : Result := ImageStampUpdateBuffer( Params0);
      116 : Result := ImageGetBoundery( Params0, Params1, Params2, Params3, Params4, Params5, Params6);
      117 : Result := ImageStamp( Params0, Params1, Params2);
       ELSE Result := FALSE;
      END;
    END;
END;






Regards
Title: Re: newLISP Development Release v.10.6.3
Post by: HPW on July 09, 2015, 01:14:00 AM
Hello,



Looking with the dependency walker at both DLL, I noticed that 10603 has the WEP-entry point as the first entry where it was the last in 10602.



And there is a new newLispLibConsole.

What to do with it in DLL?



Regards
Title: Re: newLISP Development Release v.10.6.3
Post by: HPW on July 09, 2015, 02:18:33 AM
Hello,



I finally figured it out:



DLL < 10603 were tolerant when calling the function with less parameter than defined.



FUNCTION hpwImageExec( password,cmdid,Params0,Params1,Params2,Params3,Params4,Params5,Params6,Params7,Params8,Params9 : PChar ) : BOOLEAN;  stdcall;



So adding an empty param solves the exception:



(hpwImageExec "" "3" "RImage1" "0" "0" "100" "100" "clRed" "" "psSolid" "2" "")



Regards
Title: Re: newLISP Development Release v.10.6.3
Post by: HPW on July 09, 2015, 05:43:36 AM
And mail from symantec:


Quote
Upon further analysis and investigation we have verified your submission and, as such, the detection(s) for the following file(s) will be removed from our products:



        D57CA6F8688BE2661ECCDCEA2EB24C8D - newlisp_10603_win_gs_163.exe





The updated detection(s) will be distributed in the next set of virus definitions, available via LiveUpdate or from our website at http://securityresponse.symantec.com/avcenter/defs.download.html



Please note that whitelisting can take up to 24 hours to take effect.







Upon further analysis and investigation we have verified your submission and, as such, the detection(s) for the following file(s) will be removed from our products:



        E99D50886F30187F7ABA3E14A07C6292 - newlisp_10603_win64_gs_163.exe





The updated detection(s) will be distributed in the next set of virus definitions, available via LiveUpdate or from our website at http://securityresponse.symantec.com/avcenter/defs.download.html



Please note that whitelisting can take up to 24 hours to take effect.
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on July 09, 2015, 08:05:20 AM
Thanks Hans-Peter for bringing this to Symantec's attention.
Title: Re: newLISP Development Release v.10.6.3
Post by: HPW on July 10, 2015, 11:06:00 PM
Hello,



In CodePatters chapter 24 you can read:
QuoteOnly on MS Windows, the installer comes with a precompiled newlisp.dll and will install it in the WINDOWSsystem32 directory (since v.10.3.3) and in the Program Files/newlisp/ directory.


Is it right? I see no newlisp.dll in system32.



Regards
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on July 11, 2015, 06:04:48 AM
Only installs in the newLISP program directory.



Corrected here: http://www.newlisp.org/downloads/CodePatterns.html#toc-24

and here: http://www.newlisp.org/downloads/development/CodePatterns.html#toc-24
Title: Re: newLISP Development Release v.10.6.3
Post by: xytroxon on July 11, 2015, 11:38:12 PM
I noticed that just below that section, in the "Registering callbacks" section.


(set 'LIBRARY (if (= ostype "Win32") "newlisp.dll" "newlisp.dylib"))

and...


(set 'CALLTYPE (if (= ostype "Win32") "stdcall" "cdecl"))

The ostype string being compared should  be changed to "windows".



-- xytroxon
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on July 12, 2015, 06:29:34 AM
This was already changed: http://www.newlisp.org/downloads/development/CodePatterns.html showing 10.6.3 in the title page.



Perhaps you where looking in the version for 10.6.2 in the main download directory. It also has a current date, but does not have the "Win32" -> "Windows" update. I will keep both versions updated till the next stable release, but in a version sensitive manner.
Title: Re: newLISP Development Release v.10.6.3
Post by: kosh on July 13, 2015, 02:06:15 PM
Lutz, Thanks for applying my patch.



I found some other compile problems.



1. configure-alt: still `os_type` is set to WIN_32/64


diff --git a/configure-alt b/configure-alt
index 1994097..d1bfb73 100755
--- a/configure-alt
+++ b/configure-alt
@@ -70,8 +70,8 @@ case `uname` in
  SunOS) true ${os_type:=SUNOS} ;;
  AIX) true ${os_type:=AIX} ;;
  OSF1) true ${os_type:=TRU64} ;;
- MINGW32_*) true ${os_type:=WIN_32} ;;
- MINGW64_*) true ${os_type:=WIN_64} ;;
+ MINGW*) true ${os_type:=WINDOWS} ;;
  OS/2) true ${os_type:=OS2} ;;
  *)
  echo Could not discover your OS platform use one of the following commands:
@@ -100,7 +100,7 @@ elif [ ${os_type} = TRU64 ] ; then
  DEFAULT_CC="${TRU64_CC}"
  DEFAULT_CFLAGS="${TRU64_CFLAGS}"
  DEFAULT_LDFLAGS="${TRU64_LDFLAGS}"
-elif [ ${os_type} = WIN_32 ] ; then
+elif [ ${os_type} = WINDOWS ] ; then
  DEFAULT_CC="${WIN32_CC}"
  DEFAULT_CFLAGS="${WIN32_CFLAGS}"
  DEFAULT_LDFLAGS="${WIN32_LDFLAGS}"


2. newlisp.h: _WIN32_WINNT could not set correctly


$make -f makefile_mingw_ffi
...
gcc -m32 newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml-json.o nl-web.o nl-matrix.o nl-debug.o pcre.o win-util.o wi
n-path.o -lws2_32 -lffi -o newlisp.exe
nl-sock.o: In function `getHostAddr':
c:devnewlisp/nl-sock.c:677: undefined reference to `getaddrinfo'
c:devnewlisp/nl-sock.c:682: undefined reference to `freeaddrinfo'
...
make: *** [default] Error 1


It happends in mingw32 only, not mingw64.



Perhaps _WIN32_WINNT was already defined (maybe 0x0500) in "win-ffi.h" in newlisp.h:114.

As a result, _WIN32_WINNT could not set in newlisp.h:170.
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on July 13, 2015, 03:18:59 PM
Thanks for the configure-alt fix. It works now, but on a Windows 7 64-bit systems it also compiles a 32-bit newlisp.exe and without libffi using the TDM GCC 64 toolset.



I am not too concerned about this, as we have working Windows 32/64-bit compilations using the normal configure script and the TDM GCC 64 toolset. It can use the mingw64 to compile 32-bit newlisp.exe with libffi without any error messages. using make winall or make winall64, the executables for the Windows installers are done together with DLLs.



The configure-alt file is getting old and I wonder if it still should be included in the final 10.6.4 release? Perhaps Ted W. has some time to update the Windows portion, or we simply take the Windows portion out and use it only for Unix. It would also be nice to have a working libffi detection on many Unix platforms.
Title: Re: newLISP Development Release v.10.6.3
Post by: johu on July 16, 2015, 01:40:18 AM
Hello, Lutz.



For Stable Release,



line 2965 in newlisp_manual v10.6.3
Quoteto itself, elready existing contexts like MAIN do not require quoting.</p>

     ↓

to itself, already existing contexts like MAIN do not require quoting.</p>

line 3029
Quote<tt>ACTX</tt>, ot the whole funtion must be preceded by a context

       ↓

<tt>ACTX</tt>, or the whole funtion must be preceded by a context

line 25350
Quote<p>10.1.0 size of share objects can exceed the shared memory pagesize

   ↓

<p>Since v.10.1.0 size of share objects can exceed the shared memory pagesize

line 25353
Quoteoperating system. On MS Windows systems the environment vatiable <tt>TEMP</tt>

                            ↓

operating system. On MS Windows systems the environment variable <tt>TEMP</tt>

line 27178
Quote<h4>syntax: (trace true)


          ↓

<h4>syntax: (trace int-device)


line 27179
Quotesyntax: (trace int-device)


          ↓

syntax: (trace true)

line 27199
Quote<p>In the second syntax debugger mode is switched on when when the

                            ↓

<p>In the second syntax debugger mode is switched on when the


Regards,
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on July 16, 2015, 09:04:27 AM
Many thanks, Johu. Updates are here:



http://www.newlisp.org/downloads/development/inprogress/
Title: Re: newLISP Development Release v.10.6.3
Post by: TedWalther on July 17, 2015, 12:39:12 PM
Quote from: "Lutz"Thanks for the configure-alt fix. It works now, but on a Windows 7 64-bit systems it also compiles a 32-bit newlisp.exe and without libffi using the TDM GCC 64 toolset.



I am not too concerned about this, as we have working Windows 32/64-bit compilations using the normal configure script and the TDM GCC 64 toolset. It can use the mingw64 to compile 32-bit newlisp.exe with libffi without any error messages. using make winall or make winall64, the executables for the Windows installers are done together with DLLs.



The configure-alt file is getting old and I wonder if it still should be included in the final 10.6.4 release? Perhaps Ted W. has some time to update the Windows portion, or we simply take the Windows portion out and use it only for Unix. It would also be nice to have a working libffi detection on many Unix platforms.


It has been a few years, configure-alt served the purpose of getting newlisp included as a standard package on the BSD platform.  It also made it GNU compliant so it was easier to do automated testing and installs.



I really don't like having a configure-alt separate from the configure.  I'd like to bring configure-alt to feature parity with configure, and have it replace configure.  If this is acceptable, I will work on it for the 10.6.4 release.  I already have some patches to configure-alt for OpenBSD and Darwin.  I was waiting to upgrade my OpenBSD development box; now they support a new enough version of libffi that newlisp should compile and be fully featured.



I propose that once configure-alt is at feature parity with configure, then all the various makefiles get moved to a directory makefiles/



I now have also a Darwin build environment, and access to a Windows build environment.  So many things are possible that I couldn't do back when I first made configure-alt.



As more of us are becoming familiar with the codebase, Lutz, I'm wondering if you'd be ok looking into using git a bit more.  Git lets you "tag" a release; in between, this is the workflow I've had the best success with:



for a new feature or bug fix, make a branch.  Implement it.  Test it.  git merge --squash.  I think this will be helpful in bringing others up to speed on how things are done internally in newlisp, by seeing real world "how things get done in newlisp".



kosh uses git.  I use git.  Ralph, are you comfortable with git?  I know mercurial is probably the better software, but git has the strength of numbers.



One makefile patch:



diff --git a/makefile_darwinLP64_utf8_lib b/makefile_darwinLP64_utf8_lib
index b11585a..0899a60 100644
--- a/makefile_darwinLP64_utf8_lib
+++ b/makefile_darwinLP64_utf8_lib
@@ -6,16 +6,16 @@
 OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o
        nl-sock.o nl-import.o nl-xml-json.o nl-web.o nl-matrix.o nl-debug.o pcre.o nl-utf8.o unix-lib.o
 
-CFLAGS = -m64 -Wall -O1 -c -DREADLINE -DMAC_OSX -DSUPPORT_UTF8 -DLIBRARY
+CFLAGS = -m64 -Wall -O1 -c -DREADLINE -DMAC_OSX -DNEWLISP64 -DSUPPORT_UTF8 -DFFI -DLIBRARY
 
 CC = gcc
 
 default: $(OBJS)
-       $(CC) $(OBJS) -m64 -lm -lreadline -bundle -o newlisp.dylib
+       $(CC) $(OBJS) -m64 -lm -lreadline -lffi -bundle -o newlisp.dylib
 
 .c.o:
        $(CC) $(CFLAGS) $<
 
-$(OBJS): primes.h protos.h makefile_darwinLP64_utf8_lib
+$(OBJS): newlisp.h primes.h protos.h makefile_darwinLP64_utf8_lib
 


And the patch to configure-alt:



diff --git a/configure-alt b/configure-alt
index 1e182c8..51d54b0 100755
--- a/configure-alt
+++ b/configure-alt
@@ -208,14 +208,17 @@ rm -f test-readline*
 
 # If we can't compile with ffi, and the environment variables don't
 # specify otherwise, we will disable it.
-cat > test-ffi.c <<EOF
+for cclibffi in "-lffi"; do
+       for h in "ffi.h" "ffi/ffi.h"; do
+               FFI_H=${h}
+               cat > test-ffi.c <<EOF
 /* test-ffi.c Fri Jul 10 14:57:33 PDT 2009 Ted Walther <ted@reactor-core.org>
  *
  * code for testing the compiler options to use for libffi
  */
 
 #include <stdio.h>
-#include <ffi.h>
+#include <${FFI_H}>
 
 int main(int argc, char** argv) {
        ffi_cif cif;
@@ -237,13 +240,13 @@ int main(int argc, char** argv) {
        return 0;
 }
 EOF
-for cclibffi in "-lffi"; do
-       if ${CC:-${DEFAULT_CC}} test-ffi.c ${DEFAULT_LDFLAGS} ${cclibffi} -o test-ffi 2>/dev/null ; then
-               true ${enable_ffi:=yes};
-               DEFAULT_FFIFLAGS="${cclibffi}";
-               echo "Detected ffi flags: ${cclibffi}";
-               break;
-       fi
+               if ${CC:-${DEFAULT_CC}} test-ffi.c ${DEFAULT_LDFLAGS} ${cclibffi} -o test-ffi 2>/dev/null ; then
+                       true ${enable_ffi:=yes};
+                       DEFAULT_FFIFLAGS="${cclibffi}";
+                       echo "Detected ffi flags: ${cclibffi}";
+                       break;
+               fi
+       done
 done
 true ${enable_ffi:=no};
 rm -f test-ffi*
@@ -405,6 +408,7 @@ if [ $enable_ffi = yes ] ; then
        cat >> config.h <<EOF
 /* FFI support was chosen */
 #define FFI
+#include <${FFI_H}>
 
 EOF
        echo "ffi support is enabled"


This patch accounts for the fact that on some platforms, <ffi.h> should be <ffi/ffi.h>.  Right now I only know about this affecting Darwin, but I can see it potentially affecting other BSD variants.
Title: Re: newLISP Development Release v.10.6.3
Post by: rrq on July 17, 2015, 04:39:43 PM
I'd be happy to learn (more) about git, and fwiw in full support for this.



And I can set you up with a remote armv7 build environment if you like.

Currently with Ubuntu 12.04 but that can be flexible.



Then there's also the Android variant(s) to hopefully be included as mainstream.
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on July 18, 2015, 10:37:13 AM
No problem with using Git for configure-alt development. I can take new versions of configure-alt from there and can help testing on OSX, Windows 7, Ubuntu Linux and FreeBSD.



On the main newLISP code base I prefer development the way it has been done. Of course there is no problem do have a Git repository for all newLISP stable and development releases. There is one, Kosh maintains here: https://github.com/kosh04 it could be useful to see the history of code portions when fixing bugs.
Title: Re: newLISP Development Release v.10.6.3
Post by: TedWalther on July 18, 2015, 02:48:52 PM
Lutz, I was requesting that you push your changes up to kosh04 git repository similar to how you do for the inprogress branch; this way we don't just see changes between releases, but get a better sense of what changes go into a particular feature or bugfix.  Then we get the benefit of the issue tracker on github also.
Title: Re: newLISP Development Release v.10.6.3
Post by: TedWalther on July 18, 2015, 02:52:36 PM
Lutz, another reason for suggesting git for main body of newlisp development is this: to make it easier for more people to contribute, and to make it easier for you to manage a greater number of contributors.  I've been wondering why languages like ruby on rails, or clojure, are more widely used than newlisp.  Greater mass of contributors and use cases means more resources all around for everyone.
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on July 18, 2015, 04:29:29 PM
As everybody knows, I keep a tight control about what new features enter the newLISP language. If people need  more use-cases, they should write modules and import libraries when necessary. For the main newLISP executable itself, I don't want more contributors.



Having worked with most of the software version control systems like RCS, CVS, SVN besides Git and in developer teams since the late eighties in small and big companies, I am well aware what these systems can do and cannot do. For my style as mostly the sole developer they are not useful. Pushing every change to a repository is just one more thing to do, I don't need and want.



Again, if anybody wants to capture change over versions in a public Git depository that is fine, but I will not change my style of development.



For more use cases write modules, import libraries! Publish them on the Git repository, documented! and I can put them in the index at http://www.newlisp.org/modules/
Title: Re: newLISP Development Release v.10.6.3
Post by: rrq on July 18, 2015, 04:51:24 PM
Whilst I bow to your experience in these matters, TedWalter, upon reflection I support Lutz in maintaining a practical barrier for code change. Obviously it can be done in different ways, but the way it's done certainly makes newlisp stable in respect of platform features and it's practical utility as scripting language. And I don't think this barrier plays much of a role for the uptake (or not) of newlisp, although admittedly this isn't something I've been thinking about.



Yes, the contributions it needs are more in the way of frameworks and infrastructural components supporting particular usage domains, than changes to the platform code. Maybe we should focus on the structuring, organisation and publishing of our various snippets of newlisp code, to make it easier for the casual visitor/user to pick up the required titbits for her collage.



The platform documentation is awesome, but when you want a snippet for doing your thing,  you have to seek around among modules, tips and wherever, and basically know the solution you're looking for before you can find it. Perhaps that's the egg here; a large enough user community will make enough web noise to let me find my solution by voicing my problem.
Title: Re: newLISP Development Release v.10.6.3
Post by: xytroxon on July 19, 2015, 02:47:43 PM
After spending a couple of hours in a time warp after an unexpected date-value function crash in a weekly archive program I run.



((( Yes, I NOW know about: //http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=4725



(PLEASE, post about devlopment release errors in the development release thread!!!) )))



I noticed a peculiarity in the date function example in the newLISP manual:



(date 0 (now 0 -2)) -> "Thu Jan  1 00:00:00 1970"  ; Unix epoch



Which when executed on Win 7 returns -> nil



In my time zone: (now 0 -2) ->  -420



Inverting the sign to +420 gives the expected* result:



(date 0 (* (now 0 -2) -1)) -> "Thu Jan 01 00:00:00 1970"



Is this a newLISP coding error, or a devious "design feature" from the ancient UNIX/C system gods - IE C system time functions returning and needing the time zone expressed with different sign values?



-- Dr Who... er.  xytroxon



* My expected result would be:



(date 0) -> "Thu Jan 01 00:00:00 1970"

(date 0 -420) -> "Wed Dec 31 17:00:00 1969"



But then, I am not a UNIX/C system god ;o)
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on July 19, 2015, 03:55:55 PM
date without offset parameter displays local time and also adjusted for daylight savings time (e.g. in California). now displays UTC (universal time) and the number of minutes your are behind (minus for west of Greenwich) or ahead (plus for east of Greenwich) of UTC.



Also, Windows cannot handle negative values before Unix epoch and returns nil and not all OS deliver a valid indication for the daylight savings time or encode it in different ways.



Ps: there is a problem with the UTC offset in now on 10.6.3 on Windows 64-bit compiles corrected in the latest 10.6.4. The UTC offset in Windows also not includes the daylight saving offset, but may in final 10.6.4, to make at least the UTC offset portable between Windows and Unix.
Title: Re: newLISP Development Release v.10.6.3
Post by: kosh on August 09, 2015, 01:40:54 PM
Quote from: "Lutz"Thanks for the configure-alt fix. It works now, but on a Windows 7 64-bit systems it also compiles a 32-bit newlisp.exe and without libffi using the TDM GCC 64 toolset.



I am not too concerned about this, as we have working Windows 32/64-bit compilations using the normal configure script and the TDM GCC 64 toolset. It can use the mingw64 to compile 32-bit newlisp.exe with libffi without any error messages. using make winall or make winall64, the executables for the Windows installers are done together with DLLs.


It means that newLISP drop support on previous MinGW32 toolset, and migrate to TDM-GCC 32/64 toolset?
Title: Re: newLISP Development Release v.10.6.3
Post by: Lutz on August 10, 2015, 06:44:55 AM
Yes, the TDM-GCC 32/64 toolset, it also seems to use MinGW but is easier to install and compiles both: 32-bit and 64-bit executables and DLLs with less problems. The GCC used seems to be a 32-bit executable, not 64-bit as earlier stated. The installation comes with both 32-bit and 64-bit libraries. The only thing I add are two libffi.a files for 32 and 64 bit to the appropiate library directories and MSYS for make and other Unix tools.
Title: Re: newLISP Development Release v.10.6.3
Post by: xytroxon on September 19, 2015, 11:15:18 PM
newLISP manual spelling error.



delete-url

syntax: (delete-file str-url)