VirtualBox

Changeset 1036 in kBuild for trunk/src


Ignore:
Timestamp:
Jun 4, 2007 5:20:29 PM (18 years ago)
Author:
bird
Message:

Ignore closing curly braces (extern "C" { ... }). Updated VCC statement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kObjCache/kObjCache.c

    r1024 r1036  
    952952             * Pinpoint the difference exactly and the try find the start
    953953             * of that line. Then skip forward until we find something to
    954              * work on that isn't spaces or #line statements. Since we
    955              * might be skipping a few new empty headers, it is possible
    956              * that we will omit this header from the dependencies when
    957              * using VCC. But I think that's a reasonable trade off for
    958              * a simple algorithm.
     954             * work on that isn't spaces, #line statements or closing curly
     955             * braces.
     956             *
     957             * The closing curly braces are ignored because they are frequently
     958             * found at the end of header files (__END_DECLS) and the worst
     959             * thing that may happen if it isn't one of these braces we're
     960             * ignoring is that the final line in a function block is a little
     961             * bit off in the debug info.
     962             *
     963             * Since we might be skipping a few new empty headers, it is
     964             * possible that we will omit this header from the dependencies
     965             * when using VCC. This might not be a problem, since it seems
     966             * we'll have to use the precompiler output to generate the deps
     967             * anyway.
    959968             */
    960969            const char *psz;
     
    962971            const char *pszFile1 = NULL;
    963972            unsigned    iLine1 = 0;
     973            unsigned    cCurlyBraces1 = 0;
    964974            const char *pszMismatch2;
    965975            const char *pszFile2 = NULL;
    966976            unsigned    iLine2 = 0;
     977            unsigned    cCurlyBraces2 = 0;
    967978
    968979            /* locate the difference. */
     
    10071018                            psz1 = pszEnd1;
    10081019                    }
     1020                    else if (*psz == '}')
     1021                    {
     1022                        do psz++;
     1023                        while (isspace(*psz) && *psz != '\n');
     1024                        if (*psz == '\n')
     1025                            iLine1++;
     1026                        else if (psz != pszEnd1)
     1027                            break;
     1028                        cCurlyBraces1++;
     1029                        psz1 = psz;
     1030                    }
    10091031                    else if (psz == pszEnd1)
    10101032                        psz1 = psz;
     
    10381060                            psz2 = pszEnd2;
    10391061                    }
     1062                    else if (*psz == '}')
     1063                    {
     1064                        do psz++;
     1065                        while (isspace(*psz) && *psz != '\n');
     1066                        if (*psz == '\n')
     1067                            iLine2++;
     1068                        else if (psz != pszEnd2)
     1069                            break;
     1070                        cCurlyBraces2++;
     1071                        psz2 = psz;
     1072                    }
    10401073                    else if (psz == pszEnd2)
    10411074                        psz2 = psz;
     
    10441077                }
    10451078            }
     1079
     1080            /* Match the number of ignored closing curly braces. */
     1081            if (cCurlyBraces1 != cCurlyBraces2)
     1082                return 0;
    10461083
    10471084            /* Reaching the end of any of them means the return statement can decide. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette