File: static_init.h

package info (click to toggle)
firefox 147.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,484 kB
  • sloc: cpp: 7,607,246; javascript: 6,533,185; ansic: 3,775,227; python: 1,415,393; xml: 634,561; asm: 438,951; java: 186,241; sh: 62,752; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (56 lines) | stat: -rw-r--r-- 1,996 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* Copyright 2025 Google Inc. All Rights Reserved.

   Distributed under MIT license.
   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/*
   Central point for static initialization.

   In case of "lazy" mode `BrotliXxxLazyStaticInit` is not provided by the
   library. Embedder is responsible for providing it. This function should call
   `BrotliXxxLazyStaticInitInner` on the first invocation. This function should
   not return until execution of `BrotliXxxLazyStaticInitInner` is finished.
   In C or before C++11 it is possible to call `BrotliXxxLazyStaticInitInner`
   on start-up path and then `BrotliEncoderLazyStaticInit` is could be no-op;
   another option is to use available thread execution controls to meet the
   requirements. For possible C++11 implementation see static_init_lazy.cc.
*/

#ifndef THIRD_PARTY_BROTLI_COMMON_STATIC_INIT_H_
#define THIRD_PARTY_BROTLI_COMMON_STATIC_INIT_H_

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

/* Static data is "initialized" in compile time. */
#define BROTLI_STATIC_INIT_NONE 0
/* Static data is initialized before "main". */
#define BROTLI_STATIC_INIT_EARLY 1
/* Static data is initialized when first encoder is created. */
#define BROTLI_STATIC_INIT_LAZY 2

#define BROTLI_STATIC_INIT_DEFAULT BROTLI_STATIC_INIT_NONE

#if !defined(BROTLI_STATIC_INIT)
#define BROTLI_STATIC_INIT BROTLI_STATIC_INIT_DEFAULT
#endif

#if (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_NONE) && \
    (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_EARLY) && \
    (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_LAZY)
#error Invalid value for BROTLI_STATIC_INIT
#endif

#if (BROTLI_STATIC_INIT == BROTLI_STATIC_INIT_EARLY)
#if defined(BROTLI_EXTERNAL_DICTIONARY_DATA)
#error BROTLI_STATIC_INIT_EARLY will fail with BROTLI_EXTERNAL_DICTIONARY_DATA
#endif
#endif  /* BROTLI_STATIC_INIT */

#if defined(__cplusplus) || defined(c_plusplus)
}  /* extern "C" */
#endif

#endif  // THIRD_PARTY_BROTLI_COMMON_STATIC_INIT_H_