summaryrefslogtreecommitdiff
path: root/src/libdisfluid/disfluid-init.h
blob: 2e78c4bd97e075e02bb93c1e938924c88731dc2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef DISFLUID_INIT_INCLUDED
# define DISFLUID_INIT_INCLUDED

static inline void ensure_init (void);

# include "relocatable.h"
# include "safe-alloc.h"

static inline void
ensure_init (void)
{
  static volatile int is_initialized = 0;
  if (!is_initialized)
    {
      char *relocated = NULL;
      const char *localedir = relocate2 (LOCALEDIR, &relocated);
      bindtextdomain (PACKAGE, localedir);
      FREE (relocated);
      is_initialized = 1;
    }
}

#endif /* DISFLUID_INIT_INCLUDED */