summaryrefslogtreecommitdiff
path: root/src/lib/cc
AgeCommit message (Collapse)Author
2019-11-07lib/cc: Define the standard C macro pasting trick in one place.Nick Mathewson
This file is a workaround for the issue that if you say `a ## b` to create a token that is the name of a macro, the C preprocessor won't expand that macro. So you can't say this: #define FOO__SQUARE(x) ((x)*(x)) #define FOO__CUBE(x) ((x)*(x)*(x)) #define FOO(func, x) FOO__##func(x) Instead, the standard C trick is to add a layer of indirection: #define PASTE(a,b) PASTE__(a,b) #define PASTE__(a,b) a ## b #define FOO__SQUARE(x) ((x)*(x)) #define FOO__CUBE(x) ((x)*(x)*(x)) #define FOO(func, x) PASTE(FOO__, func)(x) We should use this kind of trick sparingly, since it gets confusing.
2019-11-04Doxygen: Avoid ambiguity in @dir directivesNick Mathewson
This commit was automatically generated with: find src -name '*.dox' |xargs perl -i -pe 's{\@dir ([^/])}{\@dir /$1};'
2019-11-04doxygen: Take "lib" descriptions from doc/HACKING/design.Nick Mathewson
This commit takes descriptions for src/lib and moves them into our doxygen hierarchy. I've covered everything from lib/cc through lib/sandbox here.
2019-11-04Add stub directory-level documentation for most source directoriesNick Mathewson
This includes app, core, feature, lib, and tools, but excludes ext, test, and trunnel. This was generated by the following shell script: cd src for dname in $(find lib core feature app tools -type d |grep -v \\.deps$); do keyword="$(echo "$dname" |sed -e "s/\//_/" )" target="${dname}/${keyword}.dox" echo "$target" cat <<EOF >"$target" /** @dir ${dname} @brief ${dname} **/ EOF git add "$target" done
2019-10-22Merge branch 'ticket31705_v2' into ticket31705_v2_mergedNick Mathewson
Conflicts: src/feature/dirparse/authcert_parse.c src/feature/dirparse/ns_parse.c src/feature/hs/hs_service.c src/lib/conf/conftesting.h src/lib/log/log.h src/lib/thread/threads.h src/test/test_options.c These conflicts were mostly related to autostyle improvements, with one or two due to doxygen fixes.
2019-10-22ctassert.h: fix CTASSERT_DECL so coccinelle can parse it.Nick Mathewson
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-09-04compat_compiler: fix documentation for STRUCT_VAR_PNick Mathewson
Previously we had said that off_t was a reasonable type to hold the result of offsetof(). That isn't so: ptrdiff_t is correct.
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-02Add comments to include.am files to note where new sources goNick Mathewson
This mechanism isn't perfect, and sometimes it will guess wrong, but it will help our automation.
2019-03-26Merge branch 'messaging_v3' into messaging_v3_mergedNick Mathewson
2019-03-25Add a macro for the fairly common "eat next semicolon" syntax trickNick Mathewson
You use this when you're defining a macro to be used at file scope, and you want to require a semicolon afterwards.
2019-03-25Move sizeof check to torint.hrl1987
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-11-07simplify now that it uses tor's copyright and licenseRoger Dingledine
2018-11-07Switch ctassert.h to 3bsd (with permission)Nick Mathewson
2018-11-06Allow lib/cc to include its own files.Nick Mathewson
2018-11-06Change copyright statement (with permission)Nick Mathewson
2018-11-06Remove a tab.Nick Mathewson
2018-11-06Add parentheses to the ctassert macro expansionsNick Mathewson
2018-11-06New macro CTASSERT(condition) to assert condition at compile-time.Taylor R Campbell
To get it, use: #include "lib/cc/ctassert.h"
2018-07-31Add TOR_PRIdSZ to torint.hteor
2018-07-10File-level summary documentation for src/lib/*/*.[ch]Nick Mathewson
2018-07-03Retire U64_TO_DBL and DBL_TO_U64Nick Mathewson
These were necessary long ago to work around a bug in VC6.
2018-07-03Return U64_PRINTF_ARG and U64_FORMATNick Mathewson
The standard is printf("%"PRIu64, x);
2018-07-03Replace U64_LITERAL with the standard UINT64_CNick Mathewson
2018-07-03Retire some unused (or nearly unused) macros.Nick Mathewson
2018-07-03Use the standard SHRT_MAX name.Nick Mathewson
2018-07-03Require stdint.h and inttypes.hNick Mathewson
We've been silently requiring stdint.h for a while now, and nobody has complained. Closes ticket 26626.
2018-07-03Remove ATTR_NONNULL macrorl1987
2018-07-01File-level documentation for some of src/lib.Nick Mathewson
2018-06-29Move SUBTYPE_P into compat_compiler.hNick Mathewson
2018-06-22Move ARRAY_LENGTH to compiler_compat.hNick Mathewson
2018-06-22Move STRUCT_VAR_P to compat_compiler.Nick Mathewson
2018-06-21New script to check includes for modularity violationsNick Mathewson
Includes configuration files to enforce these rules on lib and common. Of course, "common" *is* a modularity violation right now, so these rules aren't as strict as I would like them to be.
2018-06-21Move more compiler-compatibility stuff into compat_compiler.hNick Mathewson
2018-06-21Move compiler-compatibility headers into their own moduleNick Mathewson
This one has no generated code.