/*
* Modified as part of the krb5-strength project as follows:
*
- * 2007-03-23 Russ Allbery <rra@stanford.edu>
+ * 2007-03-23 Russ Allbery <eagle@eyrie.org>
* - Add ANSI C prototypes and prototype additional functions.
- * 2009-10-14 Russ Allbery <rra@stanford.edu>
+ * 2009-10-14 Russ Allbery <eagle@eyrie.org>
* - Prototype changes for const cleanliness.
- * 2010-03-14 Russ Allbery <rra@stanford.edu>
+ * 2010-03-14 Russ Allbery <eagle@eyrie.org>
* - Fix int8, int16, and int32 definitions.
+ * 2013-10-01 Russ Allbery <eagle@eyrie.org>
+ * - Set hidden visibility on all symbols by default.
+ * 2020-05-16 Russ Allbery <eagle@eyrie.org>
+ * - Cast CRACK_TOLOWER and CRACK_TOUPPER to char.
*/
#include <config.h>
#define PW_WORDS(x) ((x)->header.pih_numwords)
#define PIH_MAGIC 0x70775631
+/* Default to a hidden visibility for all CrackLib functions. */
+#pragma GCC visibility push(hidden)
+
extern PWDICT *PWOpen(const char *, const char *);
extern int32 FindPW(PWDICT *, const char *);
extern int PutPW(PWDICT *, const char *);
extern char *Reverse(const char *);
extern char *Lowercase(const char *);
-#define CRACK_TOLOWER(a) (isupper(a)?tolower(a):(a))
-#define CRACK_TOUPPER(a) (islower(a)?toupper(a):(a))
+/* Undo default visibility change. */
+#pragma GCC visibility pop
+
+#define CRACK_TOLOWER(a) ((char)(isupper(a)?tolower(a):(a)))
+#define CRACK_TOUPPER(a) ((char)(islower(a)?toupper(a):(a)))
#define STRCMP(a,b) strcmp((a),(b))