localize.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* localize.h (i18n/l10n) */
  2. /* $OpenLDAP$ */
  3. /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  4. *
  5. * Copyright 1998-2022 The OpenLDAP Foundation.
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted only as authorized by the OpenLDAP
  10. * Public License.
  11. *
  12. * A copy of this license is available in file LICENSE in the
  13. * top-level directory of the distribution or, alternatively, at
  14. * <http://www.OpenLDAP.org/license.html>.
  15. */
  16. #ifndef _AC_LOCALIZE_H
  17. #define _AC_LOCALIZE_H
  18. #ifdef LDAP_LOCALIZE
  19. # include <locale.h>
  20. # include <libintl.h>
  21. /* enable i18n/l10n */
  22. # define gettext_noop(s) s
  23. # define _(s) gettext(s)
  24. # define N_(s) gettext_noop(s)
  25. # define ldap_pvt_setlocale(c,l) ((void) setlocale(c, l))
  26. # define ldap_pvt_textdomain(d) ((void) textdomain(d))
  27. # define ldap_pvt_bindtextdomain(p,d) ((void) bindtextdomain(p, d))
  28. #else
  29. /* disable i18n/l10n */
  30. # define _(s) s
  31. # define N_(s) s
  32. # define ldap_pvt_setlocale(c,l) ((void) 0)
  33. # define ldap_pvt_textdomain(d) ((void) 0)
  34. # define ldap_pvt_bindtextdomain(p,d) ((void) 0)
  35. #endif
  36. #endif /* _AC_LOCALIZE_H */