[Glass] CHeader and CPreprocessor paths as arguments

Dale Henrichs dale.henrichs at gemtalksystems.com
Wed Jun 24 09:58:06 PDT 2020


Bruno,

Here's our advice:

    I would think that  editing CPreprocessor>>defaultSearchPaths 
    would be a good workaround

    Keep in mind that 3.5  is using the native  preprocessor  /usr/bin/cpp
    for all of the macro expansion and then reading the output of cpp
    with our CPreprocessor code.   3.3 is trying to do all of the macro
    expansion in  CPreprocessor  and that has quite a few bugs that may
    be triggered by system header files in newer versions of Linux than
    what 3.3
    was originally tested with.
    If you encounter such bugs with 3.3, you might need to run
    /usr/bin/cpp on the header files of interest and then feed the resulting
    output to CPreprocessor .

Dale

On 6/24/20 5:09 AM, bruno buzzi brassesco via Glass wrote:
> Hi,
>
> In GS 3.5 it is possible to pass paths as arguments:
> CHeader>>path:searchPaths:
>
> In GS 3.3.x that method is not present but it will have the same 
> effect if we add our paths to:
> CPreprocessor>>defaultSearchPaths
> Can this be a workaround for the error below ?
>
> Trying to generate a wrapper with:
> UserGlobals at: #'LibSsh094' put: (CHeader path: 
> '/customized/path/libssh.h').
>
> Answer the error:
> Unhandled exception: GS Server Error - GbsGemStoneError - a 
> UserDefinedError occurred (error 2740), Include file sys/cdefs.h not 
> found!
> [1]  GS: UserDefinedError (AbstractException) >> _signalWith: @6 line 25
> [2]  GS: UserDefinedError (AbstractException) >> signal: @3 line 7
> [3]  GS: UserDefinedError class (AbstractException class) >> signal: 
> @3 line 4
> [4]  GS: CPreprocessor >> include:afterMe: @55 line 39
> [5]  GS: CPreprocessor >> applyDirectiveToken: @27 line 10
> [6]  GS: CPreprocessor >> applyToken: @4 line 3
> [7]  GS: CPreprocessor >> doIf: @11 line 12
> [8]  GS: CPreprocessor >> ifdef:defined: @22 line 8
> [9]  GS: CPreprocessor >> applyDirectiveToken: @19 line 8
> [10] GS: CPreprocessor >> applyToken: @4 line 3
> [11] GS: CPreprocessor >> doIf: @11 line 12
> [12] GS: CPreprocessor >> ifdef:defined: @22 line 8
> [13] GS: CPreprocessor >> applyDirectiveToken: @19 line 8
> [14] GS: CPreprocessor >> applyToken: @4 line 3
> [15] GS: CPreprocessor >> doIf: @11 line 12
> [16] GS: CPreprocessor >> ifdef:defined: @22 line 8
> [17] GS: CPreprocessor >> applyDirectiveToken: @19 line 8
> [18] GS: CPreprocessor >> applyToken: @4 line 3
> [19] GS: CPreprocessor >> readTillEnd @6 line 7
> [20] GS: [] in  ExecBlock0 (CPreprocessor) >> includePath: @20 line 12
> [21] GS: ExecBlock0 (ExecBlock) >> ensure: @2 line 12
> [22] GS: CPreprocessor >> includePath: @16 line 13
> [23] GS: [] in  ExecBlock1 (CPreprocessor) >> include:afterMe: @68 
> line 34
> [24] GS: OrderedCollection (Collection) >> do: @6 line 10
> [25] GS: CPreprocessor >> include:afterMe: @41 line 26
> [26] GS: CPreprocessor >> applyDirectiveToken: @27 line 10
> [27] GS: CPreprocessor >> applyToken: @4 line 3
> [28] GS: CPreprocessor >> doIf: @11 line 12
> [29] GS: CPreprocessor >> ifdef:defined: @22 line 8
> [30] GS: CPreprocessor >> applyDirectiveToken: @19 line 8
> [31] GS: CPreprocessor >> applyToken: @4 line 3
> [32] GS: CPreprocessor >> readTillEnd @6 line 7
> [33] GS: [] in  ExecBlock0 (CPreprocessor) >> includePath: @20 line 12
> [34] GS: ExecBlock0 (ExecBlock) >> ensure: @2 line 12
> [35] GS: CPreprocessor >> includePath: @16 line 13
> [36] GS: [] in  ExecBlock1 (CPreprocessor) >> include:afterMe: @68 
> line 34
> [37] GS: OrderedCollection (Collection) >> do: @6 line 10
> [38] GS: CPreprocessor >> include:afterMe: @41 line 26
> [39] GS: CPreprocessor >> applyDirectiveToken: @27 line 10
> [40] GS: CPreprocessor >> applyToken: @4 line 3
> [41] GS: CPreprocessor >> doIf: @11 line 12
> [42] GS: CPreprocessor >> ifdef:defined: @22 line 8
> [43] GS: CPreprocessor >> applyDirectiveToken: @15 line 7
> [44] GS: CPreprocessor >> applyToken: @4 line 3
> [45] GS: CPreprocessor >> doIf: @11 line 12
> [46] GS: CPreprocessor >> ifdef:defined: @22 line 8
> [47] GS: CPreprocessor >> applyDirectiveToken: @19 line 8
> [48] GS: CPreprocessor >> applyToken: @4 line 3
> [49] GS: CPreprocessor >> readTillEnd @6 line 7
> [50] GS: [] in  ExecBlock0 (CPreprocessor) >> includePath: @20 line 12
> [51] GS: ExecBlock0 (ExecBlock) >> ensure: @2 line 12
> [52] GS: CPreprocessor >> includePath: @16 line 13
> [53] GS: CPreprocessor class >> parseFileAt: @3 line 4
> [54] GS: CHeader class >> path: @2 line 3
>
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> https://lists.gemtalksystems.com/mailman/listinfo/glass
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gemtalksystems.com/mailman/private/glass/attachments/20200624/fac919dd/attachment.htm>


More information about the Glass mailing list