moved gettext defines away from header file

This commit is contained in:
Tim Ruehsen 2014-04-02 10:26:40 +02:00
parent 65a1f03939
commit 9d18b46ed9
2 changed files with 24 additions and 16 deletions

View File

@ -34,24 +34,10 @@
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
// Let C++ include C headers
#ifdef __cplusplus #ifdef __cplusplus
# define PSL_BEGIN_DECLS extern "C" { extern "C" {
# define PSL_END_DECLS }
#else
# define PSL_BEGIN_DECLS
# define PSL_END_DECLS
#endif #endif
#if ENABLE_NLS != 0
# include <libintl.h>
# define _(STRING) gettext(STRING)
#else
# define _(STRING) STRING
# define ngettext(STRING1,STRING2,N) STRING2
#endif
PSL_BEGIN_DECLS
typedef struct _psl_ctx_st psl_ctx_t; typedef struct _psl_ctx_st psl_ctx_t;
@ -88,6 +74,8 @@ const char *
psl_builtin_sha1sum(void); psl_builtin_sha1sum(void);
PSL_END_DECLS #ifdef __cplusplus
}
#endif
#endif /* _LIBPSL_LIBPSL_H */ #endif /* _LIBPSL_LIBPSL_H */

View File

@ -37,6 +37,14 @@
# include <config.h> # include <config.h>
#endif #endif
#if ENABLE_NLS != 0
# include <libintl.h>
# define _(STRING) gettext(STRING)
#else
# define _(STRING) STRING
# define ngettext(STRING1,STRING2,N) STRING2
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -44,6 +52,17 @@
#include <libpsl.h> #include <libpsl.h>
/**
* SECTION:libpsl
* @short_description: Public Suffix List library functions
* @title: libpsl
* @stability: unstable
* @include: libpsl.h
*
* Public Suffix List library functions.
*
*/
#define countof(a) (sizeof(a)/sizeof(*(a))) #define countof(a) (sizeof(a)/sizeof(*(a)))
typedef struct { typedef struct {
@ -75,6 +94,7 @@ struct _psl_ctx_st {
*suffix_exceptions; *suffix_exceptions;
}; };
// include the PSL data compiled by 'psl2c'
#include "suffixes.c" #include "suffixes.c"
// references to this PSL will result in lookups to built-in data // references to this PSL will result in lookups to built-in data