Fix bugs in portability code; libpam now builds on NetBSD 1.5.2.

Sponsored by:	DARPA, NAI Labs


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@104 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2002-04-06 19:02:06 +00:00
parent b9591f18fd
commit b2b11d5483
1 changed files with 17 additions and 8 deletions

View File

@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $P4: //depot/projects/openpam/include/security/openpam.h#13 $ * $P4: //depot/projects/openpam/include/security/openpam.h#14 $
*/ */
#ifndef _SECURITY_OPENPAM_H_INCLUDED #ifndef _SECURITY_OPENPAM_H_INCLUDED
@ -117,19 +117,26 @@ enum {
/* /*
* Log to syslog * Log to syslog
*/ */
void _openpam_log(int _level, void
_openpam_log(int _level,
const char *_func, const char *_func,
const char *_fmt, const char *_fmt,
...); ...);
#if defined(__STDC__) && (__STDC_VERSION__ > 199901L) #if defined(__STDC__) && (__STDC_VERSION__ >= 199901L)
#define openpam_log(lvl, fmt, ...) \ #define openpam_log(lvl, fmt, ...) \
_openpam_log((lvl), __func__, fmt, __VA_ARGS__) _openpam_log((lvl), __func__, fmt, __VA_ARGS__)
#elif defined(__GNUC__) #elif defined(__GNUC__) && (__GNUC__ >= 2) && (__GNUC_MINOR__ >= 95)
#define openpam_log(lvl, fmt, ...) \
_openpam_log((lvl), __func__, fmt, ##fmt)
#elif defined(__GNUC__) && defined(__FUNCTION__)
#define openpam_log(lvl, fmt...) \ #define openpam_log(lvl, fmt...) \
_openpam_log((lvl), __func__, ##fmt) _openpam_log((lvl), __FUNCTION__, ##fmt)
#else #else
extern openpam_log(int _level, const char *_format, ...); void
openpam_log(int _level,
const char *_format,
...);
#endif #endif
/* /*
@ -190,12 +197,14 @@ struct pam_module {
* Infrastructure for static modules using GCC linker sets. * Infrastructure for static modules using GCC linker sets.
* You are not expected to understand this. * You are not expected to understand this.
*/ */
#if defined(__GNUC__) && !defined(__PIC__)
#if defined(__FreeBSD__) #if defined(__FreeBSD__)
#define PAM_SOEXT ".so" #define PAM_SOEXT ".so"
#else #else
#error Static linking is not supported on your platform #ifndef NO_STATIC_MODULES
#define NO_STATIC_MODULES
#endif #endif
#endif
#if defined(__GNUC__) && !defined(__PIC__) && !defined(NO_STATIC_MODULES)
/* gcc, static linking */ /* gcc, static linking */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <linker_set.h> #include <linker_set.h>