first commit

This commit is contained in:
2024-06-10 12:48:14 +03:00
commit d54c9805b3
1398 changed files with 739400 additions and 0 deletions

55
thirdparty/ode-0.16.5/ou/CHANGELOG.TXT vendored Normal file
View File

@@ -0,0 +1,55 @@
=======================
Legend
=======================
[+] A feature added
[-] A bug fixed
[*] A change
[!] An important note
=======================
2015/12/28 oleh_derevenko
[*] Atomics assembler implementation has been improved and enabled for
GCC and _OU_TARGET_ARCH_X86/_OU_TARGET_ARCH_X64 with _OU_TARGET_OS_GENUNIX
2010/04/24 oleh_derevenko
[+] A cast operator to non-const reference of contained type added for
CTypeSimpleWrapper.
2009/10/07 oleh_derevenko
[-] Tests corrected to avoid checking int64ou alignment on Macs
(just like for uint64ou)
2009/09/08 oleh_derevenko
[-] Enumerated type increment/decrement operators re-implemented in a way that
can't produce bad code with modern GCCs due to aliasing rules violation.
2008/06/26 oleh_derevenko
[+] --disable-asserts option support added for configure.
2008/04/19 oleh_derevenko
[+] Atomic functions via i486 assembler implementation added (manuall
selection with a preprocessor symbol only).
2008/04/16 oleh_derevenko
[-] Fixed bug with storage memory not being properly zeroed at allocation.
[*] Memory customization changed to match assertion failure handler
customization. Now it is not necessary to save original pointers,
just NULL-s are to be assigned to revert from customized to
default memory menager.
2008/04/08 oleh_derevenko
[!] Licensing changed: permission to distribute/use library under zlib/libpng
license added.
2008/04/07 oleh_derevenko
[+] Initial commit

14
thirdparty/ode-0.16.5/ou/INSTALL.TXT vendored Normal file
View File

@@ -0,0 +1,14 @@
Currently OU provides project files for Visual Studio 6, Visual Studio 2005
and makefile for GCC. These are located in "build" directory.
Makefile is quite simple and may not work on some platforms. Makefile does not
have "clean" targets and does not track header changes. Further in this file
you can find how to delete build output files to re-run a clean build.
There is also a test project file in "test" directory that covers all the
library functionality and allows to make sure everything is fine on
a particular platform.
All the intermediate files are generated in "intermediate" directory.
Library output files are placed in "lib" directory.
Test binary is placed in "bin" directory.
Having these three folders deleted you can return to initial state.

View File

@@ -0,0 +1,34 @@
This is the BSD-style license for the ODER's Utilities Library
--------------------------------------------------------------
ODER's Utilities Library
Copyright (c) 2008, Oleh Derevenko.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the names of ODER's Utilities' copyright owner nor the names of
its contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,166 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -0,0 +1,22 @@
The zlib/libpng License for the ODER's Utilities Library
Copyright (c) 2008 Oleh Derevenko
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.

675
thirdparty/ode-0.16.5/ou/LICENSE.TXT vendored Normal file
View File

@@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

10
thirdparty/ode-0.16.5/ou/Makefile.am vendored Normal file
View File

@@ -0,0 +1,10 @@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = bootstrap \
CHANGELOG.TXT INSTALL.TXT \
LICENSE.TXT LICENSE-BSD.TXT LICENSE-LESSER.TXT LICENSE-ZLIB.TXT \
README.TXT \
build
SUBDIRS = include/ou src/ou test

804
thirdparty/ode-0.16.5/ou/Makefile.in vendored Normal file
View File

@@ -0,0 +1,804 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/../compile \
$(top_srcdir)/../config.guess $(top_srcdir)/../config.sub \
$(top_srcdir)/../install-sh $(top_srcdir)/../ltmain.sh \
$(top_srcdir)/../missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
OU_FEATURE_SET = @OU_FEATURE_SET@
OU_NAMESPACE = @OU_NAMESPACE@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = bootstrap \
CHANGELOG.TXT INSTALL.TXT \
LICENSE.TXT LICENSE-BSD.TXT LICENSE-LESSER.TXT LICENSE-ZLIB.TXT \
README.TXT \
build
SUBDIRS = include/ou src/ou test
all: all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-generic \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

42
thirdparty/ode-0.16.5/ou/README.TXT vendored Normal file
View File

@@ -0,0 +1,42 @@
ODER's Utilities Library (OU), Copyright (C) 2008 Oleh Derevenko,
E-mail: odar@eleks.com (change all "a" to "e").
-------------------------------------------------------------------------
OU is a free multi-platform library that provides basic API for
atomic (interlocked) operations and thread local storage. It also
implements assertion checking macros, classes for flags manipulations
(both with ordinary and atomic access), templates for enumerated
values decoding/encoding by static arrays, and some more useful macros
and templates. Most of the library is implemented as inlined code.
Library allows customization of assertion failure handlers and memory
management functions. It is possible to link OU more than once into
a single binary as parts of other libraries.
This library is free software; you can redistribute it and/or
modify it under the terms of EITHER:
(1) The GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at
your option) any later version. The text of the GNU Lesser
General Public License is included with this library in the
file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL
the text of GNU General Public License is also provided for
your information in file LICENSE.TXT.
(2) The BSD-style license that is included with this library in
the file LICENSE-BSD.TXT.
(3) The zlib/libpng license that is included with this library in
the file LICENSE-ZLIB.TXT
This library is distributed WITHOUT ANY WARRANTY, including implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT
or LICENSE-ZLIB.TXT for more details.
* Installation instructions are in the INSTALL.TXT file
All contributions are copyright by their owners, but the owners
automatically transfer unrestricted rights in those changes to the OU
project, which is released under the threefold licenses as indicated.
The owners can also use the contributions in other projects under other
licenses if they want (including sell them), but they can't prevent
anyone from releasing the contributions under the threefold OU licenses
as part of an OU release.

10200
thirdparty/ode-0.16.5/ou/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

11
thirdparty/ode-0.16.5/ou/bootstrap vendored Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
aclocal || exit 1
# on Mac libtoolize is called glibtoolize
LIBTOOLIZE=libtoolize
if [ `uname -s` = Darwin ]; then
LIBTOOLIZE=glibtoolize
fi
$LIBTOOLIZE --automake -c || exit 1
autoconf -f || exit 1
automake -a -c --foreign || exit 1

View File

@@ -0,0 +1,219 @@
PRODUCTNAME = ou
MODE ?= DEVELOP
BITS ?= 32
include makefile.os
CXX = gcc
AR = ar
LD = gcc
CXXFLAGS = -fno-exceptions -fno-rtti -Wall -g
ARFLAGS = -r
LDFLAGS = -fno-exceptions -fno-rtti -g
ifeq ($(OS_PLATFORM), i386)
ifneq ($(BITS), 64)
CXXFLAGS += -malign-double
endif
endif
ifeq ($(MODE), DEBUG)
CXXFLAGS += -D_DEBUG
CXXFLAGS += -O0
else
ifeq ($(MODE), RELEASE)
CXXFLAGS += -DNDEBUG
CXXFLAGS += -O3 -funroll-loops
else
CXXFLAGS += -O2
endif
endif
ifeq ($(BITS), 64)
CXXFLAGS += -m64
LDFLAGS += -m64
else
CXXFLAGS += -m32
LDFLAGS += -m32
endif
SRCEXT=.cpp
OBJEXT=$(OS_OBJ_EXT)
OUTNAME := $(PRODUCTNAME)
OUTDIR = ../../lib/
OUTEXT=$(OS_LIB_EXT)
TESTNAME := $(PRODUCTNAME)test
TESTDIR = ../../bin/
TESTEXT=$(OS_EXE_EXT)
REFINEDCXX = $(notdir $(CXX))
OUTINTDIR := ../../intermediate/$(REFINEDCXX)/
TESTINTDIR := ../../intermediate/$(REFINEDCXX)_$(TESTNAME)/
ifeq ($(MODE), DEBUG)
OUTINTDIR := $(OUTINTDIR)debug
TESTINTDIR := $(TESTINTDIR)debug
else
ifeq ($(MODE), RELEASE)
OUTINTDIR := $(OUTINTDIR)release
TESTINTDIR := $(TESTINTDIR)release
else
OUTINTDIR := $(OUTINTDIR)develop
TESTINTDIR := $(TESTINTDIR)develop
endif
endif
ifeq ($(BITS), 64)
OUTINTDIR := $(OUTINTDIR)64
TESTINTDIR := $(TESTINTDIR)64
OUTNAME := $(OUTNAME)64
TESTNAME := $(TESTNAME)64
endif
ifeq ($(MODE), DEBUG)
OUTNAME := $(OUTNAME)_debug
TESTNAME := $(TESTNAME)_debug
endif
ifeq ($(MODE), RELEASE)
OUTNAME := $(OUTNAME)_release
TESTNAME := $(TESTNAME)_release
endif
OUTINTDIR := $(OUTINTDIR)/
TESTINTDIR := $(TESTINTDIR)/
OUTPATH = $(OUTDIR)$(OS_LIB_PRE)$(OUTNAME)$(OUTEXT)
TESTPATH = $(TESTDIR)$(TESTNAME)$(TESTEXT)
ININCDIR = ../../include
INDIR = ../../src/ou/
INFILES = \
atomic \
customization \
malloc \
threadlocalstorage
INOBJS = $(addprefix $(OUTINTDIR), $(addsuffix $(OBJEXT), $(INFILES)))
TESTINCDIR = $(ININCDIR)
TESTLIBDIR = $(OUTDIR)
TESTLIBS = $(OUTNAME)
TESTSRCDIR = ../../test/
ifeq ($(OS_TYPE), Linux)
TESTLIBS += pthread
endif
ifeq ($(OS_TYPE), SUN)
TESTLIBS += pthread c
endif
TESTFILES = outest
TESTOBJS = $(addprefix $(TESTINTDIR), $(addsuffix $(OBJEXT), $(TESTFILES)))
.PHONY: develop debug release develop64 debug64 release64 all ou
all: develop
develop:
$(MAKE) ou MODE=DEVELOP BITS=32
debug:
$(MAKE) ou MODE=DEBUG BITS=32
release:
$(MAKE) ou MODE=RELEASE BITS=32
develop64:
$(MAKE) ou MODE=DEVELOP BITS=64
debug64:
$(MAKE) ou MODE=DEBUG BITS=64
release64:
$(MAKE) ou MODE=RELEASE BITS=64
ou: $(OUTPATH) $(TESTPATH)
.PHONY: mkoutintpath mkoutpath mktestintpath mktestpath
$(OUTPATH): mkoutintpath mkoutpath $(INOBJS)
$(OS_VP)echo BUILDING $(notdir $(OUTPATH))...
$(OS_VP)$(AR) $(ARFLAGS) $(OUTPATH) $(INOBJS)
$(TESTPATH): mktestintpath mktestpath $(OUTPATH) $(TESTOBJS)
$(OS_VP)echo LINKING $(notdir $(TESTPATH))...
$(OS_VP)$(LD) $(LDFLAGS) $(LDADDFLAGS) -o $(TESTPATH) \
$(addprefix -I, $(TESTINCDIR) $(OS_INCLUDE_PATH)) \
$(addprefix -L, $(TESTLIBDIR) $(OS_LIB_PATH)) \
$(TESTOBJS) \
$(addprefix -l, $(TESTLIBS))
$(OUTINTDIR)%$(OBJEXT): $(INDIR)%$(SRCEXT)
$(OS_VP)echo Compiling $(notdir $@)...
$(OS_VP)$(CXX) $(CXXFLAGS) $(CXXADDFLAGS) -c -o $@ \
$(addprefix -I, $(ININCDIR) $(OS_INCLUDE_PATH)) \
$<
$(TESTINTDIR)%$(OBJEXT): $(TESTSRCDIR)%$(SRCEXT)
$(OS_VP)echo Compiling $(notdir $@)...
$(OS_VP)$(CXX) $(CXXFLAGS) $(CXXADDFLAGS) -c -o $@ \
$(addprefix -I, $(TESTINCDIR) $(OS_INCLUDE_PATH)) \
$<
mkoutintpath:
$(call FN_MKDIR, $(OUTINTDIR))
mktestintpath:
$(call FN_MKDIR, $(TESTINTDIR))
mkoutpath:
$(call FN_MKDIR, $(OUTDIR))
mktestpath:
$(call FN_MKDIR, $(TESTDIR))
.PHONY: runtest
runtest: $(TESTPATH)
$(TESTPATH)

View File

@@ -0,0 +1,41 @@
ifeq ($(OS), Windows_NT)
OS_TYPE = WIN32
OS_PLATFORM := i386
OS_OBJ_EXT = .obj
OS_LIB_EXT = .lib
OS_LIB_PRE =
OS_EXE_EXT = .exe
FN_CONVERT_PATH = $(subst /,\,$(subst //,/,$(1)))
FN_RM = $(OS_VP)erase "$(strip $(call FN_CONVERT_PATH, $(1)))"
FN_MKDIR = $(OS_VP)if NOT EXIST "$(strip $(call FN_CONVERT_PATH, $(1)))" mkdir "$(strip $(call FN_CONVERT_PATH, $(1)))"
OS_INCLUDE_PATH = $(GCC_PATH)/include $(GCC_PATH)/include/win32
OS_LIB_PATH += $(GCC_PATH)/lib $(GCC_PATH)/lib/win32
OS_VP=@
else
OS_OBJ_EXT = .o
OS_LIB_EXT = .a
OS_LIB_PRE = lib
OS_EXE_EXT =
OS_TYPE = $(subst SunOS,SUN,$(shell uname))
OS_PLATFORM := $(shell uname -p)
OS_PLATFORM := $(subst x86_64,i386,$(OS_PLATFORM))
OS_PLATFORM := $(subst i586,i386,$(OS_PLATFORM))
OS_PLATFORM := $(subst i686,i386,$(OS_PLATFORM))
FN_RM = $(OS_VP)rm -rf $(1)
FN_MKDIR = $(OS_VP)test -d $(1) || mkdir -p $(patsubst %/,%,$(1))
OS_INCLUDE_PATH = /include /usr/include
OS_LIB_PATH = /lib /usr/lib
OS_VP=@
endif

View File

@@ -0,0 +1,39 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ou", "ou.vcproj", "{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "outest", "..\..\test\vs2005\outest.vcproj", "{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}"
ProjectSection(ProjectDependencies) = postProject
{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7} = {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Debug|Win32.ActiveCfg = Debug|Win32
{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Debug|Win32.Build.0 = Debug|Win32
{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Debug|x64.ActiveCfg = Debug|x64
{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Debug|x64.Build.0 = Debug|x64
{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Release|Win32.ActiveCfg = Release|Win32
{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Release|Win32.Build.0 = Release|Win32
{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Release|x64.ActiveCfg = Release|x64
{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Release|x64.Build.0 = Release|x64
{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Debug|Win32.ActiveCfg = Debug|Win32
{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Debug|Win32.Build.0 = Debug|Win32
{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Debug|x64.ActiveCfg = Debug|x64
{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Debug|x64.Build.0 = Debug|x64
{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Release|Win32.ActiveCfg = Release|Win32
{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Release|Win32.Build.0 = Release|Win32
{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Release|x64.ActiveCfg = Release|x64
{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,494 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="ou"
ProjectGUID="{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}"
RootNamespace="ou"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\..\..\lib"
IntermediateDirectory=".\..\..\intermediate\vs2005\Debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
ExceptionHandling="0"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
BufferSecurityCheck="false"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
CallingConvention="2"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1058"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\$(ProjectName)_debug.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="..\..\lib"
IntermediateDirectory=".\..\..\intermediate\vs2005\Debug64"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
ExceptionHandling="0"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
BufferSecurityCheck="false"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
CallingConvention="2"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1058"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\$(ProjectName)64_debug.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\..\..\lib"
IntermediateDirectory=".\..\..\intermediate\vs2005\Release"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="3"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
CallingConvention="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1058"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory=".\..\..\lib"
IntermediateDirectory=".\..\..\intermediate\vs2005\Release64"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="3"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
CallingConvention="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1058"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\$(ProjectName)64.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\src\ou\atomic.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\ou\customization.cpp"
>
</File>
<File
RelativePath="..\..\src\ou\malloc.cpp"
>
</File>
<File
RelativePath="..\..\src\ou\threadlocalstorage.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\include\ou\assert.h"
>
</File>
<File
RelativePath="..\..\include\ou\atomic.h"
>
</File>
<File
RelativePath="..\..\include\ou\atomicflags.h"
>
</File>
<File
RelativePath="..\..\include\ou\customization.h"
>
</File>
<File
RelativePath="..\..\include\ou\enumarrays.h"
>
</File>
<File
RelativePath="..\..\include\ou\flags.h"
>
</File>
<File
RelativePath="..\..\include\ou\flagsdefines.h"
>
</File>
<File
RelativePath="..\..\include\ou\inttypes.h"
>
</File>
<File
RelativePath="..\..\include\ou\macros.h"
>
</File>
<File
RelativePath="..\..\include\ou\malloc.h"
>
</File>
<File
RelativePath="..\..\include\ou\namespace.h"
>
</File>
<File
RelativePath="..\..\include\ou\platform.h"
>
</File>
<File
RelativePath="..\..\include\ou\simpleflags.h"
>
</File>
<File
RelativePath="..\..\include\ou\templates.h"
>
</File>
<File
RelativePath="..\..\include\ou\threadlocalstorage.h"
>
</File>
<File
RelativePath="..\..\include\ou\typewrapper.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,172 @@
# Microsoft Developer Studio Project File - Name="ou" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=ou - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "ou.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "ou.mak" CFG="ou - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ou - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "ou - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "ou - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "..\..\intermediate\vs6\Release"
# PROP Intermediate_Dir "..\..\intermediate\vs6\Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /Gr /MD /W3 /Zi /O2 /Ob2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x422 /d "NDEBUG"
# ADD RSC /l 0x422 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\lib\ou.lib"
!ELSEIF "$(CFG)" == "ou - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "..\..\intermediate\vs6\Debug"
# PROP Intermediate_Dir "..\..\intermediate\vs6\Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /Gz /MDd /W3 /Gm /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x422 /d "_DEBUG"
# ADD RSC /l 0x422 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\lib\ou_debug.lib"
!ENDIF
# Begin Target
# Name "ou - Win32 Release"
# Name "ou - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ou\atomic.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\ou\customization.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\ou\malloc.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\ou\threadlocalstorage.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ou\assert.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\atomic.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\atomicflags.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\customization.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\enumarrays.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\flags.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\flagsdefines.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\inttypes.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\macros.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\malloc.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\namespace.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\platform.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\simpleflags.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\templates.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\threadlocalstorage.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ou\typewrapper.h
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "ou"=.\ou.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "outest"=..\..\test\vs6\outest.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name ou
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

20569
thirdparty/ode-0.16.5/ou/configure vendored Normal file

File diff suppressed because it is too large Load Diff

145
thirdparty/ode-0.16.5/ou/configure.ac vendored Normal file
View File

@@ -0,0 +1,145 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(ou, 0, oleh_derevenko@users.sourceforge.net)
AC_CONFIG_SRCDIR([src/ou/atomic.cpp])
# AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE(foreign)
AC_LANG([C++])
AC_MSG_CHECKING([target OS])
case "$host_os" in
cygwin* | mingw*)
targetos=_OU_TARGET_OS_WINDOWS
CXXFLAGS="-mthreads $CXXFLAGS"
AC_MSG_RESULT([win32])
;;
*qnx*)
targetos=_OU_TARGET_OS_QNX
AC_MSG_RESULT([qnx])
;;
*apple* | *darwin*)
targetos=_OU_TARGET_OS_MAC
AC_MSG_RESULT([darwin])
;;
*sunos*)
targetos=_OU_TARGET_OS_SUNOS
AC_MSG_RESULT([sunos])
;;
*aix*)
targetos=_OU_TARGET_OS_AIX
AC_MSG_RESULT([aix])
;;
*)
targetos=_OU_TARGET_OS_GENUNIX
AC_MSG_RESULT([unix])
;;
esac
#echo "host OS name: $host_os"
#TODO: _OU_TARGET_BITS ?
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_CPP
AC_PROG_MKDIR_P
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
# Checks for libraries.
AC_CHECK_LIB([c], main) # needed for sunos?
AC_CHECK_LIB([pthread], [main])
AC_DEFINE(_REENTRANT,1,[enable thread-safe functions])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([inttypes.h malloc.h stddef.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_C_VOLATILE
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_CHECK_FUNCS([memset])
if test $targetos = _OU_TARGET_OS_MAC
then
MAC_OS_X_VERSION=1000
AC_CHECK_FUNC([OSAtomicAdd32Barrier], [MAC_OS_X_VERSION=1040])
AC_CHECK_FUNC([OSAtomicAnd32OrigBarrier], [MAC_OS_X_VERSION=1050])
AC_DEFINE_UNQUOTED(MAC_OS_X_VERSION, $MAC_OS_X_VERSION, [Mac OS X version])
fi
if test $targetos = _OU_TARGET_OS_SUNOS
then
AC_CHECK_FUNC(atomic_inc_32_nv, [],
[targetos=_OU_TARGET_OS_GENUNIX])
fi
AC_DEFINE_UNQUOTED(_OU_TARGET_OS, $targetos)
AC_ARG_VAR([OU_NAMESPACE], [which namespace OU will be compiled in])
AC_ARG_WITH([namespace],
AC_HELP_STRING([--with-namespace=name],[sets the namespace for compiled code]),
[OU_NAMESPACE=$withval])
if test x$OU_NAMESPACE = xno -o x$OU_NAMESPACE = x
then
OU_NAMESPACE="ou"
fi
CPPFLAGS="$CPPFLAGS -D_OU_NAMESPACE=$OU_NAMESPACE"
AC_ARG_VAR([OU_FEATURE_SET], [feature set to be compiled within the OU])
AC_ARG_WITH([feature-set],
AC_HELP_STRING([--feature-set=_OU_FEATURE_SET_BASICS|_OU_FEATURE_SET_ATOMICS|_OU_FEATURE_SET_TLS|_OU_FEATURE_SET__MAX],[sets the feature set to be enabled]),
[OU_FEATURE_SET=$withval])
if test x$OU_FEATURE_SET = xno -o x$OU_FEATURE_SET = x
then
OU_NAMESPACE=_OU_FEATURE_SET__MAX
fi
CPPFLAGS="$CPPFLAGS -D_OU_FEATURE_SET=$OU_FEATURE_SET"
AC_ARG_ENABLE([asserts],
AS_HELP_STRING([--disable-asserts],
[disables debug error checking]),
asserts=$enableval,asserts=yes)
if test x$asserts = xno
then
CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi
AC_CONFIG_FILES([Makefile
include/ou/Makefile
src/ou/Makefile
test/Makefile])
AC_OUTPUT
echo "OU namespace: $OU_NAMESPACE"
echo "OU feature set: $OU_FEATURE_SET"

View File

@@ -0,0 +1,17 @@
EXTRA_DIST = assert.h \
atomicflags.h \
atomic.h \
customization.h \
enumarrays.h \
features.h \
flagsdefines.h \
flags.h \
inttypes.h \
macros.h \
malloc.h \
namespace.h \
platform.h \
simpleflags.h \
templates.h \
threadlocalstorage.h \
typewrapper.h

View File

@@ -0,0 +1,457 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include/ou
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
OU_FEATURE_SET = @OU_FEATURE_SET@
OU_NAMESPACE = @OU_NAMESPACE@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = assert.h \
atomicflags.h \
atomic.h \
customization.h \
enumarrays.h \
features.h \
flagsdefines.h \
flags.h \
inttypes.h \
macros.h \
malloc.h \
namespace.h \
platform.h \
simpleflags.h \
templates.h \
threadlocalstorage.h \
typewrapper.h
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/ou/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign include/ou/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,188 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_ASSERT_H_INCLUDED
#define __OU_ASSERT_H_INCLUDED
/**
* \file
* \brief Definitions of assertion checking macros.
*
* This file contains definitions of assertion failure check macros.
* These include \c OU_ASSERT, \c OU_VERIFY and \c OU_CHECK.
* Assertion failure handler is common for all three macros and is customizable.
* If assertion checks are not customized, system \c assert() function is used.
* \see CAssertionCheckCustomization
*/
#include <ou/customization.h>
#include <ou/namespace.h>
/**
* \def OU_ASSERT
* \brief Defines a regular assertion check macro.
*
* \c OU_ASSERT defines a classic assertion check macro. Normally its expression
* is evaluated and if it is equal to \c false, assertion failure handler is invoked
* with \c AFS_ASSERT parameter. If assertion failure handler is not customized,
* the functionality of system \c assert() call is performed.
* If \c NDEBUG preprocessor symbol is defined, the macro expands to empty operator
* and expression of its argument is \e NOT evaluated.
* \note The expression is evaluated only once even though either custom handler or
* system \c assert() might be chosen to handle failure.
* \par
* \note The macro is designed so that "Condition" text is passed to customized
* handler and "OU__ASSERT_HANDLER(Condition)" is passed to \c assert() if
* handler is not customized. However new versions of GCC (starting from 4.3.0)
* seem to use modified macro expansion schema which formats macro \c OU__ASSERT_HANDLER
* into string after full expansion.
*
* \see OU_VERIFY
* \see OU_CHECK
* \see EASSERTIONFAILURESEVERITY
* \see CAssertionFailedProcedure
* \see CAssertionCheckCustomization
*/
/**
* \def OU_VERIFY
* \brief Defines an assertion check macro which always evaluates its parameter.
*
* \c OU_VERIFY is similar to \c OU_ASSERT with exception that if \c NDEBUG preprocessor
* symbol is defined it still evaluates its parameter.
* The main purpose of this macro is to prevent "unused variable" compiler warning
* which would otherwise appear with \c OU_ASSERT macro used when \c NDEBUG is defined.
*
* \code
* bool bCallStatus = CallMyFunction();
* // A compiler warning would be generated with OU_ASSERT if bCallStatus is
* // not used further in the code.
* OU_VERIFY(bCallStatus);
* \endcode
*
* \note It is not recommended to use \c OU_VERIFY with function calls directly
* if function result is not boolean, as otherwise in case of assertion failure
* it will be not possible to retrieve function result.
* \code
* // Incorrect! Call status will not be available in case of failure!
* OU_VERIFY(pthread_mutex_create(&attr) == EOK);
*
* // Correct. Call status can be retrieved from a variable.
* int iMutexCreateStatus = pthread_mutex_create(&attr);
* OU_VERIFY(iMutexCreateStatus == EOK);
* \endcode
*
* \see OU_ASSERT
* \see OU_CHECK
* \see EASSERTIONFAILURESEVERITY
* \see CAssertionFailedProcedure
* \see CAssertionCheckCustomization
*/
/**
* \def OU_CHECK
* \brief Defines a hard assertion check macro.
*
* \c OU_CHECK evaluates its parameter and if the expression equals to \c false
* it invokes either a custom assertion failure handler with \c AFS_CHECK parameter
* or failure processing of system \c assert() function. The execution is not supposed
* to exit from assertion failure call. If it does (either because custom assertion
* failure handler returns or handler is not customized and \c assert() function has
* no effect because of \c NDEBUG symbol being defined), a write attempt to NULL
* pointer is performed to generate Access Violation exception or SIGSEGV signal.
* \c OU_CHECK is similar to \c OU_VERIFY in that it evaluates its parameter whether
* \c NDEBUG is defined or not.
* \note The expression is evaluated only once even though either custom handler or
* system \c assert() might be chosen to handle failure.
* \par
* \note The macro is designed so that "Condition" text is passed to customized
* handler and "OU__CHECK_HANDLER(Condition)" is passed to \c assert() if
* handler is not customized. However new versions of GCC (starting from 4.3.0)
* seem to use modified macro expansion schema which formats macro \c OU__CHECK_HANDLER
* into string after full expansion.
*
* \see OU_ASSERT
* \see OU_VERIFY
* \see EASSERTIONFAILURESEVERITY
* \see CAssertionFailedProcedure
* \see CAssertionCheckCustomization
*/
/*
* Implementation Note:
* 1) Fully qualified names must be used in macros as they might be
* used externally and forwarded from outside of _OU_NAMESPACE.
* 2) false || ... is necessary to suppress C4800 warning in MSVC.
*/
#if defined(NDEBUG)
#define OU_ASSERT(Condition) ((void)0)
#define OU_VERIFY(Condition) ((void)(Condition))
#define OU_CHECK(Condition) (void)(false || (Condition) \
|| (!_OU_NAMESPACE::CAssertionCheckCustomization::GetAssertFailureCustomHandler() \
|| (_OU_NAMESPACE::CAssertionCheckCustomization::GetAssertFailureCustomHandler()( \
_OU_NAMESPACE::AFS_CHECK, #Condition, __FILE__, __LINE__), false)) \
|| (*(volatile int *)0 = 0, false))
#else // #if !defined(NDEBUG)
#include <assert.h>
#define OU__ASSERT_HANDLER(Condition) (false || (Condition) \
|| (_OU_NAMESPACE::CAssertionCheckCustomization::GetAssertFailureCustomHandler() \
&& (_OU_NAMESPACE::CAssertionCheckCustomization::GetAssertFailureCustomHandler()( \
_OU_NAMESPACE::AFS_ASSERT, #Condition, __FILE__, __LINE__), true)))
#define OU__CHECK_HANDLER(Condition) (((bConditionValue = false || (Condition)), bConditionValue) \
|| (_OU_NAMESPACE::CAssertionCheckCustomization::GetAssertFailureCustomHandler() \
&& (_OU_NAMESPACE::CAssertionCheckCustomization::GetAssertFailureCustomHandler()( \
_OU_NAMESPACE::AFS_CHECK, #Condition, __FILE__, __LINE__), true)))
#define OU_ASSERT(Condition) assert(OU__ASSERT_HANDLER(Condition))
#define OU_VERIFY(Condition) OU_ASSERT(Condition)
#define OU_CHECK(Condition) { \
bool bConditionValue; \
assert(OU__CHECK_HANDLER(Condition)); \
(void)(bConditionValue || (*(volatile int *)0 = 0, false)); \
}
#endif // #if !defined(NDEBUG)
#endif // #ifndef __OU_ASSERT_H_INCLUDED

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,367 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_ATOMICFLAGS_H_INCLUDED
#define __OU_ATOMICFLAGS_H_INCLUDED
#include <ou/flagsdefines.h>
#include <ou/atomic.h>
#include <ou/assert.h>
#include <ou/namespace.h>
BEGIN_NAMESPACE_OU();
/*
* Implementation Note:
* Modification functions are implemented as memory barriers.
* Retrieval functions are implemented as ordinary memory accesses.
* Practice proves that such approach is quite sufficient to provide
* reliable synchronization mechanisms (provided a developer has solid
* knowledge in field, of course).
*/
class CAtomicFlags
{
public:
_OU_INLINE _OU_CONVENTION_METHOD CAtomicFlags():
m_aoFlagsValue(0)
{
}
_OU_INLINE _OU_CONVENTION_METHOD CAtomicFlags(atomicord32 aoFlagsValue):
m_aoFlagsValue(aoFlagsValue)
{
}
typedef atomicord32 value_type;
public:
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */AssignFlagsAllValues(atomicord32 aoFlagsValue)
{
AtomicExchange(&m_aoFlagsValue, aoFlagsValue);
}
_OU_ALWAYSINLINE atomicord32 _OU_CONVENTION_METHOD
/*atomicord32 */QueryFlagsAllValues() const
{
return m_aoFlagsValue;
}
// Can operate both on single flag and flag set
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */SetFlagsMaskValue(atomicord32 aoFlagsMask, bool bFlagValue)
{
if (bFlagValue)
{
AtomicOrNoResult(&m_aoFlagsValue, aoFlagsMask);
}
else
{
AtomicAndNoResult(&m_aoFlagsValue, ~aoFlagsMask);
}
}
// Can operate both on single flag and flag set
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */SignalFlagsMaskValue(atomicord32 aoFlagsMask)
{
AtomicOrNoResult(&m_aoFlagsValue, aoFlagsMask);
}
// Can operate both on single flag and flag set
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */DropFlagsMaskValue(atomicord32 aoFlagsMask)
{
AtomicAndNoResult(&m_aoFlagsValue, ~aoFlagsMask);
}
// Can operate on single flag only
// Returns previous flag value
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */ToggleSingleFlagValue(atomicord32 aoSingleFlag)
{
OU_ASSERT(OU_FLAGS_FLAG_IS_SINGLE(atomicord32, aoSingleFlag));
return (AtomicXor(&m_aoFlagsValue, aoSingleFlag) & aoSingleFlag) != (atomicord32)0;
}
// Can operate on single flag only
// Returns if modification occurred
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */ModifySingleFlagValue(atomicord32 aoSingleFlag, bool bFlagValue)
{
OU_ASSERT(OU_FLAGS_FLAG_IS_SINGLE(atomicord32, aoSingleFlag));
return bFlagValue
? ((AtomicOr(&m_aoFlagsValue, aoSingleFlag) & aoSingleFlag) == (atomicord32)0)
: ((AtomicAnd(&m_aoFlagsValue, ~aoSingleFlag) & aoSingleFlag) != (atomicord32)0);
}
// Modifies subset of flags
// Returns previous flags
_OU_ALWAYSINLINE atomicord32 _OU_CONVENTION_METHOD
/*atomicord32 */AssignFlagsByMask(atomicord32 aoFlagsMask, atomicord32 aoFlagsValue)
{
atomicord32 aoFlagsOldValue;
do
{
aoFlagsOldValue = m_aoFlagsValue;
}
while (!AtomicCompareExchange(&m_aoFlagsValue, aoFlagsOldValue, (aoFlagsOldValue & ~aoFlagsMask) | (aoFlagsValue & aoFlagsMask)));
return aoFlagsOldValue;
}
// Modifies subset of flags
// Returns if modification occurred
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */AlterFlagsByMask(atomicord32 aoFlagsMask, atomicord32 aoFlagsValue)
{
atomicord32 aoFlagsOldValue;
do
{
aoFlagsOldValue = m_aoFlagsValue;
}
while (!AtomicCompareExchange(&m_aoFlagsValue, aoFlagsOldValue, (aoFlagsOldValue & ~aoFlagsMask) | (aoFlagsValue & aoFlagsMask)));
return ((aoFlagsOldValue ^ aoFlagsValue) & aoFlagsMask) != (atomicord32)0;
}
// Returns value of flag or tests for any bit in a mask
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */GetFlagsMaskValue(atomicord32 aoFlagsMask) const
{
return (m_aoFlagsValue & aoFlagsMask) != (atomicord32)0;
}
// Returns subset of flags
_OU_ALWAYSINLINE atomicord32 _OU_CONVENTION_METHOD
/*atomicord32 */QueryFlagsByMask(atomicord32 aoFlagsMask) const
{
return (m_aoFlagsValue & aoFlagsMask);
}
public:
// Signal only flag out of mask
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */OnlySignalSingleFlagOutOfMask(atomicord32 aoFlagsMask, atomicord32 aoSingleFlag)
{
OU_ASSERT(OU_FLAGS_FLAG_IS_SINGLE(atomicord32, aoSingleFlag));
bool bResult;
atomicord32 aoFlagsOldValue;
do
{
aoFlagsOldValue = m_aoFlagsValue;
/*
* Implementation Note:
* 1) This function may be not a memory barrier. However that would also mean that
* no modification occurred and result is 'false'. Such behavior should be OK.
* 2) Even though second assignment to bResult is unnecessary it might yield
* better code as compiler does not need to save variable's value for the call
* to AtomicCompareExchange in this case.
*/
}
while ((bResult = !(aoFlagsOldValue & aoFlagsMask)) && !(bResult = AtomicCompareExchange(&m_aoFlagsValue, aoFlagsOldValue, aoFlagsOldValue | aoSingleFlag)));
return bResult;
}
public:
// Set value of flag indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumSetEnumeratedFlagValue(atomicord32 aoStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum, bool bFlagValue)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
SetFlagsMaskValue(aoStartingFlag << uiEnumeratedValue, bFlagValue);
}
// Signal value of flag indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumSignalEnumeratedFlagValue(atomicord32 aoStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
SignalFlagsMaskValue(aoStartingFlag << uiEnumeratedValue);
}
// Drop value of flag indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumDropEnumeratedFlagValue(atomicord32 aoStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
DropFlagsMaskValue(aoStartingFlag << uiEnumeratedValue);
}
// Can operate on single flag only
// Returns previous flag value
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumToggleEnumeratedFlagValue(atomicord32 aoStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
return ToggleSingleFlagValue(aoStartingFlag << uiEnumeratedValue);
}
// Can operate on single flag only
// Returns if modification occurred
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumModifyEnumeratedFlagValue(atomicord32 aoStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum, bool bFlagValue)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
return ModifySingleFlagValue(aoStartingFlag << uiEnumeratedValue, bFlagValue);
}
// Returns if this was the first flag signaled
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumSignalFirstEnumeratedFlagValue(atomicord32 aoStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
return (AssignFlagsByMask(aoStartingFlag << uiEnumeratedValue, aoStartingFlag << uiEnumeratedValue) & OU_FLAGS_ENUMFLAGS_MASK(atomicord32, aoStartingFlag, uiEnumeratedMaximum)) == (atomicord32)0;
}
// Returns if this was the last flag signaled
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumSignalLastEnumeratedFlagValue(atomicord32 aoStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
return (AssignFlagsByMask(aoStartingFlag << uiEnumeratedValue, aoStartingFlag << uiEnumeratedValue) & OU_FLAGS_ENUMFLAGS_MASK(atomicord32, aoStartingFlag, uiEnumeratedMaximum)) == (OU_FLAGS_ENUMFLAGS_MASK(atomicord32, aoStartingFlag, uiEnumeratedMaximum) & ~(aoStartingFlag << uiEnumeratedValue));
}
// Retrieve value of flag indexed by enum
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumGetEnumeratedFlagValue(atomicord32 aoStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum) const
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
return GetFlagsMaskValue(aoStartingFlag << uiEnumeratedValue);
}
// Find enum value for first flag signaled
_OU_INLINE int _OU_CONVENTION_METHOD
/*int */EnumFindFirstEnumeratedFlag(atomicord32 aoStartingFlag, unsigned int uiEnumeratedMaximum) const
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
unsigned int uiResult = 0;
atomicord32 aoFlagsMask = aoStartingFlag;
for (; uiResult < uiEnumeratedMaximum; ++uiResult, aoFlagsMask <<= 1)
{
if (GetFlagsMaskValue(aoFlagsMask))
{
break;
}
}
return uiResult;
}
public:
// Signal all flags indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumAllSignalEnumeratedFlags(atomicord32 aoStartingFlag, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
SignalFlagsMaskValue(OU_FLAGS_ENUMFLAGS_MASK(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
}
// Drop all flags indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumAllDropEnumeratedFlags(atomicord32 aoStartingFlag, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
DropFlagsMaskValue(OU_FLAGS_ENUMFLAGS_MASK(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
}
// Query all flags indexed by enum
_OU_ALWAYSINLINE atomicord32 _OU_CONVENTION_METHOD
/*atomicord32 */EnumAllQueryEnumeratedFlags(atomicord32 aoStartingFlag, unsigned int uiEnumeratedMaximum) const
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
return QueryFlagsByMask(OU_FLAGS_ENUMFLAGS_MASK(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
}
// Get if any flag indexed by enum is set
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumAnyGetEnumeratedFlagValue(atomicord32 aoStartingFlag, unsigned int uiEnumeratedMaximum) const
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
return GetFlagsMaskValue(OU_FLAGS_ENUMFLAGS_MASK(atomicord32, aoStartingFlag, uiEnumeratedMaximum));
}
public:
// Store enumerated value in flags
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */StoreFlagsEnumeratedValue(atomicord32 aoEnumeratedValueMask, unsigned int uiEnumeratedValueShift, unsigned int uiEnumeratedValue)
{
OU_ASSERT(OU_FLAGS_STOREENUM_VALUE_IN_MASK(atomicord32, uiEnumeratedValue, aoEnumeratedValueMask));
AssignFlagsByMask(aoEnumeratedValueMask << uiEnumeratedValueShift, (atomicord32)uiEnumeratedValue << uiEnumeratedValueShift);
}
// Retrieve enumerated value from flags
_OU_ALWAYSINLINE unsigned int _OU_CONVENTION_METHOD
/*unsigned int */RetrieveFlagsEnumeratedValue(atomicord32 aoEnumeratedValueMask, unsigned int uiEnumeratedValueShift) const
{
return (unsigned int)((QueryFlagsAllValues() >> uiEnumeratedValueShift) & aoEnumeratedValueMask);
}
private:
atomicord32 m_aoFlagsValue;
};
END_NAMESPACE_OU();
#endif // #ifndef __OU_ATOMICFLAGS_H_INCLUDED

View File

@@ -0,0 +1,149 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_CUSTOMIZATION_H_INCLUDED
#define __OU_CUSTOMIZATION_H_INCLUDED
#include <ou/namespace.h>
#include <ou/inttypes.h>
#include <ou/platform.h>
#include <stddef.h>
BEGIN_NAMESPACE_OU();
//////////////////////////////////////////////////////////////////////////
// Some helper definitions for assert macros
#if !defined(__FILE__)
// Definition of __FILE__ constant for the case if compiler does not support the macro
extern const char *const __FILE__;
#endif // #if !defined(__FILE__)
#if !defined(__LINE__)
// Definition of __LINE__ constant for the case if compiler does not support the macro
extern const unsigned int __LINE__;
#endif // #if !defined(__LINE__)
//////////////////////////////////////////////////////////////////////////
// Assertion checks customization
enum EASSERTIONFAILURESEVERITY
{
AFS__MIN,
AFS_ASSERT = AFS__MIN,
AFS_CHECK,
AFS__MAX,
};
typedef void (_OU_CONVENTION_CALLBACK *CAssertionFailedProcedure)(EASSERTIONFAILURESEVERITY fsFailureSeverity,
const char *szAssertionExpression, const char *szAssertionFileName, unsigned int uiAssertionSourceLine);
class CAssertionCheckCustomization
{
public:
static _OU_ALWAYSINLINE CAssertionFailedProcedure _OU_CONVENTION_API
/*CAssertionFailedProcedure */GetAssertFailureCustomHandler()
{
return g_fnAssertFailureHandler;
}
static _OU_INLINE void _OU_CONVENTION_API CustomizeAssertionChecks(CAssertionFailedProcedure fnAssertionFailureProcedure)
{
g_fnAssertFailureHandler = fnAssertionFailureProcedure;
}
private:
static CAssertionFailedProcedure g_fnAssertFailureHandler;
};
//////////////////////////////////////////////////////////////////////////
// Memory manager customization
#define _OU_MEMORY_REQUIRED_ALIGNMENT sizeof(_OU_NAMESPACE::uint64ou)
typedef void *(_OU_CONVENTION_CALLBACK *CMemoryAllocationProcedure)(size_t nBlockSize);
typedef void *(_OU_CONVENTION_CALLBACK *CMemoryReallocationProcedure)(void *pv_ExistingBlock, size_t nBlockNewSize);
typedef void (_OU_CONVENTION_CALLBACK *CMemoryDeallocationProcedure)(void *pv_ExistingBlock);
class CMemoryManagerCustomization
{
public:
static _OU_ALWAYSINLINE CMemoryAllocationProcedure _OU_CONVENTION_API
/*CMemoryAllocationProcedure */GetMemoryAllocationCustomProcedure()
{
return g_fnMemoryAllocationProcedure;
}
static _OU_ALWAYSINLINE CMemoryReallocationProcedure _OU_CONVENTION_API
/*CMemoryReallocationProcedure */GetMemoryReallocationCustomProcedure()
{
return g_fnMemoryReallocationProcedure;
}
static _OU_ALWAYSINLINE CMemoryDeallocationProcedure _OU_CONVENTION_API
/*CMemoryDeallocationProcedure */GetMemoryDeallocationCustomProcedure()
{
return g_fnMemoryDeallocationProcedure;
}
static _OU_INLINE void _OU_CONVENTION_API CustomizeMemoryManager(CMemoryAllocationProcedure fnAllocationProcedure,
CMemoryReallocationProcedure fnReallocationProcedure, CMemoryDeallocationProcedure fnDeallocationProcedure)
{
g_fnMemoryAllocationProcedure = fnAllocationProcedure;
g_fnMemoryReallocationProcedure = fnReallocationProcedure;
g_fnMemoryDeallocationProcedure = fnDeallocationProcedure;
}
private:
static CMemoryAllocationProcedure g_fnMemoryAllocationProcedure;
static CMemoryReallocationProcedure g_fnMemoryReallocationProcedure;
static CMemoryDeallocationProcedure g_fnMemoryDeallocationProcedure;
};
END_NAMESPACE_OU();
#endif // #ifndef __OU_CUSTOMIZATION_H_INCLUDED

View File

@@ -0,0 +1,256 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_ENUMARRAYS_H_INCLUDED
#define __OU_ENUMARRAYS_H_INCLUDED
#include <ou/assert.h>
#include <ou/macros.h>
#include <ou/platform.h>
#include <ou/namespace.h>
BEGIN_NAMESPACE_OU();
//////////////////////////////////////////////////////////////////////////
// Helper template definitions
template<typename ElementType>
struct CTypeStandardEqual
{
_OU_INLINE bool _OU_CONVENTION_METHOD operator ()(const ElementType &etLeftElement, const ElementType &etRightElement) const
{
return etLeftElement == etRightElement;
}
};
template<typename ElementType>
struct CTypeStandardLess
{
_OU_INLINE bool _OU_CONVENTION_METHOD operator ()(const ElementType &etLeftElement, const ElementType &etRightElement) const
{
return etLeftElement < etRightElement;
}
};
//////////////////////////////////////////////////////////////////////////
// CEnumUnsortedElementArray definition
/*
* Implementation Note:
* The array is intended to store static constant data.
* Therefore CElementEqualType should never need a nontrivial constructor
* and it is acceptable to have it as template parameter.
*/
template<typename EnumType, const EnumType EnumMax, typename ElementType, const int Instance=0, class CElementEqualType=CTypeStandardEqual<ElementType> >
class CEnumUnsortedElementArray
{
public:
_OU_CONVENTION_METHOD CEnumUnsortedElementArray()
{
#if !defined(NDEBUG)
#if _OU_COMPILER != _OU_COMPILER_GCC || _OU_COMPILER_VERSION == _OU_COMPILER_VERSION_GCCLT4
OU_ASSERT(OU_ARRAY_SIZE(m_aetElementArray) == EnumMax);
#endif // #if _OU_COMPILER != _OU_COMPILER_GCC || _OU_COMPILER_VERSION == _OU_COMPILER_VERSION_GCCLT4
#endif // #if !defined(NDEBUG)
}
public:
static _OU_ALWAYSINLINE const EnumType _OU_CONVENTION_API
/*const EnumType */Decode(const ElementType &etValue)
{
const ElementType *itElementFound = FindValueSequentially(m_aetElementArray, m_aetElementArray + EnumMax, etValue);
EnumType etResult = (EnumType)(itElementFound - m_aetElementArray);
return etResult;
}
static _OU_ALWAYSINLINE const ElementType &_OU_CONVENTION_API
/*const ElementType &*/Encode(const EnumType &etValue)
{
OU_ASSERT(sizeof(EnumType) <= sizeof(int));
OU_ASSERT(OU_IN_INT_RANGE(etValue, 0, EnumMax));
return m_aetElementArray[etValue];
}
static _OU_ALWAYSINLINE bool _OU_CONVENTION_API
/*bool */IsValidDecode(const EnumType &etValue)
{
return etValue != EnumMax;
}
static _OU_ALWAYSINLINE const ElementType *_OU_CONVENTION_API
/*const ElementType **/GetStoragePointer()
{
return m_aetElementArray;
}
private:
static const ElementType *_OU_CONVENTION_API FindValueSequentially(const ElementType *petArrayBegin, const ElementType *petArrayEnd, const ElementType &etValue)
{
const CElementEqualType etElementEqual = CElementEqualType();
const ElementType *petCurrentElement = petArrayBegin;
for (; petCurrentElement != petArrayEnd; ++petCurrentElement)
{
if (etElementEqual(*petCurrentElement, etValue))
{
break;
}
}
return petCurrentElement;
}
private:
static const ElementType m_aetElementArray[];
};
//////////////////////////////////////////////////////////////////////////
// CEnumSortedElementArray definition
/*
* Implementation Note:
* The array is intended to store static constant data.
* Therefore CElementLessType and CElementEqualType should never need
* a nontrivial constructor and it is acceptable to have them
* as template parameters.
*/
template<typename EnumType, const EnumType EnumMax, typename ElementType, const int Instance=0, class CElementLessType=CTypeStandardLess<ElementType> >
class CEnumSortedElementArray
{
public:
_OU_INLINE _OU_CONVENTION_METHOD CEnumSortedElementArray()
{
#if !defined(NDEBUG)
#if _OU_COMPILER != _OU_COMPILER_GCC || _OU_COMPILER_VERSION == _OU_COMPILER_VERSION_GCCLT4
OU_ASSERT(OU_ARRAY_SIZE(m_aetElementArray) == EnumMax);
#endif // #if _OU_COMPILER != _OU_COMPILER_GCC || _OU_COMPILER_VERSION == _OU_COMPILER_VERSION_GCCLT4
const CElementLessType ltElementLess = CElementLessType();
for (unsigned nElementIndex = 1; nElementIndex < EnumMax; ++nElementIndex)
{
OU_ASSERT(ltElementLess(m_aetElementArray[nElementIndex - 1], m_aetElementArray[nElementIndex])); // Element values must be sorted
}
#endif // #if !defined(NDEBUG)
}
static _OU_ALWAYSINLINE const EnumType _OU_CONVENTION_API
/*const EnumType */Decode(const ElementType &etValue)
{
const CElementLessType ltElementLess = CElementLessType();
EnumType etResult = EnumMax;
const ElementType *itElementFound = FindValueLowerBound(m_aetElementArray, m_aetElementArray + EnumMax, etValue);
if (itElementFound != m_aetElementArray + EnumMax)
{
if (!ltElementLess(etValue, *itElementFound))
{
etResult = (EnumType)(itElementFound - m_aetElementArray);
}
}
return etResult;
}
static _OU_ALWAYSINLINE const ElementType &_OU_CONVENTION_API
/*const ElementType &*/Encode(const EnumType &etValue)
{
OU_ASSERT(sizeof(EnumType) <= sizeof(int));
OU_ASSERT(OU_IN_INT_RANGE(etValue, 0, EnumMax));
return m_aetElementArray[etValue];
}
static _OU_ALWAYSINLINE bool _OU_CONVENTION_API
/*bool */IsValidDecode(const EnumType &etValue)
{
return etValue != EnumMax;
}
static _OU_ALWAYSINLINE const ElementType *_OU_CONVENTION_API
/*const ElementType **/GetStoragePointer()
{
return m_aetElementArray;
}
private:
static const ElementType *_OU_CONVENTION_API FindValueLowerBound(const ElementType *petArrayBegin, const ElementType *petArrayEnd, const ElementType &etValue)
{
const CElementLessType ltElementLess = CElementLessType();
const ElementType *petCurrentRangeBegin = petArrayBegin;
const ElementType *petCurrentRangeEnd = petArrayEnd;
while (petCurrentRangeBegin != petCurrentRangeEnd)
{
const ElementType *petCurrentRangeMiddle = petCurrentRangeBegin + (petCurrentRangeEnd - petCurrentRangeBegin) / 2;
if (ltElementLess(*petCurrentRangeMiddle, etValue))
{
petCurrentRangeBegin = petCurrentRangeMiddle + 1;
}
else
{
petCurrentRangeEnd = petCurrentRangeMiddle;
}
}
return petCurrentRangeBegin;
}
private:
static const ElementType m_aetElementArray[];
};
END_NAMESPACE_OU();
#endif // #ifndef __OU_ENUMARRAYS_H_INCLUDED

View File

@@ -0,0 +1,51 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_FEATURES_H_INCLUDED
#define __OU_FEATURES_H_INCLUDED
//////////////////////////////////////////////////////////////////////////
// Feature set definitions
#define _OU_FEATURE_SET_BASICS 0
#define _OU_FEATURE_SET_ATOMICS 1
#define _OU_FEATURE_SET_TLS 2
#define _OU_FEATURE_SET__MAX 3
//////////////////////////////////////////////////////////////////////////
#if !defined(_OU_FEATURE_SET)
#define _OU_FEATURE_SET _OU_FEATURE_SET__MAX
#endif // #if !defined(_OU_FEATURE_SET)
#endif // #ifndef __OU_FEATURES_H_INCLUDED

View File

@@ -0,0 +1,35 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_FLAGS_H_INCLUDED
#define __OU_FLAGS_H_INCLUDED
#include <ou/simpleflags.h>
#include <ou/atomicflags.h>
#endif // #ifndef __OU_FLAGS_H_INCLUDED

View File

@@ -0,0 +1,37 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_FLAGSDEFINES_H_INCLUDED
#define __OU_FLAGSDEFINES_H_INCLUDED
#define OU_FLAGS_ENUMFLAGS_MASK(Type, StartingFlag, EnumMax) ((Type)((Type)((Type)((Type)(StartingFlag) << ((EnumMax) - 1)) - (Type)(StartingFlag)) | (Type)((Type)(StartingFlag) << ((EnumMax) - 1))))
#define OU_FLAGS_ENUMFLAGS_START_VALID(Type, StartingFlag, EnumMax) ((Type)((Type)(StartingFlag) << ((EnumMax) - 1)) != 0)
#define OU_FLAGS_STOREENUM_VALUE_IN_MASK(Type, EnumValue, ValueMask) ((Type)(ValueMask) != 0 && ((Type)(EnumValue) & (Type)(~((Type)(ValueMask)))) == 0)
#define OU_FLAGS_FLAG_IS_SINGLE(Type, Flag) ((Type)(Flag) != 0 && ((Type)(Flag) & (Type)((Type)(Flag) - (Type)1)) == 0)
#endif // #ifndef __OU_FLAGSDEFINES_H_INCLUDED

View File

@@ -0,0 +1,136 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_INTTYPES_H_INCLUDED
#define __OU_INTTYPES_H_INCLUDED
#include <ou/namespace.h>
#include <ou/platform.h>
BEGIN_NAMESPACE_OU();
/*
* Implementation Note:
* Standard [u]int??_t type names are avoided to prevent possibility
* of conflict with system types which might be the preprocessor defines.
* If you know that all your target platforms do not use defines for
* integer types, you can typedef them to convenient names after inclusion
* of "ou" library.
*/
#if _OU_COMPILER == _OU_COMPILER_MSVC
typedef __int8 int8ou;
typedef unsigned __int8 uint8ou;
typedef __int16 int16ou;
typedef unsigned __int16 uint16ou;
typedef __int32 int32ou;
typedef unsigned __int32 uint32ou;
typedef __int64 int64ou;
typedef unsigned __int64 uint64ou;
#else // #if _OU_TARGET_OS != _OU_TARGET_OS_WINDOWS
END_NAMESPACE_OU();
#include <inttypes.h>
typedef int8_t __ou_global_int8;
typedef uint8_t __ou_global_uint8;
typedef int16_t __ou_global_int16;
typedef uint16_t __ou_global_uint16;
typedef int32_t __ou_global_int32;
typedef uint32_t __ou_global_uint32;
typedef int64_t __ou_global_int64;
typedef uint64_t __ou_global_uint64;
BEGIN_NAMESPACE_OU();
typedef ::__ou_global_int8 int8ou;
typedef ::__ou_global_uint8 uint8ou;
typedef ::__ou_global_int16 int16ou;
typedef ::__ou_global_uint16 uint16ou;
typedef ::__ou_global_int32 int32ou;
typedef ::__ou_global_uint32 uint32ou;
typedef ::__ou_global_int64 int64ou;
typedef ::__ou_global_uint64 uint64ou;
#endif // #if _OU_TARGET_OS == ...
#define OU_BITS_IN_BYTE 8U
#define OU_UINT8_BITS (sizeof(_OU_NAMESPACE::uint8ou) * OU_BITS_IN_BYTE)
#define OU_INT8_BITS (sizeof(_OU_NAMESPACE::int8ou) * OU_BITS_IN_BYTE)
#define OU_UINT8_MAX ((_OU_NAMESPACE::uint8ou)(-1))
#define OU_UINT8_MIN ((_OU_NAMESPACE::uint8ou)0)
#define OU_INT8_MAX ((_OU_NAMESPACE::int8ou)(OU_UINT8_MAX >> 1))
#define OU_INT8_MIN ((_OU_NAMESPACE::int8ou)(OU_UINT8_MAX - OU_INT8_MAX))
#define OU_UINT16_BITS (sizeof(_OU_NAMESPACE::uint16ou) * OU_BITS_IN_BYTE)
#define OU_INT16_BITS (sizeof(_OU_NAMESPACE::int16ou) * OU_BITS_IN_BYTE)
#define OU_UINT16_MAX ((_OU_NAMESPACE::uint16ou)(-1))
#define OU_UINT16_MIN ((_OU_NAMESPACE::uint16ou)0)
#define OU_INT16_MAX ((_OU_NAMESPACE::int16ou)(OU_UINT16_MAX >> 1))
#define OU_INT16_MIN ((_OU_NAMESPACE::int16ou)(OU_UINT16_MAX - OU_INT16_MAX))
#define OU_UINT32_BITS (sizeof(_OU_NAMESPACE::uint32ou) * OU_BITS_IN_BYTE)
#define OU_INT32_BITS (sizeof(_OU_NAMESPACE::int32ou) * OU_BITS_IN_BYTE)
#define OU_UINT32_MAX ((_OU_NAMESPACE::uint32ou)(-1))
#define OU_UINT32_MIN ((_OU_NAMESPACE::uint32ou)0)
#define OU_INT32_MAX ((_OU_NAMESPACE::int32ou)(OU_UINT32_MAX >> 1))
#define OU_INT32_MIN ((_OU_NAMESPACE::int32ou)(OU_UINT32_MAX - OU_INT32_MAX))
#define OU_UINT64_BITS (sizeof(_OU_NAMESPACE::uint64ou) * OU_BITS_IN_BYTE)
#define OU_INT64_BITS (sizeof(_OU_NAMESPACE::int64ou) * OU_BITS_IN_BYTE)
#define OU_UINT64_MAX ((_OU_NAMESPACE::uint64ou)(-1))
#define OU_UINT64_MIN ((_OU_NAMESPACE::uint64ou)0)
#define OU_INT64_MAX ((_OU_NAMESPACE::int64ou)(OU_UINT64_MAX >> 1))
#define OU_INT64_MIN ((_OU_NAMESPACE::int64ou)(OU_UINT64_MAX - OU_INT64_MAX))
END_NAMESPACE_OU();
#endif // #ifndef __OU_INTTYPES_H_INCLUDED

View File

@@ -0,0 +1,79 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_MACROS_H_INCLUDED
#define __OU_MACROS_H_INCLUDED
#include <stddef.h>
//////////////////////////////////////////////////////////////////////////
// offsetof macro redefinition for QNX (to avoid compiler warning)
#if _OU_TARGET_OS == _OU_TARGET_OS_QNX
#undef offsetof
#define offsetof(s, m) ((size_t)&(((s *)8)->m) - (size_t)8)
#endif // #if _OU_TARGET_OS == _OU_TARGET_OS_QNX
//////////////////////////////////////////////////////////////////////////
// OU_ALIGNED_SIZE macro
#define OU_ALIGNED_SIZET(Size, Alignment) (((size_t)(Size) + (size_t)((Alignment) - 1)) & ~((size_t)((Alignment) - 1)))
#define OU_ALIGNED_INT(Size, Alignment) (((unsigned int)(Size) + (unsigned int)((Alignment) - 1)) & ~((unsigned int)((Alignment) - 1)))
#define OU_ALIGNED_SIZE(Size, Alignment) OU_ALIGNED_SIZET(Size, Alignment)
//////////////////////////////////////////////////////////////////////////
// OU_ARRAY_SIZE macro
#define OU_ARRAY_SIZE(Array) (sizeof(Array) / sizeof((Array)[0]))
//////////////////////////////////////////////////////////////////////////
// OU_IN_*_RANGE macros
/*
* Implementation Note:
* It seems to me "unsigned long long" is not always available.
* Therefore I find _OU_NAMESPACE::uint64ou a more safe choice.
* You have to include <ou/inttypes.h> for it to work.
* I do not include the header automaticaly to keep <macros.h>
* a low-level header.
*/
#define OU_IN_INT_RANGE(Value, Min, Max) ((unsigned int)((unsigned int)(Value) - (unsigned int)(Min)) < (unsigned int)((unsigned int)(Max) - (unsigned int)(Min)))
#define OU_IN_I64_RANGE(Value, Min, Max) ((_OU_NAMESPACE::uint64ou)((_OU_NAMESPACE::uint64ou)(Value) - (_OU_NAMESPACE::uint64ou)(Min)) < (_OU_NAMESPACE::uint64ou)((_OU_NAMESPACE::uint64ou)(Max) - (_OU_NAMESPACE::uint64ou)(Min)))
#define OU_IN_SIZET_RANGE(Value, Min, Max) ((size_t)((size_t)(Value) - (size_t)(Min)) < (size_t)((size_t)(Max) - (size_t)(Min)))
#endif // #ifndef __OU_MACROS_H_INCLUDED

View File

@@ -0,0 +1,48 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_MALLOC_H_INCLUDED
#define __OU_MALLOC_H_INCLUDED
#include <ou/namespace.h>
#include <ou/platform.h>
#include <stddef.h>
BEGIN_NAMESPACE_OU();
void *_OU_CONVENTION_API AllocateMemoryBlock(size_t nBlockSize);
void *_OU_CONVENTION_API ReallocateMemoryBlock(void *pv_ExistingBlock, size_t nNewBlockSize);
void _OU_CONVENTION_API FreeMemoryBlock(void *pv_ExistingBlock);
END_NAMESPACE_OU();
#endif // #ifndef __OU_MALLOC_H_INCLUDED

View File

@@ -0,0 +1,43 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_NAMESPACE_H_INCLUDED
#define __OU_NAMESPACE_H_INCLUDED
#ifndef _OU_NAMESPACE
#define _OU_NAMESPACE ou
#endif // #ifndef _OU_NAMESPACE
#define BEGIN_NAMESPACE_OU() namespace _OU_NAMESPACE {
#define END_NAMESPACE_OU() } /* namespace _OU_NAMESPACE */
#endif // #ifndef __OU_NAMESPACE_H_INCLUDED

View File

@@ -0,0 +1,398 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_PLATFORM_H_INCLUDED
#define __OU_PLATFORM_H_INCLUDED
//////////////////////////////////////////////////////////////////////////
// Target definitions
#define _OU_TARGET_OS_GENUNIX 1
#define _OU_TARGET_OS_WINDOWS 2
#define _OU_TARGET_OS_QNX 3
#define _OU_TARGET_OS_MAC 4
#define _OU_TARGET_OS_AIX 5
#define _OU_TARGET_OS_SUNOS 6
#define _OU_TARGET_OS_IOS 7
#define _OU_TARGET_OS__MAX 8
#define _OU_TARGET_BITS_32 1
#define _OU_TARGET_BITS_64 2
#define _OU_TARGET_BITS__MAX 3
#define _OU_TARGET_ARCH_OTHER 1
#define _OU_TARGET_ARCH_X86 2
#define _OU_TARGET_ARCH_IA64 3
#define _OU_TARGET_ARCH_X64 4
#define _OU_TARGET_ARCH_POWERPC 5
#define _OU_TARGET_ARCH_SPARC 6
#define _OU_TARGET_ARCH_ARM 7
#define _OU_TARGET_ARCH_AARCH64 8
#define _OU_TARGET_ARCH__MAX 9
//////////////////////////////////////////////////////////////////////////
#if !defined(_OU_TARGET_OS)
#if defined(_WINDOWS) || defined(_WIN32)
#define _OU_TARGET_OS _OU_TARGET_OS_WINDOWS
#elif defined(__QNX__)
#define _OU_TARGET_OS _OU_TARGET_OS_QNX
#elif defined(__APPLE__)
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
#define _OU_TARGET_OS _OU_TARGET_OS_IOS
#if !defined(MAC_OS_X_VERSION)
#define MAC_OS_X_VERSION 1050
#endif
#elif TARGET_OS_MAC
#define _OU_TARGET_OS _OU_TARGET_OS_MAC
#else // An unknown Apple target
#error Build Apple target is not supported
#endif // // An unknown Apple target
#elif defined(__aix__)
#define _OU_TARGET_OS _OU_TARGET_OS_AIX
#elif defined(__sun__)
#define _OU_TARGET_OS _OU_TARGET_OS_SUNOS
#elif defined(__unix__)
#define _OU_TARGET_OS _OU_TARGET_OS_GENUNIX
#else // if no known define found
#error Build target is not supported
#endif // Target OS definitions
#else // #if defined(_OU_TARGET_OS)
#if _OU_TARGET_OS <= 0 || _OU_TARGET_OS >= _OU_TARGET_OS__MAX
#error Please define a valid value for _OU_TARGET_OS
#endif // #if _OU_TARGET_OS <= 0 || _OU_TARGET_OS >= _OU_TARGET_OS__MAX
#endif // #if defined(_OU_TARGET_OS)
#if _OU_TARGET_OS == _OU_TARGET_OS_MAC
#if !defined(MAC_OS_X_VERSION)
#error Please define preprocessor symbol MAC_OS_X_VERSION in command line (e.g. "-DMAC_OS_X_VERSION=1050" for MacOS 10.5)
#endif // #if !defined(MAC_OS_X_VERSION)
#endif // #if _OU_TARGET_OS == _OU_TARGET_OS_MAC
//////////////////////////////////////////////////////////////////////////
#if !defined(_OU_TARGET_BITS)
#if defined(_LP64) || defined(_WIN64)
#define _OU_TARGET_BITS _OU_TARGET_BITS_64
#else // #if !defined(_LP64)
#define _OU_TARGET_BITS _OU_TARGET_BITS_32
#endif // #if !defined(_LP64)
#else // #if defined(_OU_TARGET_BITS)
#if _OU_TARGET_BITS <= 0 || _OU_TARGET_BITS >= _OU_TARGET_BITS__MAX
#error Please define a valid value for _OU_TARGET_BITS
#endif // #if _OU_TARGET_BITS <= 0 || _OU_TARGET_BITS >= _OU_TARGET_BITS__MAX
#endif // #if defined(_OU_TARGET_BITS)
//////////////////////////////////////////////////////////////////////////
#if !defined(_OU_TARGET_ARCH)
#if defined(__i386__) || defined(_M_IX86)
#define _OU_TARGET_ARCH _OU_TARGET_ARCH_X86
#elif defined(__ia64__) || defined(_M_IA64)
#define _OU_TARGET_ARCH _OU_TARGET_ARCH_IA64
#elif defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64)
#define _OU_TARGET_ARCH _OU_TARGET_ARCH_X64
#elif defined(__ppc__)
#define _OU_TARGET_ARCH _OU_TARGET_ARCH_POWERPC
#elif defined(__sparc__)
#define _OU_TARGET_ARCH _OU_TARGET_ARCH_SPARC
#elif defined(__arm__) || defined(_M_ARM) || defined(TARGET_OS_IPHONE)
#define _OU_TARGET_ARCH _OU_TARGET_ARCH_ARM
#elif defined(__aarch64__)
#define _OU_TARGET_ARCH _OU_TARGET_ARCH_AARCH64
#else // Unknown architecture
#define _OU_TARGET_ARCH _OU_TARGET_ARCH_OTHER
#endif // Architecture definitions
#else // #if defined(_OU_TARGET_ARCH)
#if _OU_TARGET_ARCH <= 0 || _OU_TARGET_ARCH >= _OU_TARGET_ARCH__MAX
#error Please define a valid value for _OU_TARGET_ARCH
#endif // #if _OU_TARGET_ARCH <= 0 || _OU_TARGET_ARCH >= _OU_TARGET_ARCH__MAX
#endif // #if defined(_OU_TARGET_ARCH)
//////////////////////////////////////////////////////////////////////////
// Compiler definition
#define _OU_COMPILER__OTHER 1
#define _OU_COMPILER_GCC 2
#define _OU_COMPILER_MSVC 3
#define _OU_COMPILER__MAX 4
#define _OU_COMPILER_VERSION__OTHER 1
#define _OU_COMPILER_VERSION_MSVC1998 2
#define _OU_COMPILER_VERSION_GCCLT4 3
#define _OU_COMPILER_VERSION__MAX 4
//////////////////////////////////////////////////////////////////////////
#if !defined(_OU_COMPILER)
#if defined(__GNUC__)
#define _OU_COMPILER _OU_COMPILER_GCC
#if __GNUC__ < 4
#define _OU_COMPILER_VERSION _OU_COMPILER_VERSION_GCCLT4
#endif // compiler version
#elif defined(_MSC_VER)
#define _OU_COMPILER _OU_COMPILER_MSVC
#if _MSC_VER <= 1200
#define _OU_COMPILER_VERSION _OU_COMPILER_VERSION_MSVC1998
#endif // compiler version
#else // if no known define found
#define _OU_COMPILER _OU_COMPILER__OTHER
#endif // Compiler specific definitions
#else // #if defined(_OU_COMPILER)
#if _OU_COMPILER <= 0 || _OU_COMPILER >= _OU_COMPILER__MAX
#error Please define a valid value for _OU_COMPILER
#endif // #if _OU_COMPILER <= 0 || _OU_COMPILER >= _OU_COMPILER__MAX
#endif // #if defined(_OU_COMPILER)
#if !defined(_OU_COMPILER_VERSION)
#define _OU_COMPILER_VERSION _OU_COMPILER_VERSION__OTHER
#endif // #if !defined(_OU_COMPILER_VERSION)
#if _OU_COMPILER_VERSION <= 0 || _OU_COMPILER_VERSION >= _OU_COMPILER_VERSION__MAX
#error Please define a valid value for _OU_COMPILER_VERSION
#endif // #if _OU_COMPILER_VERSION <= 0 || _OU_COMPILER_VERSION >= _OU_COMPILER_VERSION__MAX
//////////////////////////////////////////////////////////////////////////
// Calling convention definition
#if !defined(__OU_CONVENTIONS_DEFINED)
#define __OU_CONVENTIONS_DEFINED
#if _OU_TARGET_OS == _OU_TARGET_OS_WINDOWS
#define _OU_CONVENTION_METHOD
#define _OU_CONVENTION_API __stdcall
#define _OU_CONVENTION_CALLBACK __stdcall
#else // #if _OU_TARGET_OS != _OU_TARGET_OS_WINDOWS
#define _OU_CONVENTION_METHOD
#define _OU_CONVENTION_API
#define _OU_CONVENTION_CALLBACK
#endif // #if _OU_TARGET_OS == ...
#endif // #if !defined(__OU_CONVENTIONS_DEFINED)
//////////////////////////////////////////////////////////////////////////
// _OU_ALWAYSINLINE/_OU_INLINE definition
#if !defined(__OU_INLINES_DEFINED)
#define __OU_INLINES_DEFINED
#if _OU_COMPILER == _OU_COMPILER_GCC
#define _OU_ALWAYSINLINE__DEFINITION inline __attribute__((always_inline))
#elif _OU_COMPILER == _OU_COMPILER_MSVC
#define _OU_ALWAYSINLINE__DEFINITION inline __forceinline
#else // if _OU_COMPILER == _OU_COMPILER_OTHER
#define _OU_ALWAYSINLINE__DEFINITION inline
#endif // #if _OU_COMPILER == ...
#if defined(_DEBUG)
#define _OU_ALWAYSINLINE inline
#define _OU_INLINE inline
#else // #if !defined(_DEBUG)
#define _OU_ALWAYSINLINE _OU_ALWAYSINLINE__DEFINITION
#define _OU_INLINE inline
#endif // #if !defined(_DEBUG)
#endif // #if !defined(__OU_INLINES_DEFINED)
#endif // #ifndef __OU_PLATFORM_H_INCLUDED

View File

@@ -0,0 +1,334 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_SIMPLEFLAGS_H_INCLUDED
#define __OU_SIMPLEFLAGS_H_INCLUDED
#include <ou/flagsdefines.h>
#include <ou/assert.h>
#include <ou/inttypes.h>
#include <ou/namespace.h>
#include <stddef.h>
BEGIN_NAMESPACE_OU();
template<typename ContainerType>
class CSimpleFlagsTemplate
{
public:
_OU_INLINE _OU_CONVENTION_METHOD CSimpleFlagsTemplate():
m_ctFlagsValue(0)
{
}
_OU_INLINE _OU_CONVENTION_METHOD CSimpleFlagsTemplate(ContainerType ctFlagsValue):
m_ctFlagsValue(ctFlagsValue)
{
}
typedef ContainerType value_type;
public:
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */AssignFlagsAllValues(ContainerType ctFlagsValue)
{
m_ctFlagsValue = ctFlagsValue;
}
_OU_ALWAYSINLINE ContainerType _OU_CONVENTION_METHOD
/*ContainerType */QueryFlagsAllValues() const
{
return m_ctFlagsValue;
}
// Can operate both on single flag and flag set
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */SetFlagsMaskValue(ContainerType ctFlagsMask, bool bFlagValue)
{
m_ctFlagsValue = bFlagValue
? (m_ctFlagsValue | ctFlagsMask)
: (m_ctFlagsValue & ~ctFlagsMask);
}
// Can operate both on single flag and flag set
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */SignalFlagsMaskValue(ContainerType ctFlagsMask)
{
m_ctFlagsValue |= ctFlagsMask;
}
// Can operate both on single flag and flag set
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */DropFlagsMaskValue(ContainerType ctFlagsMask)
{
m_ctFlagsValue &= ~ctFlagsMask;
}
// Can operate on single flag only
// Returns previous flag value
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */ToggleSingleFlagValue(ContainerType ctSingleFlag)
{
OU_ASSERT(OU_FLAGS_FLAG_IS_SINGLE(ContainerType, ctSingleFlag));
return ((m_ctFlagsValue ^= ctSingleFlag) & ctSingleFlag) == (ContainerType)0;
}
// Can operate on single flag only
// Returns if modification occurred
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */ModifySingleFlagValue(ContainerType ctSingleFlag, bool bFlagValue)
{
OU_ASSERT(OU_FLAGS_FLAG_IS_SINGLE(ContainerType, ctSingleFlag));
return ((m_ctFlagsValue & ctSingleFlag) != (ContainerType)0) != bFlagValue
? ((m_ctFlagsValue ^= ctSingleFlag), true)
: (false);
}
// Modifies subset of flags
// Returns previous flags
_OU_ALWAYSINLINE ContainerType _OU_CONVENTION_METHOD
/*ContainerType */AssignFlagsByMask(ContainerType ctFlagsMask, ContainerType ctFlagsValue)
{
ContainerType ctFlagsOldValue = m_ctFlagsValue;
m_ctFlagsValue = (ctFlagsOldValue & ~ctFlagsMask) | (ctFlagsValue & ctFlagsMask);
return ctFlagsOldValue;
}
// Modifies subset of flags
// Returns if modification occurred
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */AlterFlagsByMask(ContainerType ctFlagsMask, ContainerType ctFlagsValue)
{
ContainerType ctFlagsOldValue = m_ctFlagsValue;
m_ctFlagsValue = (ctFlagsOldValue & ~ctFlagsMask) | (ctFlagsValue & ctFlagsMask);
return ((ctFlagsOldValue ^ ctFlagsValue) & ctFlagsMask) != (ContainerType)0;
}
// Returns value of flag or tests for any bit in a mask
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */GetFlagsMaskValue(ContainerType ctFlagsMask) const
{
return (m_ctFlagsValue & ctFlagsMask) != (ContainerType)0;
}
// Returns subset of flags
_OU_ALWAYSINLINE ContainerType _OU_CONVENTION_METHOD
/*ContainerType */QueryFlagsByMask(ContainerType ctFlagsMask) const
{
return (m_ctFlagsValue & ctFlagsMask);
}
public:
// Signal only flag out of mask
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */OnlySignalSingleFlagOutOfMask(ContainerType ctFlagsMask, ContainerType ctSingleFlag)
{
OU_ASSERT(OU_FLAGS_FLAG_IS_SINGLE(ContainerType, ctSingleFlag));
return !(m_ctFlagsValue & ctFlagsMask)
? (m_ctFlagsValue |= ctSingleFlag, true)
: (false);
}
public:
// Set value of flag indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumSetEnumeratedFlagValue(ContainerType ctStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum, bool bFlagValue)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
SetFlagsMaskValue(ctStartingFlag << uiEnumeratedValue, bFlagValue);
}
// Signal value of flag indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumSignalEnumeratedFlagValue(ContainerType ctStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
SignalFlagsMaskValue(ctStartingFlag << uiEnumeratedValue);
}
// Drop value of flag indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumDropEnumeratedFlagValue(ContainerType ctStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
DropFlagsMaskValue(ctStartingFlag << uiEnumeratedValue);
}
// Can operate on single flag only
// Returns previous flag value
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumToggleEnumeratedFlagValue(ContainerType ctStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
return ToggleSingleFlagValue(ctStartingFlag << uiEnumeratedValue);
}
// Can operate on single flag only
// Returns if modification occurred
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumModifyEnumeratedFlagValue(ContainerType ctStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum, bool bFlagValue)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
return ModifySingleFlagValue(ctStartingFlag << uiEnumeratedValue, bFlagValue);
}
// Returns if this was the first flag signaled
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumSignalFirstEnumeratedFlagValue(ContainerType ctStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
return (AssignFlagsByMask(ctStartingFlag << uiEnumeratedValue, ctStartingFlag << uiEnumeratedValue) & OU_FLAGS_ENUMFLAGS_MASK(ContainerType, ctStartingFlag, uiEnumeratedMaximum)) == (ContainerType)0;
}
// Returns if this was the last flag signaled
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumSignalLastEnumeratedFlagValue(ContainerType ctStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
return (AssignFlagsByMask(ctStartingFlag << uiEnumeratedValue, ctStartingFlag << uiEnumeratedValue) & OU_FLAGS_ENUMFLAGS_MASK(ContainerType, ctStartingFlag, uiEnumeratedMaximum)) == (OU_FLAGS_ENUMFLAGS_MASK(ContainerType, ctStartingFlag, uiEnumeratedMaximum) & ~(ctStartingFlag << uiEnumeratedValue));
}
// Retrieve value of flag indexed by enum
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumGetEnumeratedFlagValue(ContainerType ctStartingFlag, unsigned int uiEnumeratedValue, unsigned int uiEnumeratedMaximum) const
{
OU_ASSERT(uiEnumeratedValue < uiEnumeratedMaximum && OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
return GetFlagsMaskValue(ctStartingFlag << uiEnumeratedValue);
}
// Find enum value for first flag signaled
_OU_INLINE unsigned int _OU_CONVENTION_METHOD
/*unsigned int */EnumFindFirstEnumeratedFlag(ContainerType ctStartingFlag, unsigned int uiEnumeratedMaximum) const
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
unsigned int uiResult = 0;
ContainerType ctFlagsMask = ctStartingFlag;
for (; uiResult < uiEnumeratedMaximum; ++uiResult, ctFlagsMask <<= 1)
{
if (GetFlagsMaskValue(ctFlagsMask))
{
break;
}
}
return uiResult;
}
public:
// Signal all flags indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumAllSignalEnumeratedFlags(ContainerType ctStartingFlag, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
SignalFlagsMaskValue(OU_FLAGS_ENUMFLAGS_MASK(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
}
// Drop all flags indexed by enum
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */EnumAllDropEnumeratedFlags(ContainerType ctStartingFlag, unsigned int uiEnumeratedMaximum)
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
DropFlagsMaskValue(OU_FLAGS_ENUMFLAGS_MASK(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
}
// Query all flags indexed by enum
_OU_ALWAYSINLINE ContainerType _OU_CONVENTION_METHOD
/*ContainerType */EnumAllQueryEnumeratedFlags(ContainerType ctStartingFlag, unsigned int uiEnumeratedMaximum) const
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
return QueryFlagsByMask(OU_FLAGS_ENUMFLAGS_MASK(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
}
// Get if any flag indexed by enum is set
_OU_ALWAYSINLINE bool _OU_CONVENTION_METHOD
/*bool */EnumAnyGetEnumeratedFlagValue(ContainerType ctStartingFlag, unsigned int uiEnumeratedMaximum) const
{
OU_ASSERT(OU_FLAGS_ENUMFLAGS_START_VALID(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
return GetFlagsMaskValue(OU_FLAGS_ENUMFLAGS_MASK(ContainerType, ctStartingFlag, uiEnumeratedMaximum));
}
public:
// Store enumerated value in flags
_OU_ALWAYSINLINE void _OU_CONVENTION_METHOD
/*void */StoreFlagsEnumeratedValue(ContainerType ctEnumeratedValueMask, unsigned int uiEnumeratedValueShift, unsigned int uiEnumeratedValue)
{
OU_ASSERT(OU_FLAGS_STOREENUM_VALUE_IN_MASK(ContainerType, uiEnumeratedValue, ctEnumeratedValueMask));
AssignFlagsByMask(ctEnumeratedValueMask << uiEnumeratedValueShift, (ContainerType)uiEnumeratedValue << uiEnumeratedValueShift);
}
// Retrieve enumerated value from flags
_OU_ALWAYSINLINE unsigned int _OU_CONVENTION_METHOD
/*unsigned int */RetrieveFlagsEnumeratedValue(ContainerType ctEnumeratedValueMask, unsigned int uiEnumeratedValueShift) const
{
return (unsigned int)((QueryFlagsAllValues() >> uiEnumeratedValueShift) & ctEnumeratedValueMask);
}
private:
ContainerType m_ctFlagsValue;
};
typedef CSimpleFlagsTemplate<uint32ou> CSimpleFlags;
END_NAMESPACE_OU();
#endif // #ifndef __OU_SIMPLEFLAGS_H_INCLUDED

View File

@@ -0,0 +1,90 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_TEMPLATES_H_INCLUDED
#define __OU_TEMPLATES_H_INCLUDED
#include <ou/macros.h>
#include <ou/namespace.h>
BEGIN_NAMESPACE_OU();
//////////////////////////////////////////////////////////////////////////
// Enumerated type increment/decrement operator templates
/*
* Implementation Note:
* __attribute__((always_inline)) seems to be unimplemented for templates in GCC
*/
template<typename EnumType>
_OU_INLINE EnumType &_OU_CONVENTION_API operator ++(EnumType &Value)
{
Value = (EnumType)(Value + 1);
return Value;
}
template<typename EnumType>
_OU_INLINE EnumType _OU_CONVENTION_API operator ++(EnumType &Value, int)
{
EnumType ValueCopy = Value;
Value = (EnumType)(Value + 1);
return ValueCopy;
}
template<typename EnumType>
_OU_INLINE EnumType &_OU_CONVENTION_API operator --(EnumType &Value)
{
Value = (EnumType)(Value - 1);
return Value;
}
template<typename EnumType>
_OU_INLINE EnumType _OU_CONVENTION_API operator --(EnumType &Value, int)
{
EnumType ValueCopy = Value;
Value = (EnumType)(Value - 1);
return ValueCopy;
}
//////////////////////////////////////////////////////////////////////////
// Empty "signed zero" check template
template<typename ValueType>
_OU_INLINE bool _OU_CONVENTION_API IsEmptySz(const ValueType *szLine)
{
return !szLine || !(*szLine);
}
END_NAMESPACE_OU();
#endif // #ifndef __OU_TEMPLATES_H_INCLUDED

View File

@@ -0,0 +1,297 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef _OU_THREADLOCALSTORAGE_H_INCLUDED
#define _OU_THREADLOCALSTORAGE_H_INCLUDED
#include <ou/features.h>
#if _OU_FEATURE_SET >= _OU_FEATURE_SET_TLS
#include <ou/typewrapper.h>
#include <ou/macros.h>
#include <ou/assert.h>
#include <ou/platform.h>
#include <ou/namespace.h>
#if _OU_TARGET_OS == _OU_TARGET_OS_WINDOWS
#include <windows.h>
#else // #if _OU_TARGET_OS != _OU_TARGET_OS_WINDOWS
#include <pthread.h>
#endif // #if _OU_TARGET_OS == ...
BEGIN_NAMESPACE_OU();
//////////////////////////////////////////////////////////////////////////
// API specific types
typedef CTypeSimpleWrapper<void *, 1> HTLSKEYVALUE;
typedef CTypeSimpleWrapper<HTLSKEYVALUE *, 0> HTLSKEYSELECTOR;
typedef HTLSKEYSELECTOR HTLSKEY;
typedef void *tlsvaluetype;
typedef unsigned int tlsindextype;
typedef void (_OU_CONVENTION_CALLBACK *CTLSValueDestructor)(tlsvaluetype vValueData);
#define OU_TLS_VALUE_AS_POINTER(value) (value)
//////////////////////////////////////////////////////////////////////////
// Internal types required for functions to be made inline
struct CTLSStorageArray;
struct CTLSStorageBlock
{
/*
* Implementation Note:
* 1) Value destructors are stored in separate array since those are
* rarely accessed values and not intermixing them with data
* potentially simplifies data access (well, just theoretically, of course :)).
* 2) Destructors are stored with negative offset to allow accessing them
* without the knowledge of value count.
* 3) Well, intermixing or not intermixing has really minor impact on
* implementation characteristics, so why not to choose it after the current mood? :)
*/
private:
enum
{
TSB_RESERVEDPOINTER_HOSTARRAY,
TSB_RESERVEDPOINTER__MAX,
};
public:
enum
{
TSB_LARGEST_ALIGNMENT = sizeof(void *) > sizeof(tlsvaluetype) ? sizeof(void *) : sizeof(tlsvaluetype),
};
public:
static inline size_t GetRequiredSize(tlsindextype iValueCount)
{
return OU_ALIGNED_SIZE(iValueCount * (sizeof(tlsvaluetype) + sizeof(CTLSValueDestructor)) + TSB_RESERVEDPOINTER__MAX * sizeof(void *), TSB_LARGEST_ALIGNMENT);
}
static inline size_t GetZeroOffset(tlsindextype iValueCount)
{
// Since pointers and values are stored in different directions,
// alignment correction must fall entirely to either side and
// required size will not be exceeded.
return OU_ALIGNED_SIZE(iValueCount * sizeof(CTLSValueDestructor) + TSB_RESERVEDPOINTER__MAX * sizeof(void *), TSB_LARGEST_ALIGNMENT);
}
public:
inline void SetValueData(tlsindextype iValueIndex, tlsvaluetype vValueData)
{
un.m_av_ValueDatas[iValueIndex] = vValueData;
}
inline tlsvaluetype GetValueData(tlsindextype iValueIndex) const
{
return un.m_av_ValueDatas[iValueIndex];
}
inline void SetHostArray(CTLSStorageArray *psaInstance)
{
un.m_asaHostArrays[(ptrdiff_t)0 - (1 + TSB_RESERVEDPOINTER_HOSTARRAY)] = psaInstance;
}
inline CTLSStorageArray *GetHostArray() const
{
return un.m_asaHostArrays[(ptrdiff_t)0 - (1 + TSB_RESERVEDPOINTER_HOSTARRAY)];
}
inline void SetValueDestructor(tlsindextype iValueIndex, CTLSValueDestructor fvValue)
{
un.m_afnValueDestructors[-((ptrdiff_t)iValueIndex) - (1 + TSB_RESERVEDPOINTER__MAX)] = fvValue;
}
inline CTLSValueDestructor GetValueDestructor(tlsindextype iValueIndex) const
{
return un.m_afnValueDestructors[-((ptrdiff_t)iValueIndex) - (1 + TSB_RESERVEDPOINTER__MAX)];
}
private:
union
{
tlsvaluetype m_av_ValueDatas[1];
CTLSValueDestructor m_afnValueDestructors[1];
CTLSStorageArray *m_asaHostArrays[1];
} un;
};
//////////////////////////////////////////////////////////////////////////
// API declaration
class CThreadLocalStorage
{
public: // Safe methods
/*
* Implementation Note:
* Since the function is potentially slow and should not be frequently
* called anyway, there is no sense in creating additional overload without
* destructor parameter which would preserve current destructor procedure.
*/
static _OU_ALWAYSINLINE bool _OU_CONVENTION_API
/*bool */SetStorageValue(const HTLSKEY &hskStorageKey, tlsindextype iValueIndex, tlsvaluetype vValueData, CTLSValueDestructor fnValueDestructor=NULL)
{
bool bResult;
CTLSStorageBlock *psbStorageBlock = GetKeyStorageBlock(hskStorageKey);
if (psbStorageBlock)
{
psbStorageBlock->SetValueData(iValueIndex, vValueData);
psbStorageBlock->SetValueDestructor(iValueIndex, fnValueDestructor);
bResult = true;
}
else
{
bResult = AllocateAndSetStorageValue(hskStorageKey, iValueIndex, vValueData, fnValueDestructor);
}
return bResult;
}
static _OU_ALWAYSINLINE tlsvaluetype _OU_CONVENTION_API
/*tlsvaluetype */GetStorageValue(const HTLSKEY &hskStorageKey, tlsindextype iValueIndex)
{
tlsvaluetype vValueData = 0;
CTLSStorageBlock *psbStorageBlock = GetKeyStorageBlock(hskStorageKey);
if (psbStorageBlock)
{
vValueData = psbStorageBlock->GetValueData(iValueIndex);
}
return vValueData;
}
public: // Unsafe methods
static _OU_ALWAYSINLINE void _OU_CONVENTION_API
/*void */UnsafeSetStorageValue(const HTLSKEY &hskStorageKey, tlsindextype iValueIndex, tlsvaluetype vValueData)
{
CTLSStorageBlock *psbStorageBlock = GetKeyStorageBlock(hskStorageKey);
psbStorageBlock->SetValueData(iValueIndex, vValueData);
}
static _OU_ALWAYSINLINE tlsvaluetype _OU_CONVENTION_API
/*tlsvaluetype */UnsafeGetStorageValue(const HTLSKEY &hskStorageKey, tlsindextype iValueIndex)
{
CTLSStorageBlock *psbStorageBlock = GetKeyStorageBlock(hskStorageKey);
return psbStorageBlock->GetValueData(iValueIndex);
}
private:
static bool _OU_CONVENTION_API AllocateAndSetStorageValue(const HTLSKEYSELECTOR &hksKeySelector,
tlsindextype iValueIndex, tlsvaluetype vValueData, CTLSValueDestructor fnValueDestructor);
private:
friend class CTLSInitialization;
static inline void _OU_CONVENTION_API SetKeyStorageBlock(const HTLSKEYSELECTOR &hskStorageKey, CTLSStorageBlock *psbInstance)
{
#if _OU_TARGET_OS == _OU_TARGET_OS_WINDOWS
::TlsSetValue((DWORD)(size_t)(HTLSKEYVALUE::value_type)(*(HTLSKEYSELECTOR::value_type)hskStorageKey), (LPVOID)psbInstance);
#else // #if _OU_TARGET_OS != _OU_TARGET_OS_WINDOWS
pthread_setspecific((pthread_key_t)(size_t)(HTLSKEYVALUE::value_type)(*(HTLSKEYSELECTOR::value_type)hskStorageKey), (void *)psbInstance);
#endif // #if _OU_TARGET_OS == ...
}
static inline CTLSStorageBlock *_OU_CONVENTION_API GetKeyStorageBlock(const HTLSKEYSELECTOR &hskStorageKey)
{
#if _OU_TARGET_OS == _OU_TARGET_OS_WINDOWS
CTLSStorageBlock *psbStorageBlock = (CTLSStorageBlock *)::TlsGetValue((DWORD)(size_t)(HTLSKEYVALUE::value_type)(*(HTLSKEYSELECTOR::value_type)hskStorageKey));
#else // #if _OU_TARGET_OS != _OU_TARGET_OS_WINDOWS
CTLSStorageBlock *psbStorageBlock = (CTLSStorageBlock *)pthread_getspecific((pthread_key_t)(size_t)(HTLSKEYVALUE::value_type)(*(HTLSKEYSELECTOR::value_type)hskStorageKey));
#endif // #if _OU_TARGET_OS == ...
return psbStorageBlock;
}
};
//////////////////////////////////////////////////////////////////////////
// Initialization/finalization
class CTLSInitialization
{
public:
enum EINITIALIZATIONFLAGS
{
SIF_MANUAL_CLEANUP_ON_THREAD_EXIT = 0x00000001,
};
public:
// Initialization must be performed from main thread
static bool _OU_CONVENTION_API InitializeTLSAPI(HTLSKEY &hskOutStorageKey, tlsindextype iValueCount,
unsigned int uiInitializationFlags=0);
static void _OU_CONVENTION_API FinalizeTLSAPI();
static void _OU_CONVENTION_API CleanupOnThreadExit();
private:
static bool _OU_CONVENTION_API InitializeTLSAPIValidated(unsigned int uiInstanceKind,
tlsindextype iValueCount, unsigned int uiInitializationFlags);
static void _OU_CONVENTION_API FinalizeTLSAPIValidated(unsigned int uiInstanceKind);
};
END_NAMESPACE_OU();
#endif // #if _OU_FEATURE_SET >= _OU_FEATURE_SET_TLS
#endif // #ifndef _OU_THREADLOCALSTORAGE_H_INCLUDED

View File

@@ -0,0 +1,111 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#ifndef __OU_TYPEWRAPPER_H_INCLUDED
#define __OU_TYPEWRAPPER_H_INCLUDED
#include <ou/platform.h>
#include <ou/namespace.h>
BEGIN_NAMESPACE_OU();
template<typename ContainedType, const int Instance=0>
struct CTypeSimpleWrapper
{
public:
_OU_INLINE CTypeSimpleWrapper(): m_ctValue() {}
_OU_INLINE CTypeSimpleWrapper(const ContainedType &ctValue): m_ctValue(ctValue) {}
// _OU_INLINE CTypeSimpleWrapper(const CTypeSimpleWrapper &twOtherWrapper): m_ctValue(twOtherWrapper.m_ctValue) {} -- do not uncomment!!! in MSVC 6.0 optimization fails with it. :-/
typedef ContainedType value_type;
_OU_INLINE bool operator ==(const CTypeSimpleWrapper &twOtherWrapper) const { return m_ctValue == twOtherWrapper.m_ctValue; }
_OU_INLINE bool operator !=(const CTypeSimpleWrapper &twOtherWrapper) const { return !(operator ==(twOtherWrapper)); }
_OU_INLINE bool operator <(const CTypeSimpleWrapper &twOtherWrapper) const { return m_ctValue < twOtherWrapper.m_ctValue; }
_OU_INLINE bool operator >(const CTypeSimpleWrapper &twOtherWrapper) const { return twOtherWrapper.operator <(*this); }
_OU_INLINE bool operator <=(const CTypeSimpleWrapper &twOtherWrapper) const { return !(twOtherWrapper.operator <(*this)); }
_OU_INLINE bool operator >=(const CTypeSimpleWrapper &twOtherWrapper) const { return !(operator <(twOtherWrapper)); }
// _OU_INLINE operator bool() const { return !!m_ctValue; } -- casting to bool is too dangerous - it tends to be used instead of casting to int
_OU_INLINE bool operator !() const { return !m_ctValue; }
_OU_INLINE CTypeSimpleWrapper &operator =(const ContainedType &ctValue) { m_ctValue = ctValue; return *this; }
_OU_INLINE CTypeSimpleWrapper &operator =(const CTypeSimpleWrapper &twOtherWrapper) { m_ctValue = twOtherWrapper.m_ctValue; return *this; }
_OU_INLINE operator const ContainedType &() const { return m_ctValue; }
_OU_INLINE operator ContainedType &() { return m_ctValue; }
private:
ContainedType m_ctValue;
};
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator ==(const CTypeSimpleWrapper<ContainedType, Instance> &twLeftWrapper, const ContainedType &ctRightValue) { return (const ContainedType &)twLeftWrapper == ctRightValue; }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator ==(const ContainedType &ctLeftValue, const CTypeSimpleWrapper<ContainedType, Instance> &twRightWrapper) { return ctLeftValue == (const ContainedType &)twRightWrapper; }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator !=(const CTypeSimpleWrapper<ContainedType, Instance> &twLeftWrapper, const ContainedType &ctRightValue) { return !(twLeftWrapper == ctRightValue); }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator !=(const ContainedType &ctLeftValue, const CTypeSimpleWrapper<ContainedType, Instance> &twRightWrapper) { return !(ctLeftValue == twRightWrapper); }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator <(const CTypeSimpleWrapper<ContainedType, Instance> &twLeftWrapper, const ContainedType &ctRightValue) { return (const ContainedType &)twLeftWrapper < ctRightValue; }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator <(const ContainedType &ctLeftValue, const CTypeSimpleWrapper<ContainedType, Instance> &twRightWrapper) { return ctLeftValue < (const ContainedType &)twRightWrapper; }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator >(const CTypeSimpleWrapper<ContainedType, Instance> &twLeftWrapper, const ContainedType &ctRightValue) { return ctRightValue < twLeftWrapper; }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator >(const ContainedType &ctLeftValue, const CTypeSimpleWrapper<ContainedType, Instance> &twRightWrapper) { return twRightWrapper < ctLeftValue; }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator <=(const CTypeSimpleWrapper<ContainedType, Instance> &twLeftWrapper, const ContainedType &ctRightValue) { return !(ctRightValue < twLeftWrapper); }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator <=(const ContainedType &ctLeftValue, const CTypeSimpleWrapper<ContainedType, Instance> &twRightWrapper) { return !(twRightWrapper < ctLeftValue); }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator >=(const CTypeSimpleWrapper<ContainedType, Instance> &twLeftWrapper, const ContainedType &ctRightValue) { return !(twLeftWrapper < ctRightValue); }
template<typename ContainedType, const int Instance>
_OU_INLINE bool _OU_CONVENTION_API operator >=(const ContainedType &ctLeftValue, const CTypeSimpleWrapper<ContainedType, Instance> &twRightWrapper) { return !(ctLeftValue < twRightWrapper); }
END_NAMESPACE_OU();
#endif // #ifndef __OU_TYPEWRAPPER_H_INCLUDED

View File

@@ -0,0 +1,13 @@
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CXXFLAGS = -fno-exceptions -fno-rtti
AM_LDFLAGS = -fno-exceptions -fno-rtti
noinst_LTLIBRARIES = libou.la
libou_la_SOURCES = atomic.cpp \
customization.cpp \
malloc.cpp \
threadlocalstorage.cpp

View File

@@ -0,0 +1,598 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src/ou
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libou_la_LIBADD =
am_libou_la_OBJECTS = atomic.lo customization.lo malloc.lo \
threadlocalstorage.lo
libou_la_OBJECTS = $(am_libou_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/../depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
am__v_CXX_0 = @echo " CXX " $@;
am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
SOURCES = $(libou_la_SOURCES)
DIST_SOURCES = $(libou_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/../depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
OU_FEATURE_SET = @OU_FEATURE_SET@
OU_NAMESPACE = @OU_NAMESPACE@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CXXFLAGS = -fno-exceptions -fno-rtti
AM_LDFLAGS = -fno-exceptions -fno-rtti
noinst_LTLIBRARIES = libou.la
libou_la_SOURCES = atomic.cpp \
customization.cpp \
malloc.cpp \
threadlocalstorage.cpp
all: all-am
.SUFFIXES:
.SUFFIXES: .cpp .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/ou/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/ou/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libou.la: $(libou_la_OBJECTS) $(libou_la_DEPENDENCIES) $(EXTRA_libou_la_DEPENDENCIES)
$(AM_V_CXXLD)$(CXXLINK) $(libou_la_OBJECTS) $(libou_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/customization.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadlocalstorage.Plo@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.lo:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,445 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#include <ou/features.h>
#if _OU_FEATURE_SET >= _OU_FEATURE_SET_ATOMICS
#include <ou/atomic.h>
#include <ou/assert.h>
#include <ou/namespace.h>
BEGIN_NAMESPACE_OU();
#if !defined(__OU_ATOMIC_PTR_FUNCTIONS_DEFINED)
//////////////////////////////////////////////////////////////////////////
// Implementation via mutex locks
#if !defined(__OU_ATOMIC_INITIALIZATION_FUNCTIONS_REQUIRED)
#error Internal error (Atomic-via-mutex implementations can not appear without initialization)
#endif // #if !defined(__OU_ATOMIC_INITIALIZATION_FUNCTIONS_DEFINED)
END_NAMESPACE_OU();
#include <pthread.h>
#include <errno.h>
#if !defined(EOK)
#define EOK 0
#endif
BEGIN_NAMESPACE_OU();
static unsigned int g_uiAtomicAPIInitializationCount = 0;
#define _OU_ATOMIC_MUTEX_COUNT 8
#define _OU_ATOMIC_MUTES_INDEX_SHIFT 3 // Shift by 3 bits as 8 bytes is a common memory alignment
#define _OU_ATOMIC_MUTEX_INDEX_MASK (_OU_ATOMIC_MUTEX_COUNT - 1)
// Mutexes array is used to distribute load over multiple mutexes
static pthread_mutex_t g_apmAtomicMutexes[_OU_ATOMIC_MUTEX_COUNT];
static inline unsigned int DeriveAtomicMutexIndex(void *pv_Destination)
{
return ((unsigned int)(size_t)pv_Destination >> _OU_ATOMIC_MUTES_INDEX_SHIFT) & _OU_ATOMIC_MUTEX_INDEX_MASK;
}
//////////////////////////////////////////////////////////////////////////
// Atomic ord32 functions implementation
#if !defined(__OU_ATOMIC_ORD32_FUNCTIONS_DEFINED)
/*extern*/ atomicord32 AtomicIncrement(volatile atomicord32 *paoDestination)
{
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)paoDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicord32 aoNewValue = ++(*paoDestination);
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
atomicord32 aoResult = aoNewValue;
return aoResult;
}
/*extern*/ atomicord32 AtomicDecrement(volatile atomicord32 *paoDestination)
{
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)paoDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicord32 aoNewValue = --(*paoDestination);
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
atomicord32 aoResult = aoNewValue;
return aoResult;
}
/*extern*/ atomicord32 AtomicExchange(volatile atomicord32 *paoDestination, atomicord32 aoExchange)
{
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)paoDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicord32 aoOldValue = *paoDestination;
*paoDestination = aoExchange;
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
atomicord32 aoResult = aoOldValue;
return aoResult;
}
/*extern*/ atomicord32 AtomicExchangeAdd(volatile atomicord32 *paoDestination, atomicord32 aoAddend)
{
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)paoDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicord32 aoOldValue = *paoDestination;
*paoDestination += aoAddend;
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
atomicord32 aoResult = aoOldValue;
return aoResult;
}
/*extern*/ bool AtomicCompareExchange(volatile atomicord32 *paoDestination, atomicord32 aoComparand, atomicord32 aoExchange)
{
bool bResult = false;
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)paoDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicord32 aoOldValue = *paoDestination;
if (aoOldValue == aoComparand)
{
*paoDestination = aoExchange;
bResult = true;
}
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
return bResult;
}
/*extern*/ atomicord32 AtomicAnd(volatile atomicord32 *paoDestination, atomicord32 aoBitMask)
{
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)paoDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicord32 aoOldValue = *paoDestination;
*paoDestination &= aoBitMask;
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
atomicord32 aoResult = aoOldValue;
return aoResult;
}
/*extern*/ atomicord32 AtomicOr(volatile atomicord32 *paoDestination, atomicord32 aoBitMask)
{
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)paoDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicord32 aoOldValue = *paoDestination;
*paoDestination |= aoBitMask;
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
atomicord32 aoResult = aoOldValue;
return aoResult;
}
/*extern*/ atomicord32 AtomicXor(volatile atomicord32 *paoDestination, atomicord32 aoBitMask)
{
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)paoDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicord32 aoOldValue = *paoDestination;
*paoDestination ^= aoBitMask;
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
atomicord32 aoResult = aoOldValue;
return aoResult;
}
#endif // #if !defined(__OU_ATOMIC_ORD32_FUNCTIONS_DEFINED)
//////////////////////////////////////////////////////////////////////////
// Atomic pointer functions implementation
/*extern*/ atomicptr AtomicExchangePointer(volatile atomicptr *papDestination, atomicptr apExchange)
{
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)papDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicptr apOldValue = *papDestination;
*papDestination = apExchange;
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
atomicptr apResult = apOldValue;
return apResult;
}
/*extern*/ bool AtomicCompareExchangePointer(volatile atomicptr *papDestination, atomicptr apComparand, atomicptr apExchange)
{
bool bResult = false;
const unsigned int uiMutexIndex = DeriveAtomicMutexIndex((void *)papDestination);
pthread_mutex_t *ptmMutexToBeUsed = g_apmAtomicMutexes + uiMutexIndex;
int iLockResult = pthread_mutex_lock(ptmMutexToBeUsed);
OU_CHECK(iLockResult == EOK);
const atomicptr apOldValue = *papDestination;
if (apOldValue == apComparand)
{
*papDestination = apExchange;
bResult = true;
}
int iUnlockResult = pthread_mutex_unlock(ptmMutexToBeUsed);
OU_CHECK(iUnlockResult == EOK);
return bResult;
}
//////////////////////////////////////////////////////////////////////////
// Atomic initialization functions implementation
static void FreeAtomicMutexes(unsigned int nLastMutexIndex=0)
{
const unsigned int nMutexCount = nLastMutexIndex == 0 ? _OU_ATOMIC_MUTEX_COUNT : nLastMutexIndex;
for (unsigned int nMutexIndex = 0; nMutexIndex != nMutexCount; ++nMutexIndex)
{
int iMutexDestroyResult = pthread_mutex_destroy(g_apmAtomicMutexes + nMutexIndex);
OU_VERIFY(iMutexDestroyResult == EOK); // Ignore the error
}
}
static bool CreateAtomicMutexesWithAttributes(pthread_mutexattr_t *pmaMutexAttributes)
{
const unsigned int nMutexCount = _OU_ATOMIC_MUTEX_COUNT;
unsigned int nMutexIndex = 0;
for (; nMutexIndex != nMutexCount; ++nMutexIndex)
{
int iMutexInitResult = pthread_mutex_init(g_apmAtomicMutexes + nMutexIndex, pmaMutexAttributes);
if (iMutexInitResult != EOK)
{
if (nMutexIndex != 0)
{
FreeAtomicMutexes(nMutexIndex);
}
break;
}
}
bool bResult = nMutexIndex == nMutexCount;
return bResult;
}
static bool CreateAtomicMutexes()
{
bool bResult = false;
pthread_mutexattr_t maMutexAttributes;
int iAttrInitResult = pthread_mutexattr_init(&maMutexAttributes);
if (iAttrInitResult == EOK)
{
bResult = CreateAtomicMutexesWithAttributes(&maMutexAttributes);
int iAttrDestroyResult = pthread_mutexattr_destroy(&maMutexAttributes);
OU_VERIFY(iAttrDestroyResult == EOK); // Ignore error
}
return bResult;
}
static bool InitializeAtomicAPIValidated()
{
bool bResult = false;
do
{
if (!CreateAtomicMutexes())
{
break;
}
bResult = true;
}
while (false);
return bResult;
}
static void FinalizeAtomicAPIValidated()
{
FreeAtomicMutexes();
}
/*extern*/ bool InitializeAtomicAPI()
{
OU_ASSERT(g_uiAtomicAPIInitializationCount != 0U - 1U);
bool bResult = false;
do
{
if (g_uiAtomicAPIInitializationCount == 0) // Initialization/finalization must be called from main thread
{
if (!InitializeAtomicAPIValidated())
{
break;
}
}
++g_uiAtomicAPIInitializationCount;
bResult = true;
}
while (false);
return bResult;
}
/*extern*/ void FinalizeAtomicAPI()
{
OU_ASSERT(g_uiAtomicAPIInitializationCount != 0U);
if (--g_uiAtomicAPIInitializationCount == 0) // Initialization/finalization must be called from main thread
{
FinalizeAtomicAPIValidated();
}
}
#else // #if defined(__OU_ATOMIC_PTR_FUNCTIONS_DEFINED)
#if !defined(__OU_ATOMIC_ORD32_FUNCTIONS_DEFINED)
#error Internal error (Atomic ord32 functions can not be undefined while pointer functions are defined)
#endif // #if !defined(__OU_ATOMIC_ORD32_FUNCTIONS_DEFINED)
#if defined(__OU_ATOMIC_INITIALIZATION_FUNCTIONS_REQUIRED)
#error Internal error (Atomic initialization can not be required while atomic functions are defined)
#endif // #if defined(__OU_ATOMIC_INITIALIZATION_FUNCTIONS_REQUIRED)
#endif // #if !defined(__OU_ATOMIC_PTR_FUNCTIONS_DEFINED)
END_NAMESPACE_OU();
#endif // #if _OU_FEATURE_SET >= _OU_FEATURE_SET_ATOMICS

View File

@@ -0,0 +1,64 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#include <ou/customization.h>
BEGIN_NAMESPACE_OU();
#if !defined(__FILE__)
// Definition of __FILE__ constant for the case if compiler does not support the macro
/*extern*/ const char *const __FILE__ = "<filename unavailable>";
#endif // #if !defined(__FILE__)
#if !defined(__LINE__)
// Definition of __LINE__ constant for the case if compiler does not support the macro
extern const unsigned int __LINE__ = 0;
#endif // #if !defined(__LINE__)
//////////////////////////////////////////////////////////////////////////
/*extern*/ CAssertionFailedProcedure CAssertionCheckCustomization::g_fnAssertFailureHandler = NULL;
//////////////////////////////////////////////////////////////////////////
/*extern*/ CMemoryAllocationProcedure CMemoryManagerCustomization::g_fnMemoryAllocationProcedure = NULL;
/*extern*/ CMemoryReallocationProcedure CMemoryManagerCustomization::g_fnMemoryReallocationProcedure = NULL;
/*extern*/ CMemoryDeallocationProcedure CMemoryManagerCustomization::g_fnMemoryDeallocationProcedure = NULL;
END_NAMESPACE_OU();

View File

@@ -0,0 +1,106 @@
/*************************************************************************
* *
* ODER's Utilities Library. Copyright (C) 2008-2024 Oleh Derevenko. *
* All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 3 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL *
* the text of GNU General Public License is also provided for *
* your information in file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* (3) The zlib/libpng license that is included with this library in *
* the file LICENSE-ZLIB.TXT *
* *
* This library is distributed WITHOUT ANY WARRANTY, including implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT *
* or LICENSE-ZLIB.TXT for more details. *
* *
*************************************************************************/
#include <ou/malloc.h>
#include <ou/assert.h>
#include <ou/customization.h>
#include <ou/macros.h>
#if _OU_TARGET_OS == _OU_TARGET_OS_MAC || _OU_TARGET_OS == _OU_TARGET_OS_IOS
#include <stdlib.h>
#else // #if _OU_TARGET_OS != _OU_TARGET_OS_MAC && _OU_TARGET_OS != _OU_TARGET_OS_IOS
#include <malloc.h>
#endif // #if _OU_TARGET_OS != _OU_TARGET_OS_MAC && _OU_TARGET_OS != _OU_TARGET_OS_IOS
BEGIN_NAMESPACE_OU();
/*extern*/ void *_OU_CONVENTION_API AllocateMemoryBlock(size_t nBlockSize)
{
void *pv_NewBlock;
CMemoryAllocationProcedure fnMemoryAllocationProcedure = CMemoryManagerCustomization::GetMemoryAllocationCustomProcedure();
if (fnMemoryAllocationProcedure)
{
pv_NewBlock = fnMemoryAllocationProcedure(nBlockSize);
OU_ASSERT(OU_ALIGNED_SIZE((size_t)pv_NewBlock, _OU_MEMORY_REQUIRED_ALIGNMENT) == (size_t)pv_NewBlock); // Memory must be aligned
}
else
{
pv_NewBlock = malloc(nBlockSize);
}
return pv_NewBlock;
}
/*extern*/ void *_OU_CONVENTION_API ReallocateMemoryBlock(void *pv_ExistingBlock, size_t nNewBlockSize)
{
OU_ASSERT(OU_ALIGNED_SIZE((size_t)pv_ExistingBlock, _OU_MEMORY_REQUIRED_ALIGNMENT) == (size_t)pv_ExistingBlock); // Memory must be aligned
void *pv_NewBlock;
CMemoryReallocationProcedure fnMemoryReallocationProcedure = CMemoryManagerCustomization::GetMemoryReallocationCustomProcedure();
if (fnMemoryReallocationProcedure)
{
pv_NewBlock = fnMemoryReallocationProcedure(pv_ExistingBlock, nNewBlockSize);
OU_ASSERT(OU_ALIGNED_SIZE((size_t)pv_NewBlock, _OU_MEMORY_REQUIRED_ALIGNMENT) == (size_t)pv_NewBlock); // Memory must be aligned
}
else
{
pv_NewBlock = realloc(pv_ExistingBlock, nNewBlockSize);
}
return pv_NewBlock;
}
/*extern*/ void _OU_CONVENTION_API FreeMemoryBlock(void *pv_ExistingBlock)
{
OU_ASSERT(OU_ALIGNED_SIZE((size_t)pv_ExistingBlock, _OU_MEMORY_REQUIRED_ALIGNMENT) == (size_t)pv_ExistingBlock); // Memory must be aligned
CMemoryDeallocationProcedure fnMemoryDeallocationProcedure = CMemoryManagerCustomization::GetMemoryDeallocationCustomProcedure();
if (fnMemoryDeallocationProcedure)
{
fnMemoryDeallocationProcedure(pv_ExistingBlock);
}
else
{
free(pv_ExistingBlock);
}
}
END_NAMESPACE_OU();

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CXXFLAGS = -fno-exceptions -fno-rtti
AM_LDFLAGS = -fno-exceptions -fno-rtti
check_PROGRAMS = outest
outest_SOURCES = outest.cpp
outest_LDADD = $(top_builddir)/src/ou/libou.la

View File

@@ -0,0 +1,589 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
check_PROGRAMS = outest$(EXEEXT)
subdir = test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am_outest_OBJECTS = outest.$(OBJEXT)
outest_OBJECTS = $(am_outest_OBJECTS)
outest_DEPENDENCIES = $(top_builddir)/src/ou/libou.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/../depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
am__v_CXX_0 = @echo " CXX " $@;
am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
SOURCES = $(outest_SOURCES)
DIST_SOURCES = $(outest_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/../depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
OU_FEATURE_SET = @OU_FEATURE_SET@
OU_NAMESPACE = @OU_NAMESPACE@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CXXFLAGS = -fno-exceptions -fno-rtti
AM_LDFLAGS = -fno-exceptions -fno-rtti
outest_SOURCES = outest.cpp
outest_LDADD = $(top_builddir)/src/ou/libou.la
all: all-am
.SUFFIXES:
.SUFFIXES: .cpp .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign test/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
outest$(EXEEXT): $(outest_OBJECTS) $(outest_DEPENDENCIES) $(EXTRA_outest_DEPENDENCIES)
@rm -f outest$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(outest_OBJECTS) $(outest_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/outest.Po@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.lo:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

9027
thirdparty/ode-0.16.5/ou/test/outest.cpp vendored Normal file

File diff suppressed because it is too large Load Diff