On Tue, 2009-12-01 at 10:24 +0100, Øyvind Harboe wrote: > On Tue, Dec 1, 2009 at 10:19 AM, Zach Welch <z...@superlucidity.net> wrote: > > On Tue, 2009-12-01 at 10:16 +0100, Øyvind Harboe wrote: > >> > The patch to ecosboard.c always gives a non-NULL value, and we always > >> > pass in NULL from openocd.c. The #if is entirely redundant when you > >> > take a moment to look at the big picture. > >> > >> Except it doesn't build, it's that messy bit with difference build modes > >> for > >> Jim. > >> > >> I'm kinda hopeful that the #if can be removed eventually if Jim improves > >> to have a less obtuse way to handle embedded vs. using in include files... > > > > I have been meaning to produce a series that seriously cleans up the #if > > madness that we have going on. This nonsense drives me insane. I have > > a solution for this particular problem, so maybe it's time to start it. > > W.r.t. Jim Tcl there be dragons. Btw, Jim Tcl is is trying to recruit > a new maintainer...
If I took it over, I would fork and start on a new major revision. The current version appears to be unmaintainable... which, incidentally, might be why it needs a new maintainer. ;) > Are you sure you it's a good idea to start this now? Yes, but you are verily confused about my direction. > To truly tackle this you would have to handle different cases: jim tcl > in shared library, jim tcl statically linked, jim tcl created by someone > else than OpenOCD... For OpenOCD, it is not nearly as hard as you make it seem: 1) Rename ecosboard.c as openocd_ecos.c 2) Add openocd_common.c, openocd_linux.c, openocd_win32.c, etc. 3) Declare stuff in openocd.h and define them in all files. Some files will declare only stubs... others will This would allow us to get rid of most Win32, eCos, and other platform-related #if's throughout the tree, perhaps all of them. However, the original patch from $SUBJECT could still be improved: that #if block can be moved to openocd.c, which has the effect today as the plan above would accomplish. Thus, we can add 'assert(interp)' at the top of the command_init routine, as both callers pass it in. --Z _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development