Skip to content

Commit 9718010

Browse files
committed
add comment for __tb_typeref__
1 parent e20b121 commit 9718010

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/tbox/prefix/keyword.h

+22-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,28 @@
215215
# define __tb_no_sanitize_address__
216216
#endif
217217

218-
// the object reference type, .e.g tb_xxx_ref_t
218+
/*! the type reference keyword for defining tb_xxxx_ref_t
219+
*
220+
* typedef __tb_typeref__(xxxx);
221+
*
222+
*
223+
* suppress gcc 4.9 on c++ codes warning: '__tb_yyyy_t' has a field '__tb_yyyy_t::xxxx' whose type uses the anonymous namespace
224+
*
225+
* @code
226+
*
227+
typedef struct{}* tb_xxxx_ref_t;
228+
229+
typedef struct __tb_yyyy_t
230+
{
231+
tb_xxxx_ref_t xxxx;
232+
233+
}__tb_yyyy_t;
234+
235+
*
236+
*
237+
* @endcode
238+
*
239+
*/
219240
#define __tb_typeref__(object) struct __tb_##object##_dummy_t{tb_int_t dummy;}* tb_##object##_ref_t
220241

221242
// macros

0 commit comments

Comments
 (0)