Skip to content

Commit

Permalink
proc_macro: Add is_available function
Browse files Browse the repository at this point in the history
Add is_available function to the C++ library.

ChangeLog:

	* libgrust/libproc_macro/proc_macro.cc (bridge_is_available):
	Add bridge function.
	* libgrust/libproc_macro/proc_macro.h (bridge_is_available):
	Likewise.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
  • Loading branch information
P-E-P committed Jul 26, 2023
1 parent 646355c commit 2755e6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libgrust/libproc_macro/proc_macro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Procmacro::make_bang (const char *name, BangMacro macro)
return {BANG, payload};
}

extern "C" bool
bridge_is_available ()
{
return __gccrs_proc_macro_is_available_fn ();
}

bool
not_available ()
{
Expand Down
3 changes: 3 additions & 0 deletions libgrust/libproc_macro/proc_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ struct ProcmacroArray
bool
not_available ();

extern "C" bool
bridge_is_available ();

} // namespace ProcMacro

#endif /* ! PROC_MACRO_H */

0 comments on commit 2755e6a

Please sign in to comment.