Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added IsLIBGAP constant #2527

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add IsLIBGAP constant to detect when GAP is run as a library
  • Loading branch information
Markus Pfeiffer authored and sebasguts committed Jun 7, 2018
commit f53d8b0f7bf54e792d91171d5b339a128caa5252
7 changes: 7 additions & 0 deletions src/gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,13 @@ static Int InitLibrary (
AssConstantGVar( GVarName( "IsHPCGAP" ), False );
#endif

#if defined(LIBGAP)
AssConstantGVar( GVarName( "IsLIBGAP" ), True );
#else
AssConstantGVar( GVarName( "IsLIBGAP" ), False );
#endif


/* return success */
return PostRestore( module );
}
Expand Down
11 changes: 11 additions & 0 deletions tst/testinstall/IsLIBGAP.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#############################################################################
##
#W IsLIBGAP.tst GAP library Sebastian Gutsche
##
##
#Y Copyright (C) 2018, GAP Group
##
gap> START_TEST("IsLIBGAP.tst");
gap> IsBound( IsLIBGAP );
true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh... this seems a bit excessive... but OK ... :-)

gap> STOP_TEST( "IsLIBGAP.tst", 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing a trailing newline