slang-users mailing list

[2014 Date Index] [2014 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] SLprep_set_eval_hook() usage


Gisle Vanem <gvanem@xxxxxxxx> wrote:
> It's set in the makefile. But per the above I want it to be extended 
> by the hook. Is that possible? Do you have an example of what the
> SLprep_set_eval_hook() can do?

It will not work in the way you would like.  All the hook does is to
allow an application give a meaning to constructs such as:

   #if (expression)
   #ifeval (expression)

[...]
> @ifdef VISUALC
> CC       = cl
> CFLAGS = -nologo -Zi -W3 
> ...
> CFLAGS = $(CFLAGS) -D_WIN32_WINNT=0x0501
> @endif
>
> Called as 'mkmake makefile.all VISUALC > visualc.mak'
> So my problem boils down to; how can mkmake spit out the
> correct '-D_WIN32_WINNT=??' value? If a SLprep_set_eval_hook()
> cannot do it, I must use another way.

I think that the simplest way would be to modify mkmake.c to write
something like:

   WIN32_WINNT_VERS = value returned by GetVersionEx

to stdout when it is run.  Then modify your input makefile to make
use of this variable:

   CFLAGS = $(CFLAGS) -D_WIN32_WINNT=$(WIN32_WINNT_VERS)

That is, in mkmake.c, change

   for (i = 1; i < argc; i++)
     SLdefine_for_ifdef (argv[i]);

   while (NULL != fgets (buf, sizeof (buf) - 1, stdin))
     {

to

   for (i = 1; i < argc; i++)
     SLdefine_for_ifdef (argv[i]);

   (void) fprintf (stdout, "WIN32_WINNT_VERS=0x%X\n",
                   call_getversionex());

   while (NULL != fgets (buf, sizeof (buf) - 1, stdin))
     {

where call_getversionex() is the appropriate wrapper around
GetVersionEx().

I hope this better answers the question.
Thanks,
--John
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.


[2014 date index] [2014 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]