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