• How set HB_VMMODE = 1

    From Eduardo Motta@21:1/5 to All on Wed Apr 14 10:12:48 2021
    How set HB_VMMODE = 1 (Optimized for console applications) ?

    thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Wed Apr 14 19:50:02 2021
    Il 14/04/2021 19:12, Eduardo Motta ha scritto:

    How set HB_VMMODE = 1 (Optimized for console applications) ?

    HB_VMMODE = 1 is "Optimized for GUI applications".

    Anyway, you can't. You have to rebuild xHarbour with the correct flags:

    HB_FUNC( HB_VMMODE )
    {
    HB_THREAD_STUB_API
    #if defined( HB_NO_PROFILER ) && defined( HB_NO_TRACE ) && ! defined(
    HB_GUI )
    /* optimized for console applications */
    hb_retni( 2 );
    #elif defined( HB_NO_PROFILER ) && defined( HB_NO_TRACE ) && defined(
    HB_GUI )
    /* optimized for gui applications */
    hb_retni( 1 );
    #else
    /* no optimization */
    hb_retni( 0 );
    #endif
    }

    EMG

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eduardo Motta@21:1/5 to All on Wed Apr 14 12:45:19 2021
    How should I compile for "Optimized for console applications" ?
    Thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Wed Apr 14 22:18:26 2021
    Il 14/04/2021 21:45, Eduardo Motta ha scritto:

    How should I compile for "Optimized for console applications" ?

    Which value do you currently get from HB_VMMODE()?

    EMG

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eduardo Motta@21:1/5 to All on Wed Apr 14 13:29:13 2021
    HB_VMMODE = 2

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Wed Apr 14 23:32:12 2021
    Il 14/04/2021 22:29, Eduardo Motta ha scritto:

    HB_VMMODE = 2

    So your xHarbour is already optimized for console applications:

    HB_FUNC( HB_VMMODE )
    {
    HB_THREAD_STUB_API
    #if defined( HB_NO_PROFILER ) && defined( HB_NO_TRACE ) && ! defined(
    HB_GUI )
    /* optimized for console applications */
    hb_retni( 2 );
    #elif defined( HB_NO_PROFILER ) && defined( HB_NO_TRACE ) && defined(
    HB_GUI )
    /* optimized for gui applications */
    hb_retni( 1 );
    #else
    /* no optimization */
    hb_retni( 0 );
    #endif
    }

    EMG

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eduardo Motta@21:1/5 to All on Thu Apr 15 06:15:03 2021
    see documentarion:

    HB_VMMode()
    Indicates the creation mode of the xHarbour virtual machine.

    Syntax
    HB_VMMode() --> nCreationMode

    Return
    The function returns a numeric value.

    Description
    Function HB_VMMode() exists for informational purposes only. It returns a numeric value indicating the creation mode of xHarbour's virtual machine. The following return values are possible:

    Modes of the Virtual Machine Value Description

    0 *) Regular creation

    1 Optimized for console applications

    2 Optimized for GUI applications

    *) default

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Thu Apr 15 16:09:00 2021
    Il 15/04/2021 15:15, Eduardo Motta ha scritto:

    see documentarion:

    The documentation is wrong. Please look at the source code of the
    function HB_VMMODE():

    HB_FUNC( HB_VMMODE )
    {
    HB_THREAD_STUB_API
    #if defined( HB_NO_PROFILER ) && defined( HB_NO_TRACE ) && ! defined(
    HB_GUI )
    /* optimized for console applications */
    hb_retni( 2 );
    #elif defined( HB_NO_PROFILER ) && defined( HB_NO_TRACE ) && defined(
    HB_GUI )
    /* optimized for gui applications */
    hb_retni( 1 );
    #else
    /* no optimization */
    hb_retni( 0 );
    #endif
    }

    EMG

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)