|
Packit Service |
60d1b5 |
/* Template to produce unique symbols.
|
|
Packit Service |
60d1b5 |
Copyright (C) 2019 Free Software Foundation, Inc.
|
|
Packit Service |
60d1b5 |
This file is part of the GNU C Library.
|
|
Packit Service |
60d1b5 |
|
|
Packit Service |
60d1b5 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
60d1b5 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
60d1b5 |
License as published by the Free Software Foundation; either
|
|
Packit Service |
60d1b5 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
60d1b5 |
|
|
Packit Service |
60d1b5 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
60d1b5 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
60d1b5 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
60d1b5 |
Lesser General Public License for more details.
|
|
Packit Service |
60d1b5 |
|
|
Packit Service |
60d1b5 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
60d1b5 |
License along with the GNU C Library; if not, see
|
|
Packit Service |
60d1b5 |
<https://www.gnu.org/licenses/>. */
|
|
Packit Service |
60d1b5 |
|
|
Packit Service |
60d1b5 |
/* This template produces a unique symbol definition for an explicit
|
|
Packit Service |
60d1b5 |
template instantiation (without also incorporating a reference),
|
|
Packit Service |
60d1b5 |
and an extern template declaration can be used to reference that
|
|
Packit Service |
60d1b5 |
symbol from another object. The modid parameter is just a
|
|
Packit Service |
60d1b5 |
placeholder to create different symbols (because it affects the
|
|
Packit Service |
60d1b5 |
name mangling of the static value member). By convention, it
|
|
Packit Service |
60d1b5 |
should match the number of the module that contains the
|
|
Packit Service |
60d1b5 |
definition. */
|
|
Packit Service |
60d1b5 |
|
|
Packit Service |
60d1b5 |
template <int modid>
|
|
Packit Service |
60d1b5 |
struct unique_symbol
|
|
Packit Service |
60d1b5 |
{
|
|
Packit Service |
60d1b5 |
static int value;
|
|
Packit Service |
60d1b5 |
};
|
|
Packit Service |
60d1b5 |
|
|
Packit Service |
60d1b5 |
template <int modid>
|
|
Packit Service |
60d1b5 |
int unique_symbol<modid>::value;
|