Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Enhance makeheaders so that it is able to deal with static_assert() statements. (These do not come up in Fossil itself. This check-in is in response to use of Makeheaders by external projects.) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8cecc544ce1dd191e1dc43efe04ba19c |
User & Date: | drh 2018-11-02 15:21:54.597 |
Context
2018-11-02
| ||
16:10 | Enhance the "fossil branch ls" command with two new options. The -t option sorts the branch list with the most recent branch first. The -r option reverses the sort order. ... (check-in: db2682dc user: drh tags: trunk) | |
15:21 | Enhance makeheaders so that it is able to deal with static_assert() statements. (These do not come up in Fossil itself. This check-in is in response to use of Makeheaders by external projects.) ... (check-in: 8cecc544 user: drh tags: trunk) | |
13:48 | Enhance the repository list page so that it shows the name of project for each repository, and so that the "Last Modified" time is based on the most recent event in the repository, not the repository file mtime. ... (check-in: cdea59dc user: drh tags: trunk) | |
Changes
Changes to src/makeheaders.c.
︙ | ︙ | |||
1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 | return 0; } pFirst = pFirst->pNext; } return 1; } /* ** This routine is called whenever we encounter a ";" or "=". The stuff ** between pFirst and pLast constitutes either a typedef or a global ** variable definition. Do the right thing. */ static int ProcessDecl(Token *pFirst, Token *pEnd, int flags){ | > > > > > > > > > > > > | 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 | return 0; } pFirst = pFirst->pNext; } return 1; } /* ** Return TRUE if pFirst is the first token of a static assert. */ static int isStaticAssert(Token *pFirst){ if( (pFirst->nText==13 && strncmp(pFirst->zText, "static_assert", 13)==0) || (pFirst->nText==14 && strncmp(pFirst->zText, "_Static_assert", 14)==0) ){ return 1; }else{ return 0; } } /* ** This routine is called whenever we encounter a ";" or "=". The stuff ** between pFirst and pLast constitutes either a typedef or a global ** variable definition. Do the right thing. */ static int ProcessDecl(Token *pFirst, Token *pEnd, int flags){ |
︙ | ︙ | |||
1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 | } if( pFirst==0 || !isLocal ){ return nErr; } }else if( flags & PS_Method ){ /* Methods are declared by their class. Don't declare separately. */ return nErr; } isVar = (flags & (PS_Typedef|PS_Method))==0 && isVariableDef(pFirst,pEnd); if( isVar && (flags & (PS_Interface|PS_Export|PS_Local))!=0 && (flags & PS_Extern)==0 ){ fprintf(stderr,"%s:%d: Can't define a variable in this context\n", zFilename, pFirst->nLine); nErr++; | > > | 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 | } if( pFirst==0 || !isLocal ){ return nErr; } }else if( flags & PS_Method ){ /* Methods are declared by their class. Don't declare separately. */ return nErr; }else if( isStaticAssert(pFirst) ){ return 0; } isVar = (flags & (PS_Typedef|PS_Method))==0 && isVariableDef(pFirst,pEnd); if( isVar && (flags & (PS_Interface|PS_Export|PS_Local))!=0 && (flags & PS_Extern)==0 ){ fprintf(stderr,"%s:%d: Can't define a variable in this context\n", zFilename, pFirst->nLine); nErr++; |
︙ | ︙ |