Hi everybody, For those who don't know me, I'm Zoran's partner and am involved with compiling the Windows version of Tcl and Naviserver at our company.
As Zoran mentioned in one of his posts, I was reluctant to release our (my) changes and the VC project files, since those are quite specific to our development and I haven't in the many years that I have been involved yet found the time to clean them up and make them suitable for public use. However, many of my changes and fixes have been released through Zoran as our representative in the community. Just to comment Maurizio's changes related to variable names - I suppose he has done so due to conflicts with reserved words that MS VC++ doesn't tolerate. To mention a couple of other problems that I have discovered over the years and resolved rather dirtily in my compilation: The memory and DLL model of compilation must be the same for TCL and the Naviserver libs and must fit with the Microsoft redistributable package. This is why I compile everything with the same model and have made sure (through defines) that all the packages use the TCL memory allocator. Otherwise different MS memory allocators get involved and you get all kinds of strange effects and memory corruptions. Furthermore, the environment variable handling is affected. If the packages are compiled with different models, the vars will be visible in one package, but not in the other. Another problem is the interchangeable use of Windows Handles and ANSI file descriptors in the code, which does not work consistently in Windows. We have made some adaptions here, especially regarding the nx_proxy package in association with the remaining nsd code. However, AFAIK, Zoran has not yet had the time to release this yet. Lastly, if not compiled through VC, one is not able to use the VC debugger to debug the code. That is why I have avoided creating make files, using the existing configure/make files and mingw. I hope these tips may be valuable to Maurizio (and others). I have not yet inspected his project files and tried out the compilation, but I've seen that many have to do with casts to silence the warning during compilation and some with avoiding using reserved words. I hope to find the time in the future to get more involved. Regards, Ibrahim On 16-Oct-12 11:33, Gustaf Neumann wrote: > Dear Maurizio, > > First of all, many thanks for your efforts! These are very welcome! > > I am as well somewhat surprised, that there are still pieces of > K&R style around. > There is really no need to keep these. i'll commit an updated > version of tclxkeylist.c > to mercurial. As for the other changes, i am not really convinced > that changing > all variables named "new" to "mm_new" helps to improve the code... > > for the other changes, your archive file is the full kitchen > sink, going though > the changes will take a while. > > We should move the discussion to the naviserver-devel list > > Best regards > -gustaf neumann > > > > > On 16.10.12 00:36, Maurizio Martignano wrote: >> >> To facilitate the discussion, I put in here some examples of >> the changes I made: >> >> *2.a.* >> >> From >> >> mapPtr = ns_malloc(sizeof(Map)); >> >> To >> >> mapPtr = (Map*) ns_malloc(sizeof(Map)); >> >> *2.b.* >> >> From >> >> int >> >> TclX_WrongArgs (interp, commandNameObj, string) >> >> Tcl_Interp* interp; >> >> Tcl_Obj* commandNameObj; >> >> char * string; >> >> { >> >> To >> >> int >> >> TclX_WrongArgs (Tcl_Interp* interp, Tcl_Obj* commandNameObj, >> char* string) >> >> { >> >> *2.c* >> >> From >> >> if(new) { >> >> To >> >> if(mm_new) { >> >> All these changes have been applied everywhere. >> >> ======== >> >> Dear all, >> >> While the tests seem to go rather well but are >> not finished yet (and it will take quite some time), I have >> decided to make available anyhow the result of my activity. >> >> The sources (and Visual Studio 2012 project files) are >> available at: >> >> http://www.spazioit.com/software/naviserver-4.99.4-Win64.zip >> >> There are two categories of changes: >> >> 1.The ones required to have the system compiled by Visual >> Studio 2012 using as target Windows 64. They are identified by >> the #ifdef _WIN64 clause. >> >> 2.A set of necessary cosmetics/make up changes to the overall >> code base to make it more compliant with nowadays C STDs, and >> therefore more “acceptable” to nowadays C compilers, they are: >> >> a.I have made explicit all type conversions (with explicit casts) >> >> b.I have modified all functions defined in K&R C STD, changing >> them into ANSI C STD >> >> c.I have removed from the code base all reserved words, e.g.: >> new, delete, bool … >> >> These changes make the entire codebase less “old-style” and >> more maintainable in the future. >> >> Hope it helps, >> >> Maurizio ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ naviserver-devel mailing list naviserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/naviserver-devel