mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
change libcalc dynamic library to link with libcustcalc
Under macOS, to reduce dependency chains, we remove functions and data that are unreachable by the entry point or exported symbols. In particular, the macOS linker is used with both "-dead_strip" and "-dead_strip_dylibs". The libcalc shared library is now linked with libcustcalc.
This commit is contained in:
@@ -25,17 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* ISO C requires a translation unit to contain at least one declaration,
|
||||
* so we declare a global variable whose value is based on if CUSTOM is defined.
|
||||
*/
|
||||
#if defined(CUSTOM)
|
||||
int custtbl_allowed = 1; /* CUSTOM defined */
|
||||
#else /* CUSTOM */
|
||||
int custtbl_allowed = 0; /* CUSTOM undefined */
|
||||
#endif /* CUSTOM */
|
||||
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../have_const.h"
|
||||
@@ -46,6 +35,24 @@ int custtbl_allowed = 0; /* CUSTOM undefined */
|
||||
#include "../banned.h" /* include after system header <> includes */
|
||||
|
||||
|
||||
/*
|
||||
* custom_compiled - determine if custom functions are compiled into libcustcalc
|
||||
*
|
||||
* returns:
|
||||
s* 1 ==> libcustcalc was compiled with CUSTOM defined
|
||||
* 0 ==> libcustcalc was compiled with CUSTOM undefined
|
||||
*/
|
||||
E_FUNC int
|
||||
custom_compiled(void)
|
||||
{
|
||||
#if defined(CUSTOM)
|
||||
return 1;
|
||||
#else /* CUSTOM */
|
||||
return 0;
|
||||
#endif /* CUSTOM */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: See the file HOW_TO_ADD for instructions on how to add custom functions.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user