diff --git a/deps/acelite/ACE-INSTALL.html b/deps/acelite/ACE-INSTALL.html new file mode 100644 index 000000000..c05056712 --- /dev/null +++ b/deps/acelite/ACE-INSTALL.html @@ -0,0 +1,3231 @@ + + + Building and Installing ACE and Its Auxiliary Libraries and Services + + + + + + + + +
+

Building and Installing ACE and Its Auxiliary Libraries and Services

+ +

Synopsis

+ +The file explains how to build and install ACE, its Network Services, +test suite and examples on the various OS platforms and compilers that +it has been ported to. Please consult the NEWS and +ChangeLogs files to see whether any recent changes +to the release will affect your code. In addition, you should check +out our development +process. As you start working with ACE, we suggest you get copies +of the C++NPv1, C++NPv2, and +APG books to help +guide you after you've built and installed ACE. You should also +consult the ACE +Frequently Made Mistakes page. If you encounter any problems or +would like to request an enhancement, then use github + to submit an issue in accordance with our bug +report process.

+ +

Document Index

+ + + + +


+

Platforms, C++ Compilers, and Support

+ +

ACE has been ported to a large number of platforms using many different +compilers over the years. +The DOC group, +Riverace, +OCI, +Remedy IT, and members of the ACE +user community have all contributed ports to make ACE the successful +and far-reaching toolkit it is today. Any UNIX/POSIX/Windows +variation is probably an easy target platform for ACE. If you have +porting questions or have a problem +compiling the ACE source distribution, please contact one of the +commercial support companies, or send a copy of the +PROBLEM-REPORT-FORM, located in the +ACE_wrappers directory to ace-users +mailing list or create a github issue. +The DOC groups at Washington University, UC Irvine, and Vanderbilt +University provide only "best effort" support for non-sponsors for the +latest release, as described in +docs/ACE-bug-process.html. +Thus, if you need more "predictable" help, or help with earlier versions of +ACE, it's recommend that you check out the +list of +commercial support companies for additional assistance. +

+

The responsibility for maintaining ACE across the wide range of +supported platforms is divided among a few different groups: +

+The +build scoreboard +records the current status of build and regression testing during +development by all of the above groups. It is available to all users wishing +to provide build results. Members of the ACE community that maintain ACE on +platforms not maintained by the DOC group, Riverace, OCI, or Remedy IT are +encouraged to provide build and regression test results for the scoreboard +to ensure that all in-use platforms are represented. +See the autobuild README for more information about +how to set up a build; contact one of the above groups to inquire about how +to get your build results recorded on the scoreboard.

+

Because older +platforms that are not maintained tend to fall into a broken state and +clutter the ACE sources with code that is no longer used, the development +team reserves the right to remove ACE configuration files and source code +specific to inactive platform configurations that are not +listed on the scoreboard.

+

The table below summarizes each group's role and where you can get more +detailed information. For information on TAO's platform coverage and +support, please also see TAO's install +document.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Groups Involved in ACE Development and Support
GroupPlatformsFor more information
DOC Group + DOC sites at ISIS, + UCI and + Washington University +
RiveraceOffers ACE + training, + support and + consulting services + for many platforms including AIX, HP-UX, Linux, Solaris, and Windows. + Riverace's ACE + Support page.
OCIMaintains ACE on certain platforms required for their TAO + software and service offerings. + + OCI's web site, + TAO page, + and the TAO install document
Remedy ITMaintains ACE on many platforms required for their ACE and + TAO service offerings. We support AIX, + Embarcadero C++ Builder, + Windows CE, MinGW, Microsoft Visual C++, GCC, + Cygwin, VxWorks 6.x (kernel and rtp), OpenVMS on IA64, + BlueCAT Linux, RedHat Linux, Fedora, MacOSX, Solaris, + Tru64, SuSE Linux on Alpha/IA32/EM64T/IA64, RTEMS, QNX, LynxOS, + HPUX on IA64, and Android. + The Intel C++ compiler is supported on + Windows 32/64bit, Linux IA32/EM64T/IA64, MacOSX. + Remedy IT web site and + the TAO install document +
PrismTechMaintains ACE on certain platforms required for their TAO + software and service offerings, including LynxOS. + PrismTech's web site
ACE user communityResponsible for continued maintenance and testing of platforms + to which ACE has been ported, but aren't supported by the + above groups. These include + Digital UNIX (Compaq Tru64) 4.0 and 5.0; + IRIX 6.x; UnixWare 7.1.0; + Linux on PPC; OpenMVS; + Tandem; SCO; FreeBSD; NetBSD; OpenBSD; + Macintosh OS X; OS/9; PharLap ETS 13; + QNX RTP and Neutrino 2.0; Interix (Windows Services for Unix) +
Not maintainedThe following platforms have been ported to in the past but are + no longer maintained and may be removed from ACE at any time. + If you want to have support for these environments contact one + of the commercial support organisations. The platforms include: + Chorus; DG/UX; HP-UX 9, 10 and 11.00; pSOS; + SunOS 4.x and Solaris with SunC++ 4.x; VxWorks 5.4 and earlier; + Microsoft Visual C++ 5, 6, and 7.0; Borland C++ Builder 4, 5, 6, and 2006. + For up-to-date listings on platform that are deprecated and pending + removal from ACE, please see the NEWS file. +

+ +

Although the DOC group has provided outstanding support for ACE +over the years, ACE's success has greatly increased the amount of +effort required to keep up with its maintenance, answer users' +questions, and give design guidance. Riverace offers world-class +commercial services to support ACE users. OCI, PrismTech, and Remedy +offer similar services for ACE and TAO, allowing the DOC group's primary focus +to shift back to their main goal: research. The DOC group is +fundamentally focused on (and funded +by) advanced R&D projects. The group continues to be +intimately involved in ACE+TAO development and maintenance, but with +revised priorities for maintenance. The bug +fixing policies followed by the DOC group are designed to strike a +balance between their many research +projects and their commitment to the ACE+TAO user +community. Naturally, we will be happy to accept well-tested +patches from the ACE+TAO user community for any platforms that aren't +supported by the DOC group, Riverace, OCI or Remedy IT.

+ +


+

Installation prerequisites

+ +

ACE (as well as TAO and CIAO) use MPC +(MakeProjectCreator) to generate files used by all supported build +tools (such as GNUmakefiles for UNIX based platforms, sln and vcproj +files for Visual Studio and Embarcadero makefiles) on various platforms. To +help new users to bootstrap quickly the release bundles of ACE (as +well as TAO) include all needed files to use the build +instructions in this document. + +

+

+If it is necessary to generate +files for build tools for other compilers, one must +run MPC to generate the +appropriate files. Please see USAGE, README, and README for ACE files for +details. The options that have been used to generate the above build +files can be found in +global.features file. +

+ +
+

Building and Installing ACE

+ +The following sections explain how to build ACE on: + + +

General Rules

+ + +
+

Building and Installing ACE on UNIX

+ +As of ACE 6.0.6, you can building ACE on +UNIX with: +
    +
  1. Traditional ACE/GNU Make Configuration
  2. +
+The build process for Windows is different from +the UNIX methods. + +

Using the Traditional ACE/GNU Configuration

+

+Here's what you need to do to build ACE using GNU Make and ACE's traditional +per-platform configuration method:

+ +
    +
  1. Install GNU make + 3.79.1 or greater on your system (available via http + anonymous ftp from ftp.gnu.org in the + pub/gnu/make/ directory). + You must use GNU make when using ACE's traditional + per-platform configuration method or ACE won't compile. +
  2. +
  3. Add an environment variable called ACE_ROOT that contains the + name of the root of the directory where you keep the ACE wrapper + source tree. The ACE recursive Makefile scheme needs this information. + There are several ways to set the ACE_ROOT variable. For example: +
    + TSCH/CSH: + setenv ACE_ROOT /home/cs/faculty/schmidt/ACE_wrappers +
    +
    + BASH or Bourne Shell: + export ACE_ROOT=/home/cs/faculty/schmidt/ACE_wrappers + +
    +

    + If you're building a number of versions of ACE, however, (e.g., for + different OS platforms or for different releases of ACE) you might use + the following approach (assuming TCSH/CSH): +

    + setenv ACE_ROOT $cwd +
    +
  4. +
  5. Create a configuration file, $ACE_ROOT/ace/config.h, + that includes the appropriate platform/compiler-specific + header configurations from the ACE source directory. For example: +
    +#include "ace/config-linux.h" +
    + The platform/compiler-specific configuration file + contains the #defines that are used throughout ACE to indicate + which features your system supports. See the + $ACE_ROOT/ace/README file for a description of these + macro settings. If you desire to add some site-specific or build-specific + changes, you can add them to your config.h file; place them + before the inclusion of the platform-specific + header file. +

    + There are config files for most versions of UNIX. If there + isn't a version of this file that matches your + platform/compiler, you'll need to make one. Please send email + to the ace-users list + if you get it working so it can be added to the master ACE + release.

    +
  6. + +
  7. Create a build configuration file, + $ACE_ROOT/include/makeinclude/platform_macros.GNU, + that contains the appropriate platform/compiler-specific + Makefile configurations, e.g., +
    +include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU +
    + This file contains the compiler and Makefile directives that are + platform/compiler-specific. If you'd like to add make options, you + can add them before including the platform-specific configuration.

    + NOTE! There really is not a # character before 'include' in the + platform_macros.GNU file. # is a comment character. +

  8. +
  9. If you wish to install ACE (using "make install"), set the + installation prefix in platform_macros.GNU. +
    +INSTALL_PREFIX = /usr/local +
    + Headers will be installed to $INSTALL_PREFIX/include, executables to + $INSTALL_PREFIX/bin, documentation and build system files to + $INSTALL_PREFIX/share and libraries to $INSTALL_PREFIX/lib. The library + directory can be customized by setting INSTALL_LIB (for example, + INSTALL_LIB=lib64). With INSTALL_PREFIX set, RPATH will be enabled for + all executables and shared libraries. To disable RPATH (for example, + if $INSTALL_PREFIX/$INSTALL_LIB is already a system-known location for + shared libraries such as those listed in /etc/ld.so.conf), set the make + macro install_rpath to 0 by adding install_rpath=0 to platform_macros.GNU. +
  10. +
  11. Note that because ACE builds shared libraries, you'll need to set + LD_LIBRARY_PATH (or equivalent for your platform) to the directory + where binary version of the ACE library is built into. For example, + you probably want to do something like the following: +
    + % setenv LD_LIBRARY_PATH $ACE_ROOT/lib:$LD_LIBRARY_PATH
    + + or +
    + % export LD_LIBRARY_PATH=$ACE_ROOT/lib:$LD_LIBRARY_PATH
    + +
  12. +
  13. When all this is done, hopefully all you'll need to do is type: +
    + % make
    + at the ACE_ROOT directory. This will build the ACE + library, tests, the examples, and the sample applications. + Building the entire ACE release can take a long time and consume + lots of disk space, however. Therefore, you might consider + cd'ing into the $ACE_ROOT/ace directory and + running make there to build just the ACE library. + As a sanity check, you might also want to build and run the + automated "one-button" tests in + $ACE_ROOT/tests. Finally, if you're also + planning on building TAO, you + should build the gperf + perfect hash function generator application in + $ACE_ROOT/apps/gperf. +
  14. +
  15. If you've set the INSTALL_PREFIX before building, now run +
    % make install
    +
  16. +
  17. If you need to regenerate the ace/Svc_Conf_y.cpp file, + you'll need to + get GNU Bison. + However, you should rarely, if ever, need to do this. +
  18. +
+ +
+ +

Building and Installing ACE on Windows

+ +

This section contains instructions for building ACE on Microsoft +Windows with a variety of compilers and development environments.

+ +

First, if you are upgrading from an older release, the recommended practice +is to start with a clean directory. Unpacking the newer release over an older +one will not clean up any old files, and trying to use the environment's +"Clean" command will probably not account for all existing files.

+ +

For using MPC and our perl based test framework we recommend +our windows users to use Active +State Perl or Strawberry Perl

+ + + +


+

Building and Installing ACE on Windows with +Microsoft Visual Studio

+ +

ACE contains project files for +Visual Studio 2015 (vc14), Visual Studio 2017 (vc141), and Visual Studio 2019 (vc142). +Visual Studio 2015/2017/2019 use different file formats but the same file +suffixes (.sln and .vcproj). To support both +environments, ACE supplies files with different names for the different +development and target platforms. The platform/name mapping is shown below. +All solution files have a .sln suffix and all project files have +a .vcproj suffix.

+ + + + + + + + + + + + + + + + + + + + + +
Mapping of Platform to Solution/Project File Name
PlatformFile Name
Visual Studio 2015name_vc14 +
Visual Studio 2017name_vs2017 +
Visual Studio 2019name_vs2019 +
+ +

The VC++ compiler and linker can now be invoked from GNU make just like +most UNIX builds. Follow the instructions in the +ACE/GNU Configuration sections and see the additional information in the +comments of +platform_win32_msvc.GNU. +

+ +

If you happen to open an older file Visual Studio solution from a newer one, it will offer to convert +the file to the newer format for you + +

    +
  1. Uncompress the ACE distribution into a directory, where it will + create a ACE_wrappers directory containing the distribution. The + ACE_wrappers directory will be referred to as ACE_ROOT in the + following steps -- so ACE_ROOT\ace would be C:\ACE_wrappers\ace if + you uncompressed into the root directory.
    +
    +
  2. Create a file called config.h in the ACE_ROOT\ace + directory that contains:
    +
    + #include "ace/config-win32.h"
    +
    + +
  3. The static, DLL and MFC library builds are kept in + different workspaces. Files with names *_Static contain project + files for static builds. Workspaces for static and DLL builds will be + available through the stock release at DOC group's website. The + workspaces for MFC are not available and have to be generated using + MPC. Please see MPC's README for + details.

    +
  4. Now load the solution file for ACE (ACE_ROOT/ACE.sln).
    +
    +
  5. Make sure you are building the configuration (i.e, Debug/Release) + the one you'll use (for example, the debug tests need the debug + version of ACE, and so on). All these different configurations are + provided for your convenience. You can either adopt the scheme to + build your applications with different configurations, or use + ace/config.h to tweak with the default settings on + NT.
    Note: If you use the dynamic libraries, + make sure you include ACE_ROOT\lib in your PATH whenever you run + programs that uses ACE. Otherwise you may experience problems + finding ace.dll or aced.dll.
    +
    +
  6. To use ACE with MFC libraries, also add the following to + your config.h file. Notice that if you want to + spawn a new thread with CWinThread, make sure you spawn the + thread with THR_USE_AFX flag set.
    +
    + #define ACE_HAS_MFC 1
    +
    + By default, all of the ACE projects use the DLL versions of the + MSVC run-time libraries. You can still choose use the static (LIB) + versions of ACE libraries regardless of run-time libraries. The + reason we chose to link only the dynamic run-time library is that + almost every NT box has these library installed and to save disk + space. If you prefer to link MFC as a static library into ACE, you + can do this by defining ACE_USES_STATIC_MFC in your + config.h file. However, if you would like to link + everything (including the MSVC run-time libraries) statically, + you'll need to modify the project files in ACE yourself.

    +

  7. Static version of ACE libraries are built with + ACE_AS_STATIC_LIBS
    defined. This macro should + also be used in application projects that link to static ACE + libraries
    +
    + Optionally you can also add the line
    +
    + #define ACE_NO_INLINE
    +
    + before the #include statement in ACE_ROOT\ace\config.h to disable + inline function and reduce the size of static libraries (and your + executables.)
    +
    +
  8. ACE DLL and LIB naming scheme:
    +
    + We use the following rules to name the DLL and LIB files in ACE + when using MSVC.
    +
    + "Library/DLL name" + (Is static library ? "s" : + "") + (Is Debugging enable ? "d" : "") + + {".dll"|".lib"}
    +
    +
+ +

More information for ACE/TAO on MSVC can be found +here. The doxygen version of this +document is available under Related Topics in the ACE Library.

+ +ACE TESTS

+ +The tests are located in ACE_ROOT\tests. There is also a solution in +that directory to build all the tests (tests.sln)

+ +Once you build all the tests (Batch Build works well for this), you +can run perl script run_test.pl in the +tests directory to try all the tests.

+ + + BUILDING ACE ON A WIN32 MACHINE THAT LACKS A NETWORK CARD

+ +You may want to run ACE on a non-networked machine. To do so, you must +install TCP/IP and configure it to ignore the absence of a network +card. This is one method: + +

    +
  1. Run Control Panel +
  2. Choose Network from Control Panel +
  3. Add Adapter: MS Loopback Adapter +
  4. Configure MS Loopback Adapter with 802.3 (default) +
  5. Add Protocol: TCP/IP Protocol +
  6. Configure TCP/IP Protocol with a valid IP address and subnet mask. + Leave everything else at the default settings. +
  7. Add Service: Workstation +
  8. Exit and Restart System +
  9. Run Control Panel again +
  10. Choose Services from Control Panel +
  11. The following services are not necessary and may + be set to Disabled Startup:
    + Alerter
    + Computer Browser
    + Net logon
    + Messanger
    +
  12. Choose Network from Control Panel +
  13. Confirm the following setup. This is all you need to run ACE:
    + Installed Software:
    + Computer Browser
    + MS Loopback Adapter Driver
    + TCP/IP Protocol
    + Workstation
    + Installed Adapter Cards:
    + MS Loopback Adapter

    +

+ +

 

+

Building and Installing ACE on Windows with Embarcadero C++

+ +If you are building for a machine without a network card, you may want +to check here first.

+ +

    +
  1. Uncompress the ACE distribution into a directory, where it will + create an + ACE_wrappers directory containing the source. The ACE_wrappers + directory will be referred to as ACE_ROOT in the following steps -- so + ACE_ROOT\ace would be C:\ACE_wrappers\ace when you uncompressed into the + root directory.
    +
    +
  2. Create a file called config.h in the ACE_ROOT\ace + directory that contains at least:
    +
    + #include "ace/config-win32.h"
    +
    +
  3. Open a RAD Studio Command Prompt.
    +
    +
  4. Set the ACE_ROOT environment variable to point to the ACE_wrappers + directory. For example:
    +
    + set ACE_ROOT=C:\ACE_wrappers
    +
    +
  5. Add ACE_wrappers\lib and ACE_wrappers\bin to the PATH environment variable:
    +
    + set PATH=%ACE_ROOT%\lib;%ACE_ROOT%\bin;%PATH%
    +
    +
  6. Change to the ACE_ROOT\ace directory.
    +
    + cd %ACE_ROOT%\ace
    +
    +
  7. Generate the bmake makefiles using MPC. Use the bmake project type for C++ Builder:
    +
    + %ACE_ROOT%\bin\mwc.pl -type bmake
    +
    +
  8. You can build several different versions of ACE by setting the following optional environment + variables before you run make:
    +
    + Set the environment variable below to build a debug version of ACE
    + set DEBUG=1
    +
    + Set the environment variable below to build a unicode version of ACE
    + set UNICODE=1
    +
    + Set the environment variable below to build a version of ACE with + Codeguard support. Should only be used when DEBUG is also set
    + set CODEGUARD=1
    +
    + By default we are using the clang based compilers. At the moment you + want to compile using the old bcc32 compiler set the CLASIC environment variable
    + set CLASSIC=1
    +
    + Set the environment variable below to build a version of ACE optimized + for a certain CPU. For this there are special compiler flags + (-3/-4/-5/-6), see the Embarcadero help for more info.
    + set CPU_FLAG=-6
    +
    + You can then start the build with the command +
    make -f Makefile.bmak all
    +
    + You may also enable the options by passing them as command line options to make, for example:
    + make -f Makefile.bmak -DDEBUG all
    +
    +
  9. Build ACE by doing:
    +
    + make -f Makefile.bmak all
    +
    +
+ +

+ +Note that when you run make in a sub directory you give make -f Makefile.bmak all. The all is needed to make sure the complete project is build.

+ +The C++ Builder port has been done by Jody Hagins, Christopher Kohlhoff and Johnny Willemsen.

+ +ACE TESTS

+ +Before you can build the tests you need to build the protocols directory. +Change the directory to ACE_ROOT\protocols and start:

+

+%ACE_ROOT%\bin\mwc.pl -type bmake
+make -f Makefile.bmak all +

+ +The tests are located in ACE_ROOT\tests, change to this directory. +You build then the tests with the following commands:

+

+%ACE_ROOT%\bin\mwc.pl -type bmake
+make -f Makefile.bmak all +

+ +Once you build all the tests, you can run the automated test script using:

+

perl run_test.pl

in the +tests directory to try all the tests. You need to make +sure the ACE bin and lib directory (in this case +%ACE_ROOT%\bin and %ACE_ROOT%\lib) +are on the path before you try to run the tests. If your executables are +compiled into a subdirectory, add -ExeSubDir subdirname to the +command.

+ +


+

Building and Installing ACE on Win32 with MinGW/ MSYS

+ +

+If you are building for a machine without a network card, you may want +to check here first. + +

+Building and installing ACE on MinGW +uses a mix of a UNIX building process and +Win32 configuration files. +Also, as MinGW uses GNU g++, you may want to take +a look at the Compiling ACE with GNU g++ section. + +

+You will need the MinGW build tools and libraries, downloable from +http://www.mingw.org. + +
+For our build we require the packages +MinGW and MSYS. + +

    + +
  1. Install the MinGW tools (including the MinGW Development toolkit) into a common directory, say c:/mingw. +

    + +
  2. Install the MSYS tools into a common directory, say c:/msys. +

    + +
  3. Open a MSYS shell. Set your PATH environment variable so + your MinGW's bin directory is first: + +
           % export PATH=/c/mingw/bin:$PATH
    +       
    + +
  4. Add an ACE_ROOT environment variable pointing to the + root of your ACE wrappers source tree: + +
           % export ACE_ROOT=/c/work/mingw/ACE_wrappers
    +       
    + + From now on, we will refer to the root directory of the ACE + source tree as $ACE_ROOT. +

    + +
  5. Create a file called config.h in the + $ACE_ROOT/ace directory that contains: + +
           #include "ace/config-win32.h"
    +       
    + +
  6. Create a file called platform_macros.GNU in the + $ACE_ROOT/include/makeinclude directory containing: + +
           include $(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU
    +       
    + + In the above text, don't replace $(ACE_ROOT) with the + actual directory, GNU make will take the value from the + environment variable you defined previously. + +

    + If you lack Winsock 2, add the line + +

           winsock2 = 0
    +       
    + + before the previous one. +

    + +

    + If you want to install ACE (using "make install") and want all the .pc files generated, + set the installation prefix in platform_macros.GNU. +

          INSTALL_PREFIX=/c/ACE
    +       
    + Headers will be installed to $INSTALL_PREFIX/include, documentation and + build system files to $INSTALL_PREFIX/share and libraries to $INSTALL_PREFIX/lib. With INSTALL_PREFIX set, RPATH will be enabled. + To disable RPATH (for example, if $INSTALL_PREFIX/$INSTALL_LIB is already + a system-known location for shared libraries), set the make macro + install_rpath to 0 by adding install_rpath=0 to platform_macros.GNU. + +

    + +
  7. In the MSYS shell, change to the $ACE_ROOT/ace directory and + run make: + +
           % cd $ACE_ROOT/ace
    +       % make
    +       
    + +

    + This should create libACE.dll (the Win32 shared library) and + libACE.dll.a (the Win32 import library for the DLL). + Note that the name for the ACE DLL follows the MinGW convention, which itself + resembles UNIX. + +

    + If you want static libs also, you may run: + +

           % make static_libs_only=1
    +       
    + +
  8. Run make install: + +
           % make install
    +       
    +

    + This should create ACE.pc to use with pkg-config. +

    + +
  9. + The same rules for Win32 search of DLLs apply for MinGW. If you + want to run some ACE programs from the MSYS shell, you may + need to add the directory for libACE.dll to your PATH: + +
           % export PATH=/c/work/mingw/ACE_wrappers/ace:$PATH
    +       
    + +
+ +ACE TESTS

+ +The tests are located in $ACE_ROOT/tests. +After building the library, you can change to that directory and run +make: + +

       % cd $ACE_ROOT/tests
+       % make
+       
+ +

+Once you build all the tests, you can run +run_tests.pl in the +tests directory to try all the tests: + +

       % perl run_test.pl
+       
+ +

+If you are using ACE as a DLL, you will need to modify your PATH +variable as explained above. + +

+You may want to check $ACE_ROOT/tests/README for the status +of the various tests on MinGW and the different Windows flavors. + +


+

Building and Installing ACE on Win32 with Cygwin

+ +

+If you are building for a machine without a network card, you may want +to check here first. + +

+Building and installing ACE on Cygwin +uses the UNIX building process. +Also, as Cygwin uses GNU g++, you may want to take +a look at the Compiling ACE with GNU g++ section. + +

+You will need the Cygwin build tools and libraries, downloable from +http://www.cygwin.com. +For our build we require the following packages besides the packages the +setup selects by default: + +

+gcc (version 3.3.3), cygserver, make, perl, binutils. +
+ +
    + +
  1. Install Cygwin (this can be easy downloading and running + setup.exe + from the Cygwin site). For working with ACE we recommend + to select DOS as default text file type. +

    + +
  2. Open a Cygwin shell. Set your PATH environment variable so + your Cygwin bin directory is first: + +
           % export PATH=//c/cygwin/bin:$PATH
    +       
    + + or + +
           % export PATH=/cygdrive/c/cygwin/bin:$PATH
    +       
    + +

    + Note Cygwin uses ``/'' as directory separator, + and ``//X'' as a notation for Win32 drive X. + Note also that you can't use ``c:/cygwin/bin'' + because, for Cygwin, + ``:'' is path separator character, as in UNIX. +

    + +

  3. Add an ACE_ROOT environment variable pointing to the + root of your ACE wrappers source tree (in this example c:/work/cygwin/ACE_wrappers): + +
           % export ACE_ROOT=/cygdrive/c/work/cygwin/ACE_wrappers
    +       
    + +

    + Note here you can't use the ``//X'' Cygwin + notation as this is seen by Cygwin's compiler and it doesn't + support that (it does support ``/'' as directory + separator however). + +

    + From now on, we will refer to the root directory of the ACE + source tree as $ACE_ROOT. +

    + +

  4. Create a file called config.h in the + $ACE_ROOT/ace directory that contains: + +
           #include "ace/config-cygwin32.h"
    +       
    + +
  5. Create a file called platform_macros.GNU in the + $ACE_ROOT/include/makeinclude directory containing: + +
           include $(ACE_ROOT)/include/makeinclude/platform_cygwin32.GNU
    +       
    + + In the above text, don't replace $(ACE_ROOT) with the + actual directory, GNU make will take the value from the + environment variable you defined previously. + +
  6. On the Cygwin shell, change to the $ACE_ROOT/ace directory and + run make: + +
           % cd $ACE_ROOT/ace
    +       % make
    +       
    + +

    + This should create libACE.dll (the Win32 shared library) and + libACE.dll.a (the Win32 import library for the DLL). + Note the name for the ACE DLL on Cygwin follows the UNIX convention. +

    + +

    + If you want static libs also, you may run: + +

           % make static_libs_only=1
    +       
    + +
  7. + The same rules for Win32 search of DLLs apply for Cygwin. If you + want to run some ACE programs from the Cygwin shell, you may + need to add the directory for libACE.dll to your PATH: + +
           # export PATH=//c/work/cygwin/ACE_wrappers/ace:$PATH
    +       
    + + If you are using MPC-generated Makefiles, then the DLLs have been + placed in the lib directory instead of ace and thus your PATH + addition would need to look like this: + +
           # export PATH=//c/work/mingw/ACE_wrappers/lib:$PATH
    +       
    + + +
+ +ACE TESTS

+ +The tests are located in $ACE_ROOT/tests. +After building the library, you can change to that directory and run +make: + +

       % cd $ACE_ROOT/tests
+       % make
+       
+ +

+Once you build all the tests, you can run +run_tests.pl in the +tests directory to try all the tests: + +

       % perl run_test.pl
+       
+ +

+If you are using ACE as a DLL, you will need to modify your PATH +variable as explained above. + +

+You may want to check $ACE_ROOT/tests/README for the status +of the various tests on Cygwin and the different Windows flavors. +

+ +

+
+ +

+

Building and Installing ACE on Win32 with Interix

+

Interix comes with a BSD style make; you need GNU make. +Make builds easily under Interix or there is a prebuilt +package at:

+

http://www.interopsystems.com/tools/warehouse.htm

+

If you are building for a machine without a network +card, you may want to check here first.

+

This port was built and tested under Interix 3.5. a.k.a. +Windows +Services for UNIX 3.5.

+

To build follow the Traditional ACE/GNU Make +Configuration instructions replacing the following include directives:

+

#include +"ace/config-win32-interix.h"

+

for the config.h header

+

and:

+

include +$(ACE_ROOT)/include/makeinclude/platform_win32_interix.GNU

+

for your platform_macros.GNU file.

+

ACE should build fine with just 'make', the only other option tried thus far is +'make static_libs_only=1' which also works. Any +other options may not work.

+

ACE TESTS

+

The tests are located in $ACE_ROOT/tests. After building the library, you can +change to that directory and run make:

+

% cd $ACE_ROOT/tests
% make +

Once you build all the tests, you can run run_test.pl in the tests directory to try all the tests:

+

% run_test.pl

+

If you are using ACE as a shared library, you will need +to modify your LD_LIBRARY_PATH as explained inTraditional ACE/GNU Make Configuration.

+

+ +


+

Building and Installing ACE on VxWorks

+For the most part, you should be able to follow the instructions above +to build ACE and applications that use it. Start with the +Unix instructions above to build ACE and the +applications that use it. Please see below for more information on +building ACE on NT hosts for VxWorks targets.

+ +A few notes on VxWorks builds (thanks to +Paul von Behren and +Remedy IT for these notes):

+

+

+ +You'll have to let ACE know the target type at compile time. There +are several ways to do this; please see the +$ACE_ROOT/include/makeinclude/platform_vxworks5.5.x.GNU +platform file for detailed information.

+ +The VxWorks platform_vxworks*.GNU files are set up so that shared +libraries are not built on VxWorks, by default. Only static +libraries, with .a extension, are built. Therefore, it's not +necessary to set the LD_LIBRARY_PATH environment variable on your host +system when building for VxWorks targets. Please note, however, if +you use TAO on VxWorks that you will need to set your LD_LIBRARY_PATH +to find the TAO IDL compiler libraries (installed in the ace +directory) on the host.

+ +These non-default VxWorks kernel configuration #defines +are required with ACE:

+ +

#define INCLUDE_CPLUS           /* include C++ support */
+#define INCLUDE_CPLUS_IOSTREAMS /* include iostreams classes */
+#define INCLUDE_POSIX_ALL       /* include all available POSIX functions */
+
+ +For completeness, here are the non-default #defines that +we used for VxWorks 5.3.1/g++ 2.7.2: + +
#define INCLUDE_CPLUS           /* include C++ support */
+#define INCLUDE_CPLUS_IOSTREAMS /* include iostreams classes */
+#define INCLUDE_CONFIGURATION_5_2 /* pre-tornado tools */
+#define INCLUDE_DEBUG           /* pre-tornado debugging */
+#define INCLUDE_LOADER          /* object module loading */
+#define INCLUDE_NET_SYM_TBL     /* load symbol table from network */
+#define INCLUDE_SYM_TBL_SYNC    /* synchronize host and target symbol tables */
+#define INCLUDE_NFS             /* nfs package */
+#define INCLUDE_PING            /* ping() utility */
+#define INCLUDE_POSIX_ALL       /* include all available POSIX functions */
+#define INCLUDE_RDB             /* remote debugging package */
+#define INCLUDE_RLOGIN          /* remote login */
+#define INCLUDE_RPC             /* rpc package */
+#define INCLUDE_SECURITY        /* shell security for network access */
+#define INCLUDE_SHELL           /* interactive c-expression interpreter */
+#define INCLUDE_SHOW_ROUTINES   /* show routines for system facilities*/
+#define INCLUDE_SPY             /* spyLib for task monitoring */
+#define INCLUDE_STARTUP_SCRIPT  /* execute start-up script */
+#define INCLUDE_STAT_SYM_TBL    /* create user-readable error status */
+#define INCLUDE_SYM_TBL         /* symbol table package */
+#define INCLUDE_UNLOADER        /* object module unloading */
+#define INCLUDE_WINDVIEW        /* WindView command server */
+
+ +Also, automatic construction/destruction of static objects +should be enabled.

+ +If you use TAO, it's also a good idea to increase the +NUM_FILES parameter from its default of 50 to, +say, 1000.

+ +Please note that those VxWorks kernel configuration parameters +are set in the VxWorks configAll.h file. You must rebuild your +VxWorks kernel after modifying that file.

+ +If you're first getting started with ACE and/or VxWorks, I recommend +just building the ACE library and tests first. (Some of the ACE +examples, in System_V_IPC, don't build on VxWorks yet.) Then try +running the tests. Please see $ACE_ROOT/tests/README for the latest +status of the ACE tests on VxWorks.

+ +Please note that the main entry point is renamed to +ace_main (configurable via ACE_MAIN) on VxWorks with g++, +to comply with its restriction against using main. +In addition, ACE_HAS_NONSTATIC_OBJECT_MANAGER is enabled by default +to cleanly support construction and destruction of static objects. +Please see the Non-static +ACE_Object_Manager discussion for the important implication +of this feature.

+ +ACE threads (VxWorks tasks) can be named, for example, by supplying a +non-null argument to the Thread_Manager spawn routines. However, +names beginning with "==ace_t==" are forbidden because +that prefix is used internally by ACE.

+ +You can spawn a new task to run ace_main, using either +VxWorks sp, or ACE'S spa. +spa can be used from the VxWorks shell to pass arguments +to ace_main. Its usage is: + +


+spa ace_main, "arg1" [, ...]
+
+ +All arguments must be quoted, even numbers. You can start also ace_main +without spawning another thread by using:

+ +


+spaef ace_main, "arg1" [, ...]
+
+ +ACE also provides the function vx_execae which is capable of running +ace_main in a separate thread, wait for the task to finish and return +the return code from ace_main: + +

+int vx_execae (FUNCPTR acemain,char* arguments, int prio = 0, int opt = 0, int stacksz = 0);
+
+

+You could call this from the VxWorks shell like: +

+

+my_rc = vx_execae ace_main, "-o server.ior -ORBDottedDecimalAddresses 1"
+

+ +When prio, opt or stacksz are omitted or specified +as 0 default values will be used. See the VxWorks shell documentation for the +defaults for prio and opt. For stacksz the default is +ACE_NEEDS_HUGE_THREAD_STACKSIZE. +The arguments string will be parsed and passed on to ace_main as +a regular argc and argv.

+ +Be aware of the fact that when you execute ace_main directly from the VxWorks +shell argc will be zero and argv* will also be zero. Using argv[0] will not return +the program name, but will result in a crash.
+The ACE helper functions spa, spaef and vx_execae prevent +this problem by building a regular argc and argv which also contain a +valid argv[0] element.

+ +

Building Shared Libraries for VxWorks.

+ +NOTE: Since VxWorks support is currently being reworked with +an initial focus on static builds the support for shared builds is momentarily +broken. This will be remedied(!) as soon as possible.

+ +ACE supports shared libraries for VxWorks, but only with the g++ +compiler. To build shared libraries instead of the default static +libraries, added shared_libs_only=1 to either your +ACE_wrappers/include/makeinclude/platform_macros.GNU or +your make invocation. Then, be sure to load the ACE (and +any other) shared library before loading your executable(s).

+ +A shared library for VxWorks uses the same code as for a static +(non-shared) library. However, calls to static constructors/ +destructors are added. The code in the shared library must +be reentrant if you shared it between programs (tasks). The +ACE library meets this requirement.

+ +Shared libraries reduce build time, executable size, and load +time of the executable. But, you must manually load the shared +library before loading your executable(s) with a command such as: +


+-> ld < libACE.so
+
+Shared libraries can be unloaded the same way an executable +(module) is unloaded.

+ +NOTE: Shared libraries on VxWorks aren't the same as +shared libraries on other operating systems. In particular, there is +no support for creating copies of writeable global (static) data in +the shared library. This includes the singleton ACE_Object_Manager +instance pointer. If you share global data between separate programs, +they may not work properly. See the discussion of shared code and +reentrancy in the VxWorks' Programmers Guide.

+ +Instead of trying to run separate programs onto a VxWorks target, we +recommend creating just one program, and spawning a thread for each +task. The TAO IDL_Cubit test collocation +test is a good example.

+ +

Linking ACE and/or TAO Libraries into the VxWorks Kernel.

+ +It's easy to link your ACE and/or TAO libraries into the VxWorks kernel. +Just build shared versions, but +disable the munch step. The easiest way to do that is to set the +LD make variable to the name of your linker. For +example, to build a libACE.so for PowerPC that can be linked into +the kernel: +
% cd $ACE_ROOT/ace
+% make LD=ldppc shared_libs_only=1
+
+After building the shared lib, link it into the kernel by setting +the MACH_EXTRA make variable in the kernel configuration +Makefile. Then, build the kernel using make exe.

+ +

Using the one-button ACE tests with VxWorks.

+ +It is possible to generate a script to execute all ACE tests. You can do this by executing +

% perl run_test.pl -v -o > run_test.vxworks
+
+ +The ACE tests write their output files in a directory named +log/, below the current (tests) directory.
+

+

+To run the tests from the build directory on an NT host where you crossbuild your +VxWorks ACE/TAO you can set up the Target Server File System (TSFS) in your Target Server +configuration. If you f.i. set the root for the TSFS to the root directory of your builddisk +you can set the default directory for the target by issueing the following command +from a Host shell: '@cd "/tgtsvr/{path to ACE}/ACE_wrappers/tests"'. +The '@' addition makes sure this command is executed for the target environment and not the +local host shell environment. +If you also issue the command 'cd {path to ACE}/ACE_wrappers/tests' you can execute the +generated one button testscript like: '< run_test.vxworks'. +

+

+Running the ACE tests automatically from the ACE autobuild tool using Target Server and Host +shell options is also supported. +

+

+If you don't have NFS included in your VxWorks kernel, you can use these steps, provided by +Clarence M. Weaver, +to run the tests and capture their output:

+

    +
  1. What I did was create a log directory on the boot NT host of my VxWorks + target.

    +

  2. I copied all the test applications and the run_test.vxworks script to + the parent of the log directory.

    +

  3. Using the target shell not the host shell, I "cd" to the directory + containing the script and test programs.

    +

  4. Invoked the script using < run_test.vxworks from this target shell.

    +

+ +Kirk Davies provided this +approach for running the ACE tests on Tornado II: + + + +

Building ACE on Tornado/NT hosts for VxWorks targets.

+The following, very useful information was contributed by +Chris Ryan +and Paul von Behren. +Please submit corrections, additions, or clarifications to the +the ACE mailing list.

+ +NOTE:The make (version 3.74) that is provided with +Tornado 2.2 cannot be used to build ACE. A working version is available +from the WindRiver support site, download the + +make3_80.gvk_patches and the + +make3_80.tor2_2.new_dependency_rules package and install them.

+ +Using the Cygnus tools, this approach works: +

+ +A few additional Windows Notes, from Paul von Behren:

+

+ +And Chris Ryan's instructions for building for VxWorks targets +on Windows NT hosts: + +
    +
  1. Path setting that seems to be working is:

    +

          /tornado/host/x86-win32/bin:
    +      /tornado/host/x86-win32/lib/gcc-lib/i386-wrs-vxworks/cygnus-2.7.2-960126:
    +      /tornado/host/x86-win32/i386-wrs-vxworks/bin:
    +      /ace/ace_wrappers/bin:
    +      /gnuwin32/b18/H-i386-cygwin32/bin:
    +      /gnuwin32/b18/tcl/bin:
    +      /WINNT/system32:
    +      /WINNT:
    +      /WINNT/system32/nls/ENGLISH:
    +      /bin
    +      
    + + Other environment variables:

    +

          WIND_BASE=/tornado
    +      SHELL=/bin/sh.exe
    +      TERM=pcbios
    +      TAO_ROOT=/ace/ACE_wrappers.vxworks/TAO
    +      CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.EXE
    +      GCC_EXEC_PREFIX=/tornado/host/x86-win32/lib/gcc-lib/
    +      WIND_HOST_TYPE=x86-win32
    +      ACE_ROOT=/ace/ACE_wrappers.vxworks
    +      
    + +
  2. /tornado is the root of the Tornado install + ($WIND_BASE). + +
  3. /gnuwin32 is the root of a Cygnus GNU download and install. + +
  4. /bin content is:

    +

          aced.dll
    +      cygwin.dll
    +      perl.exe
    +      rm.exe
    +      sh.exe
    +      true
    +      
    + + aced.dll is produced in an ACE NT source tree according to + documented procedure for Windows VC++ ACE build. + + cygwin.dll is from the Cygnus GNU software download and install. + +
  5. Basically, follow documented procedure for ACE build/install on UNIX + platform. Create a $ACE_ROOT/ace/config.h that looks + like:

    +

          #include "config-vxworks5.x.h"
    +      
    + + And create a + $ACE_ROOT/include/makeinclude/platform_macros.GNU + that looks like:

    +

    +      WIND_BASE = /tornado
    +      WIND_HOST_TYPE = x86-win32
    +      CPU = I80486
    +      include $(ACE_ROOT)/include/makeinclude/platform_vxworks5.5.x.GNU
    +      
    + +
  6. When using cygnus windows GNUTools on WinNT you have to start + make with "--unix" option, otherwise WinNT shell cmd.exe is responded and + not sh.exe, i.e., +
     make --unix static_libs_only=1
    + 
    +
+ +

TAO on NT Tornado host, VxWorks target.

+ +
    +
  1. Build ACE and TAO_IDL in the NT tree as already documented. + Be sure to build ACE's gperf on NT, in + ACE_wrappers/apps/gperf/src.

    + +

  2. Build $TAO_ROOT/tao +
          CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.exe
    +      cd $TAO_ROOT/tao
    +      /gnuwin32/b18/H-i386-cygwin32/bin/make
    +      
    + +
  3. Build orbsvcs. +
          CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.exe
    +      cd $TAO_ROOT/orbsvcs/orbsvcs
    +      /gnuwin32/b18/H-i386-cygwin32/bin/make
    +      
    + +
  4. Build $TAO_ROOT/tests

    +

+ + +

Jaffar Shaikh's +Notes for Building ACE and TAO for VxWorks on NT host

+

Scenario: I was building the ACE and TAO for VxWorks +on NT. The target system was a PPC860 based chassis and another a NT +host based card.

+

Host System:

+

NT 4.0 workstation with 128 M RAM, 266MHz Pentium.

+ +

Software Needed For Building TAO

+

1) ActiveState Perl +or Strawberry Perl +

+ +

2) Tornado 2.2.1 from Windriver.

+ +

3) Cygwin GNU to build TAO. It is available for NT as a freeware +from the Cygwin site

+

The Cygwin Make (version 3.75) can only build the TAO not the +Tornado II make (version 3.74)

+ +

Environment Variables:

+

On NT the environment Variables are set as follows, (from +Control Panel-> System -> Environment)

+

I added following Environment variable entries to PATH

+ +
+C:\Perl\bin\;
+C:\tornado\host\x86-win32\bin;
+C:\tornado\host\x86-win32\powerpc-wrs-vxworks\bin;
+C:\tornado\host\x86-win32\lib\gcc-lib\powerpc-wrs-vxworks\cygnus-2.7.2-960126;
+C:\Corba\Ace_wrappers\bin;
+C:\Cygwin\bin;
+C:\Cygwin\usr\bin;
+C:\bin
+
+ +

Additional Environmental variables and the values,

+
+CPU=PPC860
+LD_LIBRARY_PATH=
+SHELL=/bin/sh.exe
+ACE_ROOT=/Corba/ACE_wrappers
+WIND_BASE=/tornado
+SHELL=/bin/sh.exe
+TERM=pcbios
+TAO_ROOT=/Corba/ACE_wrapper/Tao
+CPP_LOCATION=/Program Files/Microsoft Visual Studio/VC98/Bin/CL.exe
+GCC_EXEC_PREFIX=/tornado/host/x86-win32/lib/gcc-lib/
+WIND_HOST_TYPE=x86-win32
+PERL_PATH=/perl/bin/perl.exe
+
+ +

Directories of importance

+

C:\Corba <-- Ace_wrappers (uzipped)

+

C:\tornado <-- Tornado installed

+

C:\Perl <-- Perl installed

+

C:\Cygwin <-- Cygwin installed

+

C:\bin <-- Copy these files,

+

Ace.dll, <-- After you build Ace

+

gperf.exe <-- After you build gperf

+

Cygwin1.dll, <-- After you install Cygwin

+

perl.exe, <-- After you install Perl

+

rm.exe <-- After you install Cygwin

+

sh.exe <-- After you install Cygwin

+

true <-- After you install Cygwin

+

Create Files

+

1) C:\Corba\ACE_Wrappers\ace\config.h

+

with entry

+
+#if defined (_MSC_VER) || (__BORLANDC__)
+  #include "ace/config-win32.h"
+#else
+  #define ACE_HAS_IP_MULTICAST
+  #include "ace/config-vxworks5.x.h"
+#endif
+
+ +

2) C:\Corba\ACE_wrappers\include\makeinclude\platform_macros.GNU

+
+WIND_BASE = /tornado
+WIND_HOST_TYPE = x86-win32
+include $(ACE_ROOT)/include/makeinclude/platform_vxworks5.5.x.GNU
+ACE_COMPONENTS=FOR_TAO (you may choose this option to build ACE library that supports TAO)
+
+ +

+

Steps to Build

+

1) Build Ace.dll under NT

+

In MS Visual C++ open C:\Corba\ACE_wrappers\ace.sln And build Ace +DLL

+

Copy Ace.dll in C:\bin

+ +

2) Build gperf utility under NT

+

In MS Visual C++ open +C:\Corba\ACE_wrappers\apps\gperf\src\gperf.sln. Build gperf.exe

+

Copy gperf.exe to C:\bin

+ +

3) Mount Directries in Cygwin

+

Click on Cygnus Solutions -> Cygwin Bash Shell

+

Mount following directories by using mount command.

+

create respective directories first then use mount command

+ +

e.g. Create /Corba directory then use $mount -s "C:\Corba" +/Corba

+ +

C:\Corba mount to /Corba

+

C:\tornado mount to /tornado

+

C:\Perl mount to /perl

+

C:\Cygwin mount to /cygwin

+

C:\bin mount to /bin

+

C:\Program Files mount to /Program Files

+ +

4) Build ACE in Cygwin

+

$cd /Corba/ACE_wrappers/ace

+

$make static_libs_only=1

+

This will build your ace library libACE.a for VxWorks. If you use +option shared_libs_only=1 then the build will be libACE.so. The other +options are same as follows.

+ +

5) Build TAO in Cygwin

+

$cd $TAO_ROOT/tao

+

$make debug=0 optimize=1 static_libs_only=1 minimum_orb=1 +

+

for shared libs use shared_libs_only=1

+ +

The minimum Tao does not have following components,

+

Dynamic Skeleton Interface

+

Dynamic Invocation Interface

+

Dynamic Any

+

Interceptors

+

Interface Repository

+

Advanced POA features

+

CORBA/COM interworking

+ +

You may play around with above options to find suitable build for +your needs. For example when you give option debug=1 all the debug +symbols will be created and the build will huge in size. The debug +symbols are necessary when you want to debug your code.

+ +
+ +

Building and Installing ACE on Android

+ + + +

ACE can be built for Android by using the Android Native Development Kit +(NDK). This is different than the standard way of writing Android +applications in Java which run the on Android Runtime or the older Dalvik +Virtual Machine. Applications built using the NDK are native Linux applications +written in C or C++ specifically compiled to run on Android systems. In +addition, applications built using the NDK have access to Android-specific APIs +much like the ones available to Java-based Android applications. +

+ +
+

Windows Users: These instructions are written for a Unix based +platform like Linux, but can also be used on Windows. If you are using an +virtualized Linux environment like Windows Subsystem for Linux (WSL), Docker, +or a traditional VM, then you can use the Linux version of the NDK and ignore +rest of this note and all the other Windows specific notes. +

+ +

If that is not the case, you should also pay attention to the notes marked +with "Windows Users:" in addition to the rest of the instructions. In +addition to the Windows version of the Android NDK, you will also need +MSYS2 for Unix utilities that ACE needs. +

+ +

Generating a Toolchain

+ +

To build ACE for Android you need to download the NDK and generate a +toolchain for the specific Android target you want. The specific target is +defined by two things:

+ +
+
- The minimal API level to target.
+
A lower level means larger amount of potential users but also + potentially less features. Android has many API levels + to target. They roughly correspond to the versions of Android. +
+
- The CPU architecture to target (Also called the Application Binary + Interface or ABI by the NDK documentation).
+
In addition to ARM, Android also supports x86 and MIPS, + although support for MIPS has been dropped from the NDK. This is the official + documentation on the ABIs. These are the ABIs that ACE supports at the + time of writing and must be passed to ACE as ANDROID_ABI: + +
+
armeabi-v7a
+
32-bit ARM, The default ABI for both the NDK and ACE.
+
armeabi-v7a-with-neon
+
armeabi-v7a with NEON extensions enabled.
+
arm64-v8a
+
64-bit ARM, Sometimes referred to as aarch64.
+
x86
+
32-bit x86
+
x86_64
+
64-bit x86
+
+

+ It should be noted that starting in August 2019, the Google Play + Store will require new apps to have 64-bit libraries if they have native + libraries. 32-bit native libraries will still be supported but they must also + have 64-bit libraries. Look up any restrictions that may affect + apps you want to publish on the Play Store, including minimum API + level. +

+
+ +
+ + +

To generate a toolchain, one use must use +build/tools/make_standalone_toolchain.py in the NDK. A destination must be +chosen and is denoted here as $TOOLCHAIN. For example, to generate a +toolchain targeting 32-bit ARM Android 7.0 "Nougat" (API Level 24) and later:

+

+./make_standalone_toolchain.py --arch arm --api 24 --install-dir $TOOLCHAIN +

+

$TOOLCHAIN/bin must be in your $PATH when building ACE and +applications using ACE.

+ +

This table shows how the ANDROID_ABI variable and the --arch argument correlate:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ANDROID_ABI--arch
armeabi-v7aarm
armeabi-v7a-with-neonarm
arm64-v8aarm64
x86x86
x86_64x86_64
+ +
+

Windows Users: +Android NDK includes Python in prebuilt\windows-x86_64\bin for +64-bit Windows NDKs. For the example above, assuming %NDK% is the +location of the NDK and %TOOLCHAIN% is the desired location of the +toolchain, run this command instead:

+ +

+ + %NDK%\prebuilt\windows-x86_64\bin\python.exe + %NDK%\build\tools\make_standalone_toolchain.py + --arch arm --api 24 + --install-dir %TOOLCHAIN% +

+ +

For Windows %TOOLCHAIN%\bin and the location of the MSYS2 +utilities must be in %PATH% when cross compiling ACE. The default +location for these would be C:\msys64\usr\bin. +

+ + +

Using Older NDKs

+ +

Skip this section if using NDK r18 or later.

+ +

+It is highly recommended to use the latest NDK available assuming +that it works with ACE. It is possible to use NDKs older than r18, but these +have caveats: +

+ + +

Building

+ + +

+ +

Installing ACE on Android

+ +

Native applications using the ACE library can be installed onto devices by +several different methods. The files can be include as assets of Java +application and can be written by the Java application into it's executable +program directory. The native application can be downloaded by a Java +application and written into the Java applications executable program +directory. The native application can also be uploaded using the Software +Development Kit's ADB tool. This method requires uploading the native +application to a directory that allows execution and having any output +directed to a writable directory.

+ +

Logging

+

+On Android, ACE_Log_Msg (and therefore ACE_DEBUG and +ACE_ERROR) uses Android's logging system (aka Logcat) by default +in addition to stderr because stdout and +stderr are discarded under normal circumstances. To disable this +at runtime, run: +

+ +
+ACE_LOG_MSG->clr_flags (ACE_Log_Msg::SYSLOG);
+
+ +

To disable this at compile time include these lines in config.h:

+ +
+#define ACE_DEFAULT_LOG_FLAGS ACE_Log_Msg::STDERR
+#define ACE_DEFAULT_LOG_BACKEND_FLAGS 0
+
+ +

OpenSSL

+

+ Depending on the features of ACE, TAO, or other software desired, you might need + OpenSSL. On Android, OpenSSL isn't part of the NDK Library and Android + preloads the system SSL library (either OpenSSL or BoringSSL) for the Java + Android API. This means OpenSSL MUST be statically linked to avoid + conflicts with the almost certianly incompatible system SSL library. + + To build OpenSSL for Android, please read NOTES.ANDROID that comes + with OpenSSL's source code. The static libraries will used if the shared + libraries are not found. This can be accomplished by either disabling the + generation of the shared libraries by passing no-shared to + OpenSSL's Configure script or just deleting the so files after + building OpenSSL. +

+ +
+

Building and Installing ACE Network Services

+ +The following explains how to build the ACE network services on UNIX and Win32. + +


+

Building and Installing ACE Network Services on UNIX

+ +Building and installing ACE Network Services on UNIX is relatively +simple (the process for Win32 is different). +Here's what you need to do:

+ +

    + +
  1. Build and install ACE on UNIX as described earlier. If ACE is built at the root of the ACE + source tree (and ACE has been ported to your platform, of course) the + netsvcs static and shared object libraries should be built + automatically. In addition, the server driver program + (main) contained in $ACE_ROOT/netsvcs/servers/main.cpp + should also be compiled and ready to run.

    + +

  2. Set your LD_LIBRARY_PATH environment variable to + where the binary version of the ACE netsvcs library. For + example, you probably want to do something like the following

    + +

    
    +      % setenv LD_LIBRARY_PATH $ACE_ROOT/ace:$ACE_ROOT/lib:$LD_LIBRARY_PATH
    +      

    + +

  3. By default, if the shared object library is built, the services + are linked into the main driver program dynamically. + To specify which services should be linked in and executed, edit the + $ACE_ROOT/netsvcs/servers/svc.conf + file. During your editing, you should update information (such as the + default service port numbers) that affects the initialization of + services in this file. Refer to the + Service Configurator + documentation to learn how the configuration file is parsed and + how the services are dynamically linked and executed. In + addition, refer to the Network + Services documentation to learn more about how to configure + each network service.

    + +

  4. If you only want to link the services statically, simply remove + or rename the svc.conf file.

    +

+ +


+

Building and Installing ACE Network Services on Win32

+ +Once again, there are supplied project for Visual C++ 7.1 or later for +the Network Services.

+ +


+

Building and Installing the ACE_SSL Library

+ +

The first step for all platforms is to build and install the +OpenSSL distribution. The +ACE_SSL library must then be built according to the instructions +below.

+

Unix

+
    +
  1. Make sure the OpenSSL header file directory is in your compiler's + include path, and that OpenSSL libraries are in your library link/load + path (e.g. LD_LIBRARY_PATH). If you + installed OpenSSL into a set of directories unknown by the compiler, + set the SSL_ROOT environment variable to point to the + top level directory of your OpenSSL distribution, i.e. the one + containing OpenSSL's include and lib + directories.
  2. +
  3. Build ACE as described above. When building ACE, add + ssl=1 + to your make + command line invocation, or add it to your + platform_macros.GNU file.
  4. +
  5. Build the ACE_SSL library in the $ACE_ROOT/ace/SSL + directory. The ACE_ROOT environment variable should be set + prior to this point.
  6. +
+

Microsoft Visual Studio

+
    +
  1. Set the SSL_ROOT environment variable to the location + of the directory containing the OpenSSL inc32 and + out32dll directories. +
  2. Add ssl=1 to your MPC + $ACE_ROOT/bin/MakeProjectCreator/config/default.features + or $ACE_ROOT/local.features file. +
  3. At the moment you are using OpenSSL v1.1 or + newer also add openssl11=1 to your MPC + $ACE_ROOT/bin/MakeProjectCreator/config/default.features + or $ACE_ROOT/local.features file. +
  4. Re-run MPC to add + support for building the ACE_SSL library to your MSVC++ + workspaces and projects. +
  5. Open the ACE.sln solution, and refer to the ACE build + and installation instructions above for details on creating a + config.h configuration header for this platform. Once + the config.h file has been created, build the + ACE_SSL project.
  6. +
+

Embarcadero C++

+

Support for building ACE's ACE_SSL library and TAO's SSLIOP + pluggable protocol with Embarcadero C++ does exist. +

    +
  1. Set the SSL_ROOT environment variable to the location + of the directory containing the OpenSSL inc32 and + out32 directories. +
  2. Add ssl=1 to your MPC + $ACE_ROOT/bin/MakeProjectCreator/config/default.features + or $ACE_ROOT/local.features file, and re-run MPC to add + support for building the ACE_SSL library to your Embarcadero C++ makefiles. +
  3. Build ACE and TAO. +
+

+ +

+

Building and Using GUI Reactors Libraries

+There is a general method for building and using ACE_Reactors for various GUI +libraries. +

Building GUI Reactor Library

+
    +
  1. Try to generate build files using MPC. Inspect the output of MPC to find out which features are + necessary to build given reactor. Add these features to + ACE_wrappers/bin/MakeProjectCreator/*.features file, or pass them directly to MPC + using -features command line option. For example, for FlReactor the procedure + consists of five steps +
      +
    1. In the first pass one gets that x11 (X11 libraries) is missing.
      + $ mwc.pl -type gnuace + Skipping ACE_FlReactor (ace_flreactor.mpc), it requires x11. +
    2. + Ensure that X11 libraries are installed, then pass x11=1 feature to MPC. +
    3. In the second pass one gets that gl (OpenGL library) is missing.
      + $ mwc.pl -type gnuace -features x11=1 ace.mwc + Skipping ACE_FlReactor (ace_flreactor.mpc), it requires gl. +
    4. + Ensure that OpenGL libraries are installed, then pass gl=1 feature to MPC. +
    5. In the third pass one gets that fl (Fast Light Toolkit) is missing.
      + $ mwc.pl -type gnuace -features x11=1,gl=1 ace.mwc + Skipping ACE_FlReactor (ace_flreactor.mpc), it requires fl. +
    6. + Ensure that Fast Light Toolkit libraries are installed, then pass fl=1 + feature to MPC. +
    7. In the fourth pass one gets that ace_flreactor feature is missing
      + $ mwc.pl -type gnuace -features x11=1,gl=1,fl=1 ace.mwc + Skipping ACE_FlReactor (ace_flreactor.mpc), it requires ace_flreactor. +
    8. + Allow MPC to generate makefiles for FlReactor by setting ace_flreactor=1 feature. +
    9. In the last pass one obtains files for building FlReactor.
      + $ mwc.pl -type gnuace -features x11=1,gl=1,fl=1,ace_flreactor=1 ace.mwc +
    10. +
    + Currently to simplify MPC generation some of features are turned on by default in + ACE_wrappers/bin/MakeProjectCreator/global.features. For examples to generate + files related with Fl one has to provide only fl=1 feature. To obtain a more fine grained controll + over MPC generation process one may modify ACE_wrappers/bin/MakeProjectCreator/*.features + files. +
  2. +
  3. Required build files are generated now, it is enough then to invoke build tool. + For example for under MPC::gnuace one has to call + make fl=1. For MPC::vc7 target all features are + encoded in generated project files, thus it is enough to compile ACE using MSVC. +
  4. +
+ The build procedure leads to a specific GUI Reactor library. For example, for + Qt and Linux one gets libQtReactor.so, while for + Windows the results are shared QtReactor.dll and import + QtReactor.lib libraries or their variants depending on build options. + When compiling TAO also GUI related libraries are created like libTAO_QtResource.so. +

Using GUI Reactor Library

+ Here one has at least three use cases: +
    +
  1. Applications with their own build system. + To use ACE support for GUI one has to include specific GUI headers and + link with specific ACE_[GUI]Reactor library. When using TAO support for GUI one has + also to link with specific TAO_[GUI]Resource library.
  2. +
  3. Applications with build system using MPC. + In general, it is better to create specific base projects for using ACE GUI support in such application. + Base projects provided by ACE ACE_wrappers/bin/MakeProjectCreator/[ace,tao]_[gui][reactor,resource].mpb + may be an examples of how to do this.
  4. +
  5. Internal ACE applications like tests or examples. + MPC project for internal ACE application using GUI support should be derived from + ace_[gui]reactor.mpb base projects. To employ TAO support for GUI one should derive + the project from tao_[gui]resource.mpb These base projects ensure that all necessary libraries + are linked to the application, specifies features necessary to build a project and moreover impose a + build order consistant with ACE. For example, the application project using XtReactor should be + derived from ace_xtreactor.mpb.
  6. +
+

Notes on specific GUI Reactors

+ + +
+

Installation Notes

+ + + + +
+

Compiling ACE with GNU g++

+ +If you use the GNU GCC g++ compiler please note the following: + + + + +

+

What Do I Need to Build for TAO?

+Toshio Hori <toshi@etl.go.jp> provided these suggestions on building +just what's needed for (a subset of) TAO:

+ +I usually make: +

    $ACE_ROOT/ace,
+    $ACE_ROOT/apps/gperf,
+    $TAO_ROOT/tao,
+    $TAO_ROOT/TAO_IDL, and
+    $TAO_ROOT/orbsvcs/orbsvcs
+
+and the whole make takes less than an hour on my Solaris 7 for intel, +Pentium-III/550MHz, 256MB memory, 512MB swap machine. (Top secret: I +renice the 'make' process to the highest priority, -20... ;-) + +To save time and space, I set +
    TAO_ORBSVCS = Naming Time Trader ImplRepo
+
+in $ACE_ROOT/include/makeinclude/platform_macros.GNU also. See +TAO's orbsvcs +library customization instructions for more information.

+ + +


System Resource +Requirements

The amount of system resources required to build +ACE and TAO varies greatly. The required system resources are +influenced by OS and compiler platform, build options, and component +configurations. As a rough guide, the typical peak memory requirement +can be well over 512 MB (notably, for TAO's orbsvcs). Depending on +your OS and compiler configuration, an entire build +of ACE and TAO can use well over 4 GB of disk space. It's usually not +necessary to build all of ACE and TAO, though.

+ +Much less disk space is required for just the libraries. For example, +see the ACE +library subset sizes.

+ +If you run out of memory when building, you might consider trying +some or all of these suggestions:

+

+ +


+

General MPC information

+ +

+The +Makefile Project Creator (MPC) is a tool that takes platform and +building tool generic files (mpc files) as input, which describe basic +information needed to generate a "project" file for various build +tools, including Make, NMake, Visual C++ 6, Visual C++ 7, etc. Please +see USAGE, README for documentation on MPC. +

+ +

+A common usage for creating a Windows workspace containing just the +core ACE and TAO libraries and executables is the following: +

+ +

+C:> cd %TAO_ROOT%
+C:> %ACE_ROOT%\bin\mwc.pl -type vc71 TAO_ACE.mwc
+
+ +

+Replace vc71 with whatever project type you want to use. On Linux and +other UNIX platform use the gnuace type: +

+ +

+% cd $TAO_ROOT
+% $ACE_ROOT/bin/mwc.pl -type gnuace TAO_ACE.mwc
+
+ +

+This creates the appropriate GNUmakefiles. Additional information on +how to obtain, configuration, and build ACE+TAO using MPC appear at +the OCI FAQ. +

+ +

+If you are attempting to generate project files using MPC, and you get +the following error message: +

+ +
ERROR: Unable to find the MPC modules in /builds/ACE_wrappers/MPC.
+You can set the MPC_ROOT environment variable to the location of MPC.
+
+ +

+You need to do one of the following: +

+ +
    +
  1. If you have already obtained MPC, either move it underneath the +ACE_wrappers directory or set your MPC_ROOT environment variable to point +to the full path of MPC.
  2. +
  3. Check out MPC from the DOC Group git repository +and set your MPC_ROOT environment variable.
  4. +
+ +

+You can check +out MPC from the DOCGroup git repository using the following command. +

+ +
git clone https://github.com/DOCGroup/MPC.git MPC
+
+ +

+The README and USAGE files in the MPC/docs directory are an up-to-date +source of documentation, however it is not a complete set of +documentation. The TAO Developer's Guide from OCI starting with the +1.3a version contains more information about MPC. +

+ +

+The MPC chapter from the TAO Developer's Guide is available at +http://downloads.ociweb.com/MPC/. Some of MPC has changed since +this version, but it is largely accurate. An updated version will be +available as newer versions of the TAO Developer's Guide are released. +In the meantime, please see the README and USAGE files in the MPC +directory. +

+ +

+

Working with ACE in Eclipse

+ + +

+The Eclipse CDT C++ development environment can be used to develop ACE applications. You can configure a new CDT project to build ACE using either a local source distribution or checking out ACE from CVS in Eclipse. These are the steps to create the CDT project to build ACE. +

+ +

+

To create an Eclipse project for ACE starting from CVS:

+
    +
  1. In the "CVS Repository Exploring" perspective, navigate to the module containing ACE.
  2. +
  3. Checkout the module using "Check Out As" and select the "project configured using the New Project Wizard" option.
  4. +
  5. Select "Standard Make C++ Project" for the project type.
  6. +
  7. Follow the steps outlined above, up to the point of running make, for building ACE on your platform. Use "path_to_your_eclipse_workspace"/"project_name" as your $ACE_ROOT. +
  8. If you had to regenerate the makefiles using MPC, select the root folder for your poject and use the import wizard to add them to your project.
  9. +
  10. Select the root folder for the project and use the "Create Make Target" wizard to setup the appropriate make command and options.
  11. +
  12. Select the root folder and run "Build Make Target." This will build ACE.
  13. +
+

+ + + +

+

To create an Eclipse project for ACE from a local source distribution:

+
    +
  1. Launch the "New Project Wizard" in Eclipse.
  2. +
  3. Select "Standard Make C++ Project" for the project type.
  4. +
  5. On the project name page, uncheck the "use default" location option and replace the default path with the path to your source distribution.
  6. +
  7. Follow the steps, up to the point of running make, for building ACE on your platform. +
  8. If you had to regenerate the makefiles using MPC, select the root folder for your poject and use the import wizard to add them to your project.
  9. +
  10. Select the root folder for the project and use the "Create Make Target" wizard to setup the appropriate make command and options.
  11. +
  12. Select the root folder and run "Build Make Target." This will build ACE.
  13. + + +
+

+ +

+ +

+

Advanced Topics

+ + + +


+

Non-static +ACE_Object_Manager

The ACE_Object_Manager can be instantiated +as a static object, can be instantiated on the stack of the main +program thread, or can be explicitly instantiated and destroyed by the +application with ACE::init () and ACE::fini +(). The comments in the header file, +ace/Object_Manager.h, as well as Section 1.6.3 in +The ACE Programmer's Guide +provide more detail.

+ +NOTE: +Special requirements are imposed on applications if the +ACE_Object_Manager is instantiated, by ACE, on the stack of the main +thread. This behavior is selected by defining +ACE_HAS_NONSTATIC_OBJECT_MANAGER in +ace/config.h. Again, see the ACE Object_Manager header file, +ace/Object_Manager.h for more information. One of +these requirements is discussed here, because it is so important. +Please note that ACE_HAS_NONSTATIC_OBJECT_MANAGER is +defined in the distributed ACE config.h headers for +VxWorks and Win32.

+ +The important requirement is that the program must +declare its main function with two arguments, even if +they're not used, and with int return type: + +


+int
+main (int, char *[])
+
+ +If you don't declare main exactly that +way, then you'll see a link error about ace_main_i being +undefined.

+ +Alternatively, this feature can be disabled by commenting out the +#define ACE_HAS_NONSTATIC_OBJECT_MANAGER in the +ace/config.h. But, that will make repeated testing more +difficult on VxWorks. And, you'd either have to call static +constructors and destructors manually or unload/load the program +between runs. On Win32, disabling the feature can possibly lead to +shutdown difficulties.

+ +WARNING: +ACE_HAS_NONSTATIC_OBJECT_MANAGER assumes that your +main function is named main. Any violation +of this assumption is at your peril. If you really need to call your +entry point something other than main, you'll need to +construct and destroy the ACE_Object_Manager. The best way to do that +is to call ACE::init () and ACE::fini (). +Or, see the #define of main (int, char *[]) +in ace/OS_main.h to see how ACE does +that for entry points named main. + +


+

Cloning the Source Tree

+ +On UNIX platforms, we typically like to support multiple platform +builds using the same ACE source tree. This idiom is supported by ACE +using the $ACE_ROOT/bin/create_ace_build.pl script. + +To clone the source tree, create ./build and ./build/{your build name} +subdirectories under the ACE_wrappers directory. +Then invoke the create_ace_build.pl script to clone the source tree using +soft links from your build directory back to the actual sources. +Here is an example:

+ +

% cd ACE_wrappers
+% mkdir build build/build-SunOS5
+% perl bin/create_ace_build.pl -a -v build-SunOS5
+% cd build/build-SunOS5
+% setenv ACE_ROOT $cwd
+% make
+

+ +This will establish a complete tree of links. In addition, make sure +you set your LD_LIBRARY_PATH to +$ACE_ROOT/lib:$LD_LIBRARY_PATH on SVR4 UNIX +platforms.

+ +When you do a make in the $ACE_ROOT directory you will be producing +object code that is not stored in the same place as the original +source tree. This way, you can easily build another platform in a +parallel tree structure.

+ +See the comments at the top of the create_ace_build.pl script for +further usage information. + +


+

Additional Build Tips for MVS

+ +For all intents and purpose, MVS OpenEdition (OE) is another flavor of +UNIX, therefore, the instructions under Building +and Installing ACE on Unix can be used along with the following +additional tips:

+ +You can get a copy of GNU make that has been ported to MVS OpenEdition from +the IBM OpenEdition web site. +ACE's make scheme generates compile commands that have options and +operands interspersed. By default, the c89/cc/c++ compiler expects all options to +precede all operands. To get around this, you must set a special +compiler environment variable (_CXX_CCMODE) to 1 which tells the compiler +to allow options and operands to be interspersed.

+ +Note that the environment variable LD_LIBRARY_PATH is +called LIBPATH on MVS.

+ +Shared objects are built a little different on MVS than on +other UNIX implementations. This has been accounted for in the makefiles +that come with ACE When the linker (via the cxx command) builds the +libACE.so file it will also create a file called libACE.x. This is a +side-deck file and it must be included in subsequent link edits with +application code. For more information on this see the C/C++ MVS +Programming Guide. If you want to build your application statically, +i.e., using libACE.a instead of libACE.so, you can set ACELIB to +ACELIB_STATIC in platform_mvs.GNU.

+ +When the libACE.so file is built (via the MVS pre-linker and binder), you +will get a rc=4 from the pre-linker. This is ok. This is due to some +warnings about unresolved references which should get resolved during the +link step. Note, however, there shouldn't be any unresolved references +from the binder (linkage editor). You can get pre-link and link maps by +uncommenting the PMAP and LMAP lines in the platform_mvs.GNU file. + +


+

Makefile Flags

+ +GNU make provides many options to customize its operation. See its +documentation for more information. One example is that for multi-cpu +UNIX machines you will be able to build faster if you use:

+ +


+% make -j n
+

+ +which allows parallel compilation. The number n should +typically be the number of CPUs. It is likely that builds will be +faster even on single-CPU UNIX machines with make -j +2.

+ +ACE further supports the following flags. They can be enabled either +on the command line, e.g., "make purify=1", or added to your +platform_macros.GNU. To disable the option, +set the flag to null, +e.g., "make debug=". Some flags support setting to 0 disable, e.g., +"make debug=0". debug=1 is enabled in the platform files that are +released with ACE.

+ +Please note that the effects of a flag may be platform specific. +Also, combinations of certain flags may or may not be allowed on +specific platforms, e.g., debug=1 opt=1 is supported by g++ but +not all other C++ compilers.

+ +If you use Purify or Quantify: purify or quantify must +be on your PATH. By default, ACE puts the Purify/Quantify +caches below /tmp. To override that, set the +PURE_CACHE_BASE_DIR variable, either in your environment +or on the make make command line, to the destination +directory for your instrumented libraries.

+ +

Flag             Description
+----             -----------
+debug            Enable debugging; see DCFLAGS and DCCFLAGS.
+exceptions       Enable exception handling (not supported by all platforms).
+include_env      Support old-style ACE_TRY_ENV declarations in methods.
+                 This switch is necessary for compiling TAO applications
+                 in the native exception configuration that were written
+                 for TAO versions before 1.2.2.
+                 In TAO 1.2.2, new macros were introduced that supercede
+                 the direct ACE_TRY_ENV declarations. These are the
+                 ACE_ENV_ARG macros that are defined in ace/CORBA_macros.h
+                 and are documented in docs/exceptions.html.
+                 This switch only affects the exceptions=1 configuration.
+                 It is for backward compatibility only.
+                 There will be warnings about unused _ACE_environment_variable
+                 parameters when using include_env=1.
+                 If possible, do not use it, but instead change your TAO
+                 applications to use the ACE_ENV_ARG macros.
+fast             Enable -fast option, e.g., with Sun C++.
+inline           Enable ACE inlining.  Some platforms enable inlining by
+                   default, others do not.
+optimize         Enable optimization; see OCFLAGS and OCCFLAGS.
+pace             Enable PACE as the underpinnings of ACE_OS.
+probe            Enable ACE_Timeprobes.
+profile          Enable profiling; see PCFLAGS and PCCFLAGS.
+purify           Purify all executables.
+quantify         Quantify all executables.
+repo             Use GNU template repository (g++ with repo patches only).
+rtti             Enable run-time type identification.  On some platforms,
+                   it is enabled by default, so this is ignored.
+shared_libs      If migrating from prior version use shared_libs_only
+static_libs      If migrating from prior version use static_libs_only
+shared_libs_only Only build shared libraries.  Ignored if no SHLIBs are
+                   specified by the Makefile, as in performance-tests/Misc.
+static_libs_only Only build static libraries.
+threads          Build with thread support.
+xt               Build with Xt (X11 Toolkit) support.
+fl               Build with FlTk (Fast Light Toolkit) support.
+tk               Build with Tk (Tcl/Tk) support.
+qt               Build with Qt (Trolltech Qt) support.
+ssl              Build with OpenSSL support.
+rapi             Build with RAPI
+split            Build the library by first splitting up the ACE source
+                   to several files, with one object code entity for each
+                   source file. This allows an application that is linked
+                   with ACE to extract _exactly_ what it needs from the
+                   library, resulting in a smaller executable.  Setting this
+                   to 1 overrides debug to 0.
+
+Usually, users do not need to be concerned with make targets.
+Just enter "make" on the command line to build.  A few notable
+targets are listed below.
+
+Target             Description
+------             -----------
+show_statics       Lists all static objects in object files built for
+                     current directory.  Only supported for g++.
+show_uninit        Lists all uninitialized in object files built for
+                     current directory.  Only supported for g++.
+
+
+ +


+ +

Building from git

+ +If users are building from our Git repository the +GNUmakefiles, and project files for building on various platforms will +not be available. Git users are expected to generate them +using MPC before building ACE, TAO or +CIAO. We point out some suggestions below to get bootstrapped +quickly. + + + +

+Back to the ACE +home page. +

+ + + + + + + +

diff --git a/deps/acelite/ACE.mwc b/deps/acelite/ACE.mwc new file mode 100644 index 000000000..7899541b3 --- /dev/null +++ b/deps/acelite/ACE.mwc @@ -0,0 +1,28 @@ +workspace { + exclude { + TAO + } + + // The associate scope does not add directories to the workspace; + // it only associates a name with one or more directories. + associate(examples) { + examples + } + associate(tests) { + performance-tests + tests + } + associate(gperf) { + gperf + } + + // The '--' is a special key that indicates that the associated + // projects should be of the form @NAME@ in the generated Makefile.am. + associate(--) { + ACEXML + ASNMP + protocols + KOKYU + TAO + } +} diff --git a/deps/acelite/CMakeLists.txt b/deps/acelite/CMakeLists.txt index a6043ed00..6c781e5d4 100644 --- a/deps/acelite/CMakeLists.txt +++ b/deps/acelite/CMakeLists.txt @@ -1,16 +1,8 @@ +# # Copyright (C) 2016+ AzerothCore , released under GNU AGPL3 v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 # -# This file is free software; as a special exception the author 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. -if(CMAKE_SYSTEM_NAME MATCHES "Windows") - add_subdirectory(ace) -else() +if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") add_library(ace SHARED IMPORTED GLOBAL) set_target_properties(ace @@ -19,4 +11,352 @@ else() "${ACE_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${ACE_INCLUDE_DIR}") +else() + + # NOTE: Do not use glob here, it would include files we don't want + set(ACE_SOURCES + ace/ACE.cpp + ace/ACE_crc32.cpp + ace/ACE_crc_ccitt.cpp + ace/ATM_Acceptor.cpp + ace/ATM_Addr.cpp + ace/ATM_Connector.cpp + ace/ATM_Params.cpp + ace/ATM_QoS.cpp + ace/ATM_Stream.cpp + ace/Activation_Queue.cpp + ace/Active_Map_Manager.cpp + ace/Addr.cpp + ace/Argv_Type_Converter.cpp + ace/Assert.cpp + ace/Asynch_IO.cpp + ace/Asynch_IO_Impl.cpp + ace/Asynch_Pseudo_Task.cpp + ace/Atomic_Op.cpp + ace/Barrier.cpp + ace/Base_Thread_Adapter.cpp + ace/Based_Pointer_Repository.cpp + ace/Basic_Stats.cpp + ace/Basic_Types.cpp + ace/CDR_Base.cpp + ace/CDR_Size.cpp + ace/CDR_Stream.cpp + ace/Capabilities.cpp + ace/Cleanup.cpp + ace/Codecs.cpp + ace/Codeset_IBM1047.cpp + ace/Codeset_Registry.cpp + ace/Codeset_Registry_db.cpp + ace/Condition_Attributes.cpp + ace/Condition_Recursive_Thread_Mutex.cpp + ace/Condition_Thread_Mutex.cpp + ace/Configuration.cpp + ace/Configuration_Import_Export.cpp + ace/Connection_Recycling_Strategy.cpp + ace/Containers.cpp + ace/Copy_Disabled.cpp + ace/DEV.cpp + ace/DEV_Addr.cpp + ace/DEV_Connector.cpp + ace/DEV_IO.cpp + ace/DLL.cpp + ace/DLL_Manager.cpp + ace/Date_Time.cpp + ace/Dev_Poll_Reactor.cpp + ace/Dirent.cpp + ace/Dirent_Selector.cpp + ace/Dump.cpp + ace/Dynamic.cpp + ace/Dynamic_Message_Strategy.cpp + ace/Dynamic_Service_Base.cpp + ace/Dynamic_Service_Dependency.cpp + ace/Encoding_Converter.cpp + ace/Encoding_Converter_Factory.cpp + ace/Event_Base.cpp + ace/Event_Handler.cpp + ace/Event_Handler_Handle_Timeout_Upcall.cpp + ace/FIFO.cpp + ace/FIFO_Recv.cpp + ace/FIFO_Recv_Msg.cpp + ace/FIFO_Send.cpp + ace/FIFO_Send_Msg.cpp + ace/FILE.cpp + ace/FILE_Addr.cpp + ace/FILE_Connector.cpp + ace/FILE_IO.cpp + ace/File_Lock.cpp + ace/Filecache.cpp + ace/Flag_Manip.cpp + ace/Framework_Component.cpp + ace/Functor.cpp + ace/Functor_String.cpp + ace/Get_Opt.cpp + ace/Handle_Ops.cpp + ace/Handle_Set.cpp + ace/Hashable.cpp + ace/High_Res_Timer.cpp + ace/ICMP_Socket.cpp + ace/INET_Addr.cpp + ace/IOStream.cpp + ace/IO_Cntl_Msg.cpp + ace/IO_SAP.cpp + ace/IPC_SAP.cpp + ace/Init_ACE.cpp + ace/LSOCK.cpp + ace/LSOCK_Acceptor.cpp + ace/LSOCK_CODgram.cpp + ace/LSOCK_Connector.cpp + ace/LSOCK_Dgram.cpp + ace/LSOCK_Stream.cpp + ace/Lib_Find.cpp + ace/Local_Memory_Pool.cpp + ace/Local_Name_Space.cpp + ace/Local_Tokens.cpp + ace/Lock.cpp + ace/Log_Category.cpp + ace/Log_Msg.cpp + ace/Log_Msg_Android_Logcat.cpp + ace/Log_Msg_Backend.cpp + ace/Log_Msg_Callback.cpp + ace/Log_Msg_IPC.cpp + ace/Log_Msg_NT_Event_Log.cpp + ace/Log_Msg_UNIX_Syslog.cpp + ace/Log_Record.cpp + ace/Logging_Strategy.cpp + ace/MEM_Acceptor.cpp + ace/MEM_Addr.cpp + ace/MEM_Connector.cpp + ace/MEM_IO.cpp + ace/MEM_SAP.cpp + ace/MEM_Stream.cpp + ace/MMAP_Memory_Pool.cpp + ace/Malloc.cpp + ace/Malloc_Allocator.cpp + ace/Mem_Map.cpp + ace/Message_Block.cpp + ace/Message_Queue.cpp + ace/Message_Queue_NT.cpp + ace/Message_Queue_Vx.cpp + ace/Method_Request.cpp + ace/Monitor_Admin.cpp + ace/Monitor_Admin_Manager.cpp + ace/Monitor_Base.cpp + ace/Monitor_Control_Action.cpp + ace/Monitor_Control_Types.cpp + ace/Monitor_Point_Registry.cpp + ace/Monitor_Size.cpp + ace/Monotonic_Time_Policy.cpp + ace/Msg_WFMO_Reactor.cpp + ace/Multihomed_INET_Addr.cpp + ace/Mutex.cpp + ace/NT_Service.cpp + ace/Name_Proxy.cpp + ace/Name_Request_Reply.cpp + ace/Name_Space.cpp + ace/Naming_Context.cpp + ace/Netlink_Addr.cpp + ace/Notification_Queue.cpp + ace/Notification_Strategy.cpp + ace/Null_Mutex.cpp + ace/OS_Errno.cpp + ace/OS_Log_Msg_Attributes.cpp + ace/OS_NS_Thread.cpp + ace/OS_NS_arpa_inet.cpp + ace/OS_NS_ctype.cpp + ace/OS_NS_devctl.cpp + ace/OS_NS_dirent.cpp + ace/OS_NS_dlfcn.cpp + ace/OS_NS_errno.cpp + ace/OS_NS_fcntl.cpp + ace/OS_NS_math.cpp + ace/OS_NS_netdb.cpp + ace/OS_NS_poll.cpp + ace/OS_NS_pwd.cpp + ace/OS_NS_regex.cpp + ace/OS_NS_signal.cpp + ace/OS_NS_stdio.cpp + ace/OS_NS_stdlib.cpp + ace/OS_NS_string.cpp + ace/OS_NS_strings.cpp + ace/OS_NS_stropts.cpp + ace/OS_NS_sys_mman.cpp + ace/OS_NS_sys_msg.cpp + ace/OS_NS_sys_resource.cpp + ace/OS_NS_sys_select.cpp + ace/OS_NS_sys_sendfile.cpp + ace/OS_NS_sys_shm.cpp + ace/OS_NS_sys_socket.cpp + ace/OS_NS_sys_stat.cpp + ace/OS_NS_sys_time.cpp + ace/OS_NS_sys_uio.cpp + ace/OS_NS_sys_utsname.cpp + ace/OS_NS_sys_wait.cpp + ace/OS_NS_time.cpp + ace/OS_NS_unistd.cpp + ace/OS_NS_wchar.cpp + ace/OS_NS_wctype.cpp + ace/OS_QoS.cpp + ace/OS_TLI.cpp + ace/OS_Thread_Adapter.cpp + ace/OS_main.cpp + ace/Obchunk.cpp + ace/Object_Manager.cpp + ace/Object_Manager_Base.cpp + ace/Obstack.cpp + ace/PI_Malloc.cpp + ace/POSIX_Asynch_IO.cpp + ace/POSIX_CB_Proactor.cpp + ace/POSIX_Proactor.cpp + ace/Pagefile_Memory_Pool.cpp + ace/Parse_Node.cpp + ace/Ping_Socket.cpp + ace/Pipe.cpp + ace/Priority_Reactor.cpp + ace/Proactor.cpp + ace/Proactor_Impl.cpp + ace/Process.cpp + ace/Process_Manager.cpp + ace/Process_Mutex.cpp + ace/Process_Semaphore.cpp + ace/Profile_Timer.cpp + ace/RW_Mutex.cpp + ace/RW_Process_Mutex.cpp + ace/RW_Thread_Mutex.cpp + ace/Reactor.cpp + ace/Reactor_Impl.cpp + ace/Reactor_Notification_Strategy.cpp + ace/Reactor_Timer_Interface.cpp + ace/Read_Buffer.cpp + ace/Recursive_Thread_Mutex.cpp + ace/Recyclable.cpp + ace/Registry.cpp + ace/Registry_Name_Space.cpp + ace/Remote_Name_Space.cpp + ace/Remote_Tokens.cpp + ace/SOCK.cpp + ace/SOCK_Acceptor.cpp + ace/SOCK_CODgram.cpp + ace/SOCK_Connector.cpp + ace/SOCK_Dgram.cpp + ace/SOCK_Dgram_Bcast.cpp + ace/SOCK_Dgram_Mcast.cpp + ace/SOCK_IO.cpp + ace/SOCK_Netlink.cpp + ace/SOCK_SEQPACK_Acceptor.cpp + ace/SOCK_SEQPACK_Association.cpp + ace/SOCK_SEQPACK_Connector.cpp + ace/SOCK_Stream.cpp + ace/SPIPE.cpp + ace/SPIPE_Acceptor.cpp + ace/SPIPE_Addr.cpp + ace/SPIPE_Connector.cpp + ace/SPIPE_Stream.cpp + ace/SString.cpp + ace/SUN_Proactor.cpp + ace/SV_Message.cpp + ace/SV_Message_Queue.cpp + ace/SV_Semaphore_Complex.cpp + ace/SV_Semaphore_Simple.cpp + ace/SV_Shared_Memory.cpp + ace/Sample_History.cpp + ace/Sbrk_Memory_Pool.cpp + ace/Sched_Params.cpp + ace/Select_Reactor_Base.cpp + ace/Semaphore.cpp + ace/Service_Config.cpp + ace/Service_Gestalt.cpp + ace/Service_Manager.cpp + ace/Service_Object.cpp + ace/Service_Repository.cpp + ace/Service_Types.cpp + ace/Shared_Memory.cpp + ace/Shared_Memory_MM.cpp + ace/Shared_Memory_Pool.cpp + ace/Shared_Memory_SV.cpp + ace/Shared_Object.cpp + ace/Sig_Adapter.cpp + ace/Sig_Handler.cpp + ace/Signal.cpp + ace/Sock_Connect.cpp + ace/Stack_Trace.cpp + ace/Stats.cpp + ace/String_Base_Const.cpp + ace/Svc_Conf_Lexer.cpp + ace/Svc_Conf_y.cpp + ace/Synch_Options.cpp + ace/System_Time.cpp + ace/TLI.cpp + ace/TLI_Acceptor.cpp + ace/TLI_Connector.cpp + ace/TLI_Stream.cpp + ace/TP_Reactor.cpp + ace/TSS_Adapter.cpp + ace/TTY_IO.cpp + ace/Task.cpp + ace/Thread.cpp + ace/Thread_Adapter.cpp + ace/Thread_Control.cpp + ace/Thread_Exit.cpp + ace/Thread_Hook.cpp + ace/Thread_Manager.cpp + ace/Thread_Mutex.cpp + ace/Thread_Semaphore.cpp + ace/Throughput_Stats.cpp + ace/Time_Policy.cpp + ace/Time_Value.cpp + ace/Timeprobe.cpp + ace/Token.cpp + ace/Token_Collection.cpp + ace/Token_Invariants.cpp + ace/Token_Manager.cpp + ace/Token_Request_Reply.cpp + ace/Trace.cpp + ace/UNIX_Addr.cpp + ace/UPIPE_Acceptor.cpp + ace/UPIPE_Connector.cpp + ace/UPIPE_Stream.cpp + ace/UTF16_Encoding_Converter.cpp + ace/UTF32_Encoding_Converter.cpp + ace/UTF8_Encoding_Converter.cpp + ace/UUID.cpp + ace/WFMO_Reactor.cpp + ace/WIN32_Asynch_IO.cpp + ace/WIN32_Proactor.cpp + ace/XML_Svc_Conf.cpp + ace/XTI_ATM_Mcast.cpp + ace/ace_wchar.cpp) + + if (USE_COREPCH) + set(PRIVATE_PCH_HEADER ace/PrecompiledHeaders/WinAcePCH.h) + endif() + + # Group sources + GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) + + add_library(ace STATIC + ${ACE_SOURCES}) + + target_include_directories(ace + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}) + + target_compile_definitions(ace + PUBLIC + ACE_AS_STATIC_LIBS + $<$:_WANT_SEMUN>) + + target_link_libraries(ace + PRIVATE + acore-dependency-interface) + + set_target_properties(ace + PROPERTIES + FOLDER + "deps") + + # Generate precompiled header + if(USE_COREPCH) + add_cxx_pch(ace ${PRIVATE_PCH_HEADER}) + endif() + endif() diff --git a/deps/acelite/COPYING b/deps/acelite/COPYING index 5f66fb4b6..5917f76aa 100644 --- a/deps/acelite/COPYING +++ b/deps/acelite/COPYING @@ -8,7 +8,7 @@ (henceforth referred to as "DOC software") are copyrighted by [5]Douglas C. Schmidt and his [6]research group at [7]Washington University, [8]University of California, Irvine, and [9]Vanderbilt - University, Copyright (c) 1993-2015, all rights reserved. Since DOC + University, Copyright (c) 1993-2019, all rights reserved. Since DOC software is open-source, freely available software, you are free to use, modify, copy, and distribute--perpetually and irrevocably--the DOC software source code and object code produced from the source, as @@ -86,26 +86,26 @@ References - 1. http://www.cs.wustl.edu/~schmidt/ACE.html - 2. http://www.cs.wustl.edu/~schmidt/TAO.html - 3. http://www.dre.vanderbilt.edu/CIAO/ - 4. http://www.dre.vanderbilt.edu/cosmic/ - 5. http://www.dre.vanderbilt.edu/~schmidt/ - 6. http://www.cs.wustl.edu/~schmidt/ACE-members.html - 7. http://www.wustl.edu/ - 8. http://www.uci.edu/ - 9. http://www.vanderbilt.edu/ - 10. mailto:doc_group@cs.wustl.edu - 11. http://www.cs.wustl.edu/~schmidt/ACE-users.html - 12. http://www.cs.wustl.edu/~schmidt/ACE.html - 13. http://www.cs.wustl.edu/~schmidt/TAO.html - 14. http://www.dre.vanderbilt.edu/CIAO/ - 15. http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/DAnCE/ - 16. http://www.dre.vanderbilt.edu/cosmic/ - 17. http://www.dre.vanderbilt.edu/ - 18. http://www.isis.vanderbilt.edu/ - 19. http://www.cs.wustl.edu/~schmidt/doc-center.html - 20. http://www.cs.wustl.edu/~schmidt/commercial-support.html + 1. https://www.dre.vanderbilt.edu/~schmidt/ACE.html + 2. https://www.dre.vanderbilt.edu/~schmidt/TAO.html + 3. https://www.dre.vanderbilt.edu/CIAO/ + 4. https://www.dre.vanderbilt.edu/cosmic/ + 5. https://www.dre.vanderbilt.edu/~schmidt/ + 6. https://www.dre.vanderbilt.edu/~schmidt/ACE-members.html + 7. https://www.wustl.edu/ + 8. https://www.uci.edu/ + 9. https://www.vanderbilt.edu/ + 10. mailto:d.schmidt@vanderbilt.edu + 11. https://www.dre.vanderbilt.edu/~schmidt/ACE-users.html + 12. https://www.dre.vanderbilt.edu/~schmidt/ACE.html + 13. https://www.dre.vanderbilt.edu/~schmidt/TAO.html + 14. https://www.dre.vanderbilt.edu/CIAO/ + 15. https://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/DAnCE/ + 16. https://www.dre.vanderbilt.edu/cosmic/ + 17. https://www.dre.vanderbilt.edu/ + 18. https://www.isis.vanderbilt.edu/ + 19. https://www.cs.wustl.edu/~schmidt/doc-center.html + 20. https://www.dre.vanderbilt.edu/~schmidt/commercial-support.html 21. mailto:d.schmidt@vanderbilt.edu - 22. http://www.dre.vanderbilt.edu/~schmidt/ - 23. http://www.cs.wustl.edu/ACE.html + 22. https://www.dre.vanderbilt.edu/~schmidt/ + 23. https://www.dre.vanderbilt.edu/~schmidt/ACE.html diff --git a/deps/acelite/NEWS b/deps/acelite/NEWS index 60f41f019..1f2586f1c 100644 --- a/deps/acelite/NEWS +++ b/deps/acelite/NEWS @@ -1,3 +1,308 @@ +USER VISIBLE CHANGES BETWEEN ACE-6.5.9 and ACE-6.5.10 +===================================================== + +. Add support for Embarcadero C++ Builder 10.4 Sydney using the + classic compiler. ACE/TAO compile with the new 32/64 bit clang + compilers but runtime tests show several runtime problems which + makes them not safe to use + +. Make a change in the ACE Process Manager to resolve an internal + compiler error with Visual Studio 2019 16.5.x compilers + +. Android enhancements for if_nameindex + +USER VISIBLE CHANGES BETWEEN ACE-6.5.8 and ACE-6.5.9 +==================================================== + +. On Windows, ACE no longer defines _WIN32_WINNT. ACE wrappers for + if_nametoindex and if_indextoname are available if the version of the + Windows SDK supports them. + +. IPv6 extended datagram receive info now supported on macOS. + +. ACE_(U)INT8/16/32/64 map to (u)int8/16/32/64_t when C++11 has been + enabled. + +. CDR_Base uses ACE_INT64 for LongLong, all old emulated support + has been removed + +. Updated debian and rpm packaging support + +USER VISIBLE CHANGES BETWEEN ACE-6.5.7 and ACE-6.5.8 +==================================================== + +. Added instructions to ACE-INSTALL.html for building ACE/TAO for Android on + Windows. + +. Embarcadero C++ Builder Rio fixes + +. Renamed `VERSION` file to `VERSION.txt` to avoid conflicting with the + `version` standard header. + +USER VISIBLE CHANGES BETWEEN ACE-6.5.6 and ACE-6.5.7 +==================================================== + +. Fixed compile problem with glibc 2.30 and newer + +. gnuace makefiles: Updated handling of generated files and + use requires/avoids to make postbuild steps conditional + +. Removed references to the ACE_LACKS_MONOTONIC_TIME preprocessor macro because + it was equivalent to ACE_LACKS_CLOCK_MONOTONIC. + +. Exposed support status of monotonic times features using preprocessor macros. + See "Testing for Monotonic Time Support" in docs/ACE-monotonic-timer.html for + details. + +. Added support for ARM and ARM64 stack traces with Microsoft Visual C++. + +. The "optional argument for the receive address in ACE_SOCK_Dgram::recv" + feature from ACE-6.5.5 is now supported on Windows. This includes enhanced + support for sendmsg/recvmsg on Windows. + +USER VISIBLE CHANGES BETWEEN ACE-6.5.5 and ACE-6.5.6 +==================================================== + +. On Linux, the ACE_Log_Msg format specifier `%t` is now replaced with the + system thread id provided by gettid(), instead of the much longer pthread id. + +. Added support for MQX + +. Enhanced Android support + +USER VISIBLE CHANGES BETWEEN ACE-6.5.4 and ACE-6.5.5 +==================================================== + +. Fixed several broken links due to the removal of + Douglas Schmidt website at WashU + +. On Android: + + . ACE_Log_Msg (and therefore ACE_DEBUG and ACE_ERROR) now uses + Android's logging system (aka Logcat) by default in addition to stderr + because stdout and stderr are discarded under normal circumstances. + To disable this at runtime, run: + ACE_LOG_MSG->clr_flags (ACE_Log_Msg::SYSLOG) + To disable this at compile time include these lines in config.h: + #define ACE_DEFAULT_LOG_FLAGS ACE_Log_Msg::STDERR + #define ACE_DEFAULT_LOG_BACKEND_FLAGS 0 + + . When statically linking to OpenSSL, prevent usage of the preloaded and + unpredictable system SSL library when using ace_openssl. + +. minizip has been moved from ACE to DANCE + +. Add initial support for Visual Studio 2019 + +. Validated ACE for usage SLES15.0 x86_64 using 32bit g++ compiler + +. Add optional argument for the receive address in ACE_SOCK_Dgram::recv + +USER VISIBLE CHANGES BETWEEN ACE-6.5.3 and ACE-6.5.4 +==================================================== + +. Fix ACE_Vector::end(), which now correctly + represents the end of the elements of the vector + instead of the end of the base array. + +USER VISIBLE CHANGES BETWEEN ACE-6.5.2 and ACE-6.5.3 +==================================================== + +. Enhance Android support + +. Fix AIX and Solaris linking rpath errors + +. Add support for SSL_INCDIR/SSL_LIBDIR and XERCESC_INCDIR/XERCESC_LIBDIR + to specify a custom include/lib dir as required for vcpkg versions of + openssl/xercesc + +USER VISIBLE CHANGES BETWEEN ACE-6.5.1 and ACE-6.5.2 +==================================================== + +. Enhanced C++Builder XE2 support + +. ACE_QtReactor can be built with Qt version 5 using the qt5 MPC feature + +USER VISIBLE CHANGES BETWEEN ACE-6.5.0 and ACE-6.5.1 +==================================================== + +. At the moment C++11 or newer is enabled ACE_Strong_Bound_Ptr + doesn't provide the convenience functions to use a + std::auto_ptr anymore + +. Optimized CDR std::(w)string insertion and extraction + when C++11 or newer is enabled + +. Solved Visual Studio 2017 solution loading due to duplicate + files generated in a project file + +USER VISIBLE CHANGES BETWEEN ACE-6.4.8 and ACE-6.5.0 +==================================================== + +. The ACE core libraries now use std::unique_ptr instead + of std::auto_ptr when C++11 or newer is enabled + +USER VISIBLE CHANGES BETWEEN ACE-6.4.7 and ACE-6.4.8 +==================================================== + +. Enhanced Embarcadero C++ Builder support + +. ACE XML_Utils enhancements + +. Debian packaging enhancements + +. Support for clang6 and gcc8 + +. Enhanced Android support + +. Remove addr_any restriction from ipv6_only UDP + +USER VISIBLE CHANGES BETWEEN ACE-6.4.6 and ACE-6.4.7 +==================================================== + +. Added a new, optional argument named ipv6_only to: + ACE_Acceptor::ACE_Acceptor + ACE_Acceptor::open + ACE_SOCK_Dgram::ACE_SOCK_Dgram + ACE_SOCK_Dgram::open + If ipv6_only is 0/false (the default) the socket will accept + both IPv6 and IPv4 connections/datagrams. If ipv6_only is + 1/true the socket will only accept IPv6. + This behavior only applies when ACE_HAS_IPV6 is true and the + local-side IP address is the generic localhost IP address. + +. Integrated some changes from XSC into XML Utils + +. Enable ACE_HAS_CPP11 when we have clang with C++11 enabled + +. Added support for cross compiling using MinGW on a Linux host + +. Added support for FreeBSD 11 + +. Fixed issue ACE_Singleton was broken after ACE::fini, ACE::init (GitHub #554) + +USER VISIBLE CHANGES BETWEEN ACE-6.4.5 and ACE-6.4.6 +==================================================== + +. Fixed some Codacy and C++ Core guidelines reported issues + +. VxWorks 7 (SR0510) support + +. Support make install on newer Apple MacOS versions + +USER VISIBLE CHANGES BETWEEN ACE-6.4.4 and ACE-6.4.5 +==================================================== + +. Add support for OpenSSL 1.1. ACE users on Windows have + to add openssl11=1 to their default.features file so + that the correct OpenSSL library names are used. + +USER VISIBLE CHANGES BETWEEN ACE-6.4.3 and ACE-6.4.4 +==================================================== + +. Enhanced support for Embarcadero C++ Builder 10.2 (Tokyo). + Support for bcc32/bcc64/bcc32c has been enhanced and by + default the clang based versions are used. When the old + bcc32 has to be used set the CLASSIC environment variable + to 1. At this moment runtime test results for bcc64/bcc32c + show some structural problems + +. Add support for Oracle Studio 12.5 + +. Removed usage of ACE_REGISTER and register keyword because + they trigger deprecated warnings with newer gcc and clang + versions + +. Add support for gcc 7 + +. Enhanced Android support + +. Fix ACE_INET_Addr::set(domain_name, AF_UNSPEC) to be set to IPv4 address + when IPv6 is enabled and the domain_name could be resolved to IPv4 address. + +USER VISIBLE CHANGES BETWEEN ACE-6.4.2 and ACE-6.4.3 +==================================================== + +. Enhancements for Visual Studio 2017 + +. Enhancements for Android + +USER VISIBLE CHANGES BETWEEN ACE-6.4.1 and ACE-6.4.2 +==================================================== + +. Added support for Mac OS X on x86_64 to get the network adapter + address in ACE_OS::getmacaddress(). + +. Added support for the December 2016 updates to VxWorks 7. + +USER VISIBLE CHANGES BETWEEN ACE-6.4.0 and ACE-6.4.1 +==================================================== + +. The ACE_DEBUG environment variable can again be used to set the + internal debug flag. This used to work but was mistakenly changed + in an earlier release. + +. Corrected usage of ACE_Singleton and template instantation to be + valid C++ (GCC cross-compiler arm-linux-gnueabihf-g++ requires it). + +. Added support for detecting the Mac OS X version when configured with + ace/config-macosx.h and include/makeinclude/platform_macosx.GNU. + Also on 10.11 El Capitan, use rpath to avoid a problem with SIP. + +. Added support for Android NDK r12b (Platform API 24) and improved + cross compilation support + +USER VISIBLE CHANGES BETWEEN ACE-6.3.4 and ACE-6.4.0 +==================================================== + +. Added support for obtaining the micro version number + +. Reduced include of ace/Auto_Ptr.h in header files + +USER VISIBLE CHANGES BETWEEN ACE-6.3.3 and ACE-6.3.4 +==================================================== + +. ACE_SSL_Context::set_mode() can no longer be used to select a specific + SSL/TLS protocol version, use ACE_SSL_Context::filter_versions() for that. + This follows general advice by the OpenSSL project to go through + SSL_CTX_set_options() to limit the list of protocols available. The purpose + of ACE_SSL_Context::set_mode() is now limited to explicitly restricting + behaviour to client or server (defaults to both). + +. Improve Oracle Studio support + +. CIAO and DAnCE are forked to their own github repositories + and are not part anymore of the ACE+TAO release packages + +. Fixed several Coverity reported issues + +. Added ACE configuration for FACE safety profiles (see config-face-safety.h). + FACE, or Future Airborne Capability Environment http://www.opengroup.org/face, + specifies a restricted subset of OS functions and rules for controlling + dynamic memory allocation. When built in this configuration on a platform + that supports it, ACE conforms to the FACE requirements. + +. ACE uses new netdb.h functions (getaddrinfo/getnameinfo) if they are + available, in place of deprecated functions (gethostbyname/addr). + +USER VISIBLE CHANGES BETWEEN ACE-6.3.2 and ACE-6.3.3 +==================================================== + +. Visual Studio 2015 has adequate C++11 support, because of this + ACE_HAS_CPP11 is now defined with this compiler. A large amount + of warnings given by this new compiler have been fixed + +. As part of the release script we generate vc12 and vc14 + solution files which are packaged as part of the release + +. Added support for VxWorks 7 (kernel mode and RTP). + See the comments in include/makeinclude/platform_vxworks7.0.GNU for details. + +. Ended daily maintenance for OpenVMS + +. Fixed a defect in ACE_INET_Addr when there is a non-empty interface + address list and set_port_number() is called. + USER VISIBLE CHANGES BETWEEN ACE-6.3.1 and ACE-6.3.2 ==================================================== @@ -131,7 +436,7 @@ USER VISIBLE CHANGES BETWEEN ACE-6.2.4 and ACE-6.2.5 USER VISIBLE CHANGES BETWEEN ACE-6.2.3 and ACE-6.2.4 ==================================================== -. Added support for FC20 and ended support for FC19 +. Added support for FC20 and ended maintenance for FC19 . Extended C++11 feature test suite diff --git a/deps/acelite/PROBLEM-REPORT-FORM b/deps/acelite/PROBLEM-REPORT-FORM new file mode 100644 index 000000000..7a6ba05c9 --- /dev/null +++ b/deps/acelite/PROBLEM-REPORT-FORM @@ -0,0 +1,87 @@ +[Please use the PRF form below to submit bug reports, problem reports, + etc., to the ACE developers and interested users. Send it to + ace-bugs@list.isis.vanderbilt.edu, you must be subscribed to the list + in order to be able to post to it. If you are using OCI, MicroFocus, or + Riverace's versions of ACE do not send bugs to this mailing list, but + instead contact those companies for support. Please also send your + PRF as plain ASCII text, _not_ uuencoded or as an attachment. + + We prefer that all bug reports be submitted through github issues. + See https://github.com/DOCGroup/ACE_TAO/issues for more information + about how to do this. If you are unsure as to whether your problem + is a real bug or not then please submit your question to the mailing + list using the following form. Not using the problem report form + will make it harder or impossible to identify the problem, and in + many cases we will be unable to help at all. Also please try to + browse the existing github isssues and the ChangeLog files to find + out if your problem has been solved in a more recent version of ACE. + + To subscribe to the list see + https://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html + + Replace/remove all the explanatory text in brackets before mailing. + + Please send this form as ASCII text only. Do _not_ send it as an + attachment, or as tar'ed, compressed and/or uuencoded text. And + limit line lengths to less than 80 characters. + + PLEASE make your Subject: line as descriptive as possible. + Subjects like "ACE bug" or "bug report" are not helpful! + Also, do _not_ include the word "help" in the Subject!] + + When including your config.h and platform_macros.GNU files as requested + below, only include the contents if you use the recommended method of + including the platform-specific file in your file. If you use a link + to the platform-specific file, simply state which one - DO NOT + include an entire platform-specific configuration file in the form. + +8<----------8<----------8<----------8<----------8<----------8<----------8<---- + +To: ace-bugs@list.isis.vanderbilt.edu +Subject: [area]: [synopsis] + + ACE VERSION: 6.5.10 + + HOST MACHINE and OPERATING SYSTEM: + If on Windows based OS's, which version of WINSOCK do you + use?: + + TARGET MACHINE and OPERATING SYSTEM, if different from HOST: + COMPILER NAME AND VERSION (AND PATCHLEVEL): + + THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform- + specific file, simply state which one]: + + THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you + use a link to a platform-specific file, simply state which one + (unless this isn't used in this case, e.g., with Microsoft Visual + C++)]: + + CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features + (used by MPC when you generate your own makefiles): + + AREA/CLASS/EXAMPLE AFFECTED: +[What example failed? What module failed to compile?] + + DOES THE PROBLEM AFFECT: + COMPILATION? + LINKING? + On Unix systems, did you run make realclean first? + EXECUTION? + OTHER (please specify)? +[Please indicate whether ACE, your application, or both are affected.] + + SYNOPSIS: +[Brief description of the problem] + + DESCRIPTION: +[Detailed description of problem. Don't just say " +doesn't work, here's a fix," explain what your program does +to get to the state. ] + + REPEAT BY: +[What you did to get the error; include test program or session +transcript if at all possible. ] + + SAMPLE FIX/WORKAROUND: +[If available ] diff --git a/deps/acelite/README b/deps/acelite/README index ba3a21e15..e00ba30f2 100644 --- a/deps/acelite/README +++ b/deps/acelite/README @@ -1,11 +1,9 @@ - - This document is also available at the following URL: -http://www.dre.vanderbilt.edu/~schmidt/ACE.html +https://www.dre.vanderbilt.edu/~schmidt/ACE.html All software and documentation is available via both anonymous ftp and -the http.] +http. THE ADAPTIVE COMMUNICATION ENVIRONMENT (ACE) @@ -45,7 +43,7 @@ ACE is currently used in commercial projects and products by dozens of companies including Ericsson, Bellcore, Siemens, Motorola, Kodak, Boeing, Lucent, DEC, Lockheed Martin, and SAIC. Commercial support for ACE is available from several companies as listed at -http://www.cs.wustl.edu/~schmidt/commercial-support.html +http://www.dre.vanderbilt.edu/~schmidt/commercial-support.html ---------------------------------------- @@ -55,28 +53,28 @@ The lower-level portions of ACE provide a set of portable and type-secure C++ wrappers that encapsulate the following C language OS interfaces: - . IPC mechanisms - -- e.g., Internet- and UNIX-domain sockets, TLI, Named - Pipes (for UNIX and Win32) and STREAM pipes; +. IPC mechanisms + -- e.g., Internet- and UNIX-domain sockets, TLI, Named + Pipes (for UNIX and Win32) and STREAM pipes; - . Event demultiplexing - -- e.g., select(), poll(), and Win32 - WaitForMultipleObjects and I/O completion ports; +. Event demultiplexing + -- e.g., select(), poll(), and Win32 + WaitForMultipleObjects and I/O completion ports; - . Multi-threading and synchronization - -- e.g., Solaris threads, POSIX Pthreads, and Win32 - threads; +. Multi-threading and synchronization + -- e.g., Solaris threads, POSIX Pthreads, and Win32 + threads; - . Explicit dynamic linking - -- e.g., dlopen/dlsym on UNIX and LoadLibrary/GetProc - on Win32; +. Explicit dynamic linking + -- e.g., dlopen/dlsym on UNIX and LoadLibrary/GetProc + on Win32; - . Memory-mapped files and shared memory management - -- e.g., BSD mmap(), SYSV shared memory, and Win32 - shared memory; +. Memory-mapped files and shared memory management + -- e.g., BSD mmap(), SYSV shared memory, and Win32 + shared memory; - . System V IPC - -- e.g., shared memory, semaphores, message queues. +. System V IPC + -- e.g., shared memory, semaphores, message queues. The OS Adaptation Layer shields the upper levels of ACE from platform dependencies associated with the underlying OS interfaces. @@ -91,25 +89,25 @@ supports the dynamic configuration of concurrent distributed services into applications. The framework portion of ACE contains the following class categories: - . The Reactor - -- Supports both Reactive and Proactive I/O; +. The Reactor + -- Supports both Reactive and Proactive I/O; - . The Service Configurator - -- Support dynamic (re)configuration of objects; +. The Service Configurator + -- Support dynamic (re)configuration of objects; - . The ADAPTIVE Service Executive - -- A user-level implementation of System V STREAMS, - that supports modular integration of - hierarchically-related communicaion services; +. The ADAPTIVE Service Executive + -- A user-level implementation of System V STREAMS, + that supports modular integration of + hierarchically-related communication services; - . Concurrency - -- Various types of higher-level concurrency - control and synchronization patterns (such as - Polymorphic Futures and Active Objects); +. Concurrency + -- Various types of higher-level concurrency + control and synchronization patterns (such as + Polymorphic Futures and Active Objects); - . Shared Malloc - -- Components for managing dynamically allocation - of shared and local memory; +. Shared Malloc + -- Components for managing dynamically allocation + of shared and local memory; ---------------------------------------- @@ -119,13 +117,13 @@ Finally, ACE provides a standard library of distributed services that are packaged as components. These service components play two roles in ACE: - 1. They provide reusable components for common distributed - system tasks such as logging, naming, locking, and time - synchronization. +1. They provide reusable components for common distributed + system tasks such as logging, naming, locking, and time + synchronization. - 2. They illustrate how to utilize ACE features such as the - Reactor, Service Configurator, Service Initialization, - Concurrency, and IPC components. +2. They illustrate how to utilize ACE features such as the + Reactor, Service Configurator, Service Initialization, + Concurrency, and IPC components. ---------------------------------------- @@ -138,19 +136,19 @@ Ericsson, Motorola, and Lucent; medical imaging systems at Siemens and Kodak; and many academic research projects. Two example middleware applications provided with the ACE release include: - 1. The ACE ORB (TAO) -- TAO is a real-time implementation of - CORBA built using the framework components and patterns - provided by ACE. +1. The ACE ORB (TAO) -- TAO is a real-time implementation of + CORBA built using the framework components and patterns + provided by ACE. - 2. JAWS -- JAWS is a high-performance, adaptive Web server - built using the components in ACE. +2. JAWS -- JAWS is a high-performance, adaptive Web server + built using the components in ACE. ---------------------------------------- OBTAINING ACE ACE may be obtained electronically from -http://download.dre.vanderbilt.edu. This release contains the source +https://download.dre.vanderbilt.edu. This release contains the source code, test drivers, and example applications (including JAWS) for C++ wrapper libraries and the higher-level ACE network programming framework developed as part of the ADAPTIVE project at the University @@ -186,8 +184,7 @@ A mailing list, ace-users@list.isis.vanderbilt.edu, is available for discussing bug fixes, enhancements, and porting issues regarding ACE. Please send mail to me at the ace-users-request@list.isis.vanderbilt.edu if you'd like to join the -mailing list. There is also a USENET newsgroup called -comp.soft-sys.ace. Please see +mailing list. Please see http://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html for details on how to subscribe to the mailing list. @@ -195,8 +192,7 @@ how to subscribe to the mailing list. BUILDING AND INSTALLING ACE -Please refer to the -http://www.dre.vanderbilt.edu/~schmidt/ACE-install.html file for +Please refer to the $ACE_ROOT/ACE-INSTALL.html file for information on how to build and test the ACE wrappers. The BIBLIOGRAPHY file contains information on where to obtain articles that describe the ACE wrappers and the ADAPTIVE system in more detail. @@ -208,11 +204,9 @@ $ACE_ROOT/PROBLEM-REPORT-FORM. Please use the same form to submit questions, comments, etc. To ensure that you see responses, please do one of the following: - 1) Subscribe to the ace-users mail list, by sending email with - contents "subscribe ace-users" to - ace-users-request@list.isis.vanderbilt.edu. - - 2) Or, monitor the comp.soft-sys.ace newsgroup for responses. +1) Subscribe to the ace-users mail list, by sending email with + contents "subscribe ace-users" to + ace-users-request@list.isis.vanderbilt.edu. ---------------------------------------- diff --git a/deps/acelite/THANKS b/deps/acelite/THANKS index bbbb98c23..10b223188 100644 --- a/deps/acelite/THANKS +++ b/deps/acelite/THANKS @@ -2324,7 +2324,7 @@ Tim Pinkawa Ed Blackmond Dave Inma Perea -David Ward +David Ward Anatoli Sakhnik Max Zhou Daynesh Mangal @@ -2394,6 +2394,7 @@ David Lifshitz Milo H. Fields Thomas Schmidt Joe Zendle +Cesar Mello I would particularly like to thank Paul Stephenson, who worked with me at Ericsson in the early 1990's. Paul devised the recursive Makefile diff --git a/deps/acelite/VERSION.txt b/deps/acelite/VERSION.txt new file mode 100644 index 000000000..b37ee3db0 --- /dev/null +++ b/deps/acelite/VERSION.txt @@ -0,0 +1,8 @@ +This is ACE version 6.5.10, released Wed Jul 01 09:54:36 CEST 2020 + +If you have any problems with or questions about ACE, please send +e-mail to the ACE mailing list (ace-bugs@list.isis.vanderbilt.edu), +using the form found in the file PROBLEM-REPORT-FORM. In order +to post to the list you must subscribe to it. + +See http://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html diff --git a/deps/acelite/ace/ACE.cpp b/deps/acelite/ace/ACE.cpp index 0e35b2ceb..0ff5080d6 100644 --- a/deps/acelite/ace/ACE.cpp +++ b/deps/acelite/ace/ACE.cpp @@ -108,6 +108,12 @@ ACE::beta_version (void) return ACE_BETA_VERSION; } +u_int +ACE::micro_version (void) +{ + return ACE_MICRO_VERSION; +} + const ACE_TCHAR * ACE::compiler_name (void) { @@ -158,7 +164,9 @@ ACE::nibble2hex (u_int n) bool ACE::debug (void) { - static const char* debug = ACE_OS::getenv ("ACELIB_DEBUG"); + //FUZZ: disable check_for_ace_log_categories + static const char *debug = ACE_OS::getenv ("ACE_DEBUG"); + //FUZZ: enable check_for_ace_log_categories return (ACE::debug_ != 0) ? ACE::debug_ : (debug != 0 ? (*debug != '0') : false); } @@ -909,7 +917,7 @@ ACE::recv_n_i (ACE_HANDLE handle, // number of (char *ptr, int len) tuples. However, the count N is the // *total* number of trailing arguments, *not* a couple of the number // of tuple pairs! - +#if !defined (ACE_LACKS_VA_FUNCTIONS) ssize_t ACE::recv (ACE_HANDLE handle, size_t n, ...) { @@ -919,9 +927,16 @@ ACE::recv (ACE_HANDLE handle, size_t n, ...) #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -934,11 +949,17 @@ ACE::recv (ACE_HANDLE handle, size_t n, ...) ssize_t const result = ACE_OS::recvv (handle, iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; } +#endif /* ACE_LACKS_VA_FUNCTIONS */ + ssize_t ACE::recvv (ACE_HANDLE handle, @@ -993,7 +1014,6 @@ ACE::recvv_n_i (ACE_HANDLE handle, if (result != -1) { // Blocking subsided. Continue data transfer. - n = 0; continue; } } @@ -1057,7 +1077,6 @@ ACE::recvv_n_i (ACE_HANDLE handle, { // Blocking subsided in period. Continue // data transfer. - n = 0; continue; } } @@ -1684,7 +1703,7 @@ ACE::send_n_i (ACE_HANDLE handle, // the ints (basically, an varargs version of writev). The count N is // the *total* number of trailing arguments, *not* a couple of the // number of tuple pairs! - +#if !defined (ACE_LACKS_VA_FUNCTIONS) ssize_t ACE::send (ACE_HANDLE handle, size_t n, ...) { @@ -1694,9 +1713,16 @@ ACE::send (ACE_HANDLE handle, size_t n, ...) #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -1709,11 +1735,16 @@ ACE::send (ACE_HANDLE handle, size_t n, ...) ssize_t result = ACE_OS::sendv (handle, iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; } +#endif /* ACE_LACKS_VA_FUNCTIONS */ ssize_t ACE::sendv (ACE_HANDLE handle, @@ -1773,7 +1804,6 @@ ACE::sendv_n_i (ACE_HANDLE handle, if (result != -1) { // Blocking subsided. Continue data transfer. - n = 0; continue; } } @@ -1843,7 +1873,6 @@ ACE::sendv_n_i (ACE_HANDLE handle, { // Blocking subsided in period. Continue // data transfer. - n = 0; continue; } } @@ -2162,9 +2191,9 @@ ACE::writev_n (ACE_HANDLE handle, int ACE::handle_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout, - int read_ready, - int write_ready, - int exception_ready) + bool read_ready, + bool write_ready, + bool exception_ready) { #if defined (ACE_HAS_POLL) ACE_UNUSED_ARG (exception_ready); @@ -2285,6 +2314,7 @@ ACE::format_hexdump (const char *buffer, // We can fit 16 bytes output in text mode per line, 4 chars per byte. size_t maxlen = (obuf_sz / 68) * 16; + const ACE_TCHAR *const obuf_start = obuf; if (size > maxlen) size = maxlen; @@ -2299,22 +2329,20 @@ ACE::format_hexdump (const char *buffer, for (j = 0 ; j < 16; j++) { c = (u_char) buffer[(i << 4) + j]; // or, buffer[i*16+j] - ACE_OS::sprintf (obuf, + ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start), ACE_TEXT ("%02x "), c); obuf += 3; if (j == 7) { - ACE_OS::sprintf (obuf, - ACE_TEXT (" ")); - ++obuf; + *obuf++ = ACE_TEXT (' '); } textver[j] = ACE_OS::ace_isprint (c) ? c : u_char ('.'); } textver[j] = 0; - ACE_OS::sprintf (obuf, + ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start), #if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) ACE_TEXT (" %ls\n"), #else @@ -2331,35 +2359,31 @@ ACE::format_hexdump (const char *buffer, for (i = 0 ; i < size % 16; i++) { c = (u_char) buffer[size - size % 16 + i]; - ACE_OS::sprintf (obuf, + ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start), ACE_TEXT ("%02x "), c); obuf += 3; if (i == 7) { - ACE_OS::sprintf (obuf, - ACE_TEXT (" ")); - ++obuf; + *obuf++ = ACE_TEXT (' '); } textver[i] = ACE_OS::ace_isprint (c) ? c : u_char ('.'); } for (i = size % 16; i < 16; i++) { - ACE_OS::sprintf (obuf, + ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start), ACE_TEXT (" ")); obuf += 3; if (i == 7) { - ACE_OS::sprintf (obuf, - ACE_TEXT (" ")); - ++obuf; + *obuf++ = ACE_TEXT (' '); } textver[i] = ' '; } textver[i] = 0; - ACE_OS::sprintf (obuf, + ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start), #if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) ACE_TEXT (" %ls\n"), #else @@ -2370,11 +2394,10 @@ ACE::format_hexdump (const char *buffer, return size; } -// Returns the current timestamp in the form -// "hour:minute:second:microsecond." The month, day, and year are -// also stored in the beginning of the date_and_time array -// using ISO-8601 format. - +/// Returns the current timestamp in the form +/// "hour:minute:second:microsecond." The month, day, and year are +/// also stored in the beginning of the date_and_time array +/// using ISO-8601 format. ACE_TCHAR * ACE::timestamp (ACE_TCHAR date_and_time[], size_t date_and_timelen, @@ -2386,13 +2409,12 @@ ACE::timestamp (ACE_TCHAR date_and_time[], return_pointer_to_first_digit); } -// Returns the given timestamp in the form -// "hour:minute:second:microsecond." The month, day, and year are -// also stored in the beginning of the date_and_time array -// using ISO-8601 format. -// 012345678901234567890123456 -// 2010-12-02 12:56:00.123456 - +/// Returns the given timestamp in the form +/// "hour:minute:second:microsecond." The month, day, and year are +/// also stored in the beginning of the date_and_time array +/// using ISO-8601 format. +/// 012345678901234567890123456 +/// 2010-12-02 12:56:00.123456 ACE_TCHAR * ACE::timestamp (const ACE_Time_Value& time_value, ACE_TCHAR date_and_time[], @@ -2429,8 +2451,7 @@ ACE::timestamp (const ACE_Time_Value& time_value, return &date_and_time[10 + (return_pointer_to_first_digit != 0)]; } -// This function rounds the request to a multiple of the page size. - +/// This function rounds the request to a multiple of the page size. size_t ACE::round_to_pagesize (size_t len) { @@ -2612,8 +2633,7 @@ ACE::handle_timed_complete (ACE_HANDLE h, return h; } -// Wait up to amount of time to accept a connection. - +/// Wait up to @a timeout amount of time to accept a connection. int ACE::handle_timed_accept (ACE_HANDLE listener, ACE_Time_Value *timeout, @@ -2682,9 +2702,8 @@ ACE::handle_timed_accept (ACE_HANDLE listener, } } -// Make the current process a UNIX daemon. This is based on Stevens -// code from APUE. - +/// Make the current process a UNIX daemon. This is based on Stevens +/// code from APUE. int ACE::daemonize (const ACE_TCHAR pathname[], bool close_all_handles, @@ -2770,7 +2789,7 @@ ACE::fork (const ACE_TCHAR *program_name, { case 0: // grandchild returns 0. return 0; - case -1: // assumes all errnos are < 256 + case static_cast(-1): // assumes all errnos are < 256 ACE_OS::_exit (errno); default: // child terminates, orphaning grandchild ACE_OS::_exit (0); @@ -2816,7 +2835,7 @@ ACE::max_handles (void) # endif /* RLIM_INFINITY */ #endif /* RLIMIT_NOFILE && !ACE_LACKS_RLIMIT */ -#if defined (_SC_OPEN_MAX) +#if defined (_SC_OPEN_MAX) && !defined (ACE_LACKS_SYSCONF) return static_cast (ACE_OS::sysconf (_SC_OPEN_MAX)); #elif defined (FD_SETSIZE) return FD_SETSIZE; @@ -2888,7 +2907,7 @@ ACE::set_handle_limit (int new_limit, return 0; } -// Euclid's greatest common divisor algorithm. +/// Euclid's greatest common divisor algorithm. u_long ACE::gcd (u_long x, u_long y) { @@ -2903,7 +2922,7 @@ ACE::gcd (u_long x, u_long y) } -// Calculates the minimum enclosing frame size for the given values. +/// Calculates the minimum enclosing frame size for the given values. u_long ACE::minimum_frame_size (u_long period1, u_long period2) { @@ -3104,7 +3123,9 @@ ACE::sock_error (int error) return ACE_TEXT ("destination address required"); /* NOTREACHED */ default: - ACE_OS::sprintf (unknown_msg, ACE_TEXT ("unknown error: %d"), error); + ACE_OS::snprintf (unknown_msg, + sizeof unknown_msg / sizeof unknown_msg[0], + ACE_TEXT ("unknown error: %d"), error); return unknown_msg; /* NOTREACHED */ } @@ -3188,9 +3209,15 @@ ACE::strndup (const char *str, size_t n) continue; char *s; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (s, + (char *) ACE_Allocator::instance()->malloc (len + 1), + 0); +#else ACE_ALLOCATOR_RETURN (s, (char *) ACE_OS::malloc (len + 1), 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ return ACE_OS::strsncpy (s, str, len + 1); } @@ -3209,11 +3236,18 @@ ACE::strndup (const wchar_t *str, size_t n) len++) continue; - wchar_t *s; + size_t const size = (len + 1) * sizeof (wchar_t); + wchar_t *s = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) ACE_ALLOCATOR_RETURN (s, - static_cast ( - ACE_OS::malloc ((len + 1) * sizeof (wchar_t))), + static_cast ( + ACE_Allocator::instance ()->malloc (size)), 0); +#else + ACE_ALLOCATOR_RETURN (s, + static_cast (ACE_OS::malloc (size)), + 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ return ACE_OS::strsncpy (s, str, len + 1); } #endif /* ACE_HAS_WCHAR */ @@ -3233,9 +3267,17 @@ ACE::strnnew (const char *str, size_t n) continue; char *s; + +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (s, + static_cast (ACE_Allocator::instance ()->malloc (sizeof (char) * (len + 1))), + 0); +#else ACE_NEW_RETURN (s, char[len + 1], 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ + return ACE_OS::strsncpy (s, str, len + 1); } @@ -3288,9 +3330,16 @@ ACE::strnew (const char *s) if (s == 0) return 0; char *t = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (t, + static_cast (ACE_Allocator::instance ()->malloc (sizeof (char) * (ACE_OS::strlen (s) + 1))), + 0); +#else ACE_NEW_RETURN (t, char [ACE_OS::strlen (s) + 1], 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ + return ACE_OS::strcpy (t, s); } @@ -3300,10 +3349,19 @@ ACE::strnew (const wchar_t *s) { if (s == 0) return 0; + + size_t const n = ACE_OS::strlen (s) + 1; wchar_t *t = 0; - ACE_NEW_RETURN (t, - wchar_t[ACE_OS::strlen (s) + 1], - 0); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (t, + static_cast ( + ACE_Allocator::instance ()->malloc ( + sizeof (wchar_t) * (n))), + 0); +#else + ACE_NEW_RETURN (t, wchar_t[n], 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ + return ACE_OS::strcpy (t, s); } #endif /* ACE_HAS_WCHAR */ diff --git a/deps/acelite/ace/ACE.h b/deps/acelite/ace/ACE.h index 370bd36bb..d10dc6710 100644 --- a/deps/acelite/ace/ACE.h +++ b/deps/acelite/ace/ACE.h @@ -11,7 +11,7 @@ * in order to manage the namespace better. These functions are put * here rather than in @c ACE_OS in order to separate concerns. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -54,14 +54,18 @@ class ACE_Handle_Set; namespace ACE { // = ACE version information. - /// e.g., the "5" in ACE 5.1.12. + /// e.g., the "6" in ACE 6.3.4 extern ACE_Export u_int major_version (void); - /// e.g., the "1" in ACE 5.1.12. + /// e.g., the "3" in ACE 6.3.4 extern ACE_Export u_int minor_version (void); - /// e.g., the "12" in ACE 5.1.12. - /// Returns 0 for "stable" (non-beta) releases. + /// e.g., the "4" in ACE 6.3.4 + /// Returns 0 for "stable" (non-micro) releases. + extern ACE_Export u_int micro_version (void); + + /// e.g., the "4" in ACE 6.3.4 + /// Returns 0 for "stable" (non-micro) releases. extern ACE_Export u_int beta_version (void); // = C++ compiler version information. @@ -211,7 +215,9 @@ namespace ACE * * @return -1 on error, else total number of bytes received. */ +#if !defined (ACE_LACKS_VA_FUNCTIONS) extern ACE_Export ssize_t recv (ACE_HANDLE handle, size_t n, ...); +#endif /* ACE_LACKS_VA_FUNCTIONS */ extern ACE_Export ssize_t recvv (ACE_HANDLE handle, iovec *iov, @@ -292,7 +298,9 @@ namespace ACE size_t *bytes_transferred = 0); /// Varargs variant. +#if !defined (ACE_LACKS_VA_FUNCTIONS) extern ACE_Export ssize_t send (ACE_HANDLE handle, size_t n, ...); +#endif /* ACE_LACKS_VA_FUNCTIONS */ extern ACE_Export ssize_t sendv (ACE_HANDLE handle, const iovec *iov, @@ -718,9 +726,9 @@ namespace ACE /// @retval 1 the handle is ready extern ACE_Export int handle_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout, - int read_ready, - int write_ready, - int exception_ready); + bool read_ready, + bool write_ready, + bool exception_ready); /// Wait for @a timeout before proceeding to a @c recv operation. /// @a val keeps track of whether we're in non-blocking mode or @@ -869,7 +877,6 @@ namespace ACE int iovcnt, const ACE_Time_Value *timeout, size_t *bytes_transferred); - } // Close versioned namespace, if enabled by the user. diff --git a/deps/acelite/ace/ACE.inl b/deps/acelite/ace/ACE.inl index 95f45ee99..4e7a77e5d 100644 --- a/deps/acelite/ace/ACE.inl +++ b/deps/acelite/ace/ACE.inl @@ -1,7 +1,4 @@ // -*- C++ -*- -// -// $Id: ACE.inl 95761 2012-05-15 18:23:04Z johnnyw $ - #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_Thread.h" #include "ace/OS_NS_ctype.h" @@ -10,7 +7,6 @@ // Open versioned namespace, if enabled by the user. ACE_BEGIN_VERSIONED_NAMESPACE_DECL - // Wrappers for methods that have been moved to ACE_OS. ACE_INLINE ssize_t @@ -220,7 +216,7 @@ ACE::sendv_n (ACE_HANDLE handle, ACE_INLINE ssize_t ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len) { -#if defined (ACE_WIN32) || defined (HPUX) +#if defined (ACE_WIN32) || defined (HPUX) || defined (ACE_MQX) return ACE_OS::send (handle, (const char *) buf, len); #else return ACE_OS::write (handle, (const char *) buf, len); @@ -230,7 +226,7 @@ ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len) ACE_INLINE ssize_t ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len) { -#if defined (ACE_WIN32) || defined (ACE_OPENVMS) +#if defined (ACE_WIN32) || defined (ACE_OPENVMS) || defined (ACE_MQX) return ACE_OS::recv (handle, (char *) buf, len); #else return ACE_OS::read (handle, (char *) buf, len); @@ -240,25 +236,29 @@ ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len) ACE_INLINE int ACE::handle_read_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout) { - return ACE::handle_ready (handle, timeout, 1, 0, 0); + return ACE::handle_ready (handle, timeout, true, false, false); } ACE_INLINE int ACE::handle_write_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout) { - return ACE::handle_ready (handle, timeout, 0, 1, 0); + return ACE::handle_ready (handle, timeout, false, true, false); } ACE_INLINE int ACE::handle_exception_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout) { - return ACE::handle_ready (handle, timeout, 0, 0, 1); + return ACE::handle_ready (handle, timeout, false, false, true); } ACE_INLINE void ACE::strdelete (char *s) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(s); +#else delete [] s; +#endif /* ACE_HAS_ALLOC_HOOKS */ } #if defined (ACE_HAS_WCHAR) diff --git a/deps/acelite/ace/ACE_crc32.cpp b/deps/acelite/ace/ACE_crc32.cpp index f9eb064f5..d3e994305 100644 --- a/deps/acelite/ace/ACE_crc32.cpp +++ b/deps/acelite/ace/ACE_crc32.cpp @@ -1,5 +1,3 @@ -// $Id: ACE_crc32.cpp 91286 2010-08-05 09:04:31Z johnnyw $ - #include "ace/ACE.h" namespace diff --git a/deps/acelite/ace/ACE_crc_ccitt.cpp b/deps/acelite/ace/ACE_crc_ccitt.cpp index c1455d791..374637e3d 100644 --- a/deps/acelite/ace/ACE_crc_ccitt.cpp +++ b/deps/acelite/ace/ACE_crc_ccitt.cpp @@ -1,5 +1,3 @@ -// $Id: ACE_crc_ccitt.cpp 96017 2012-08-08 22:18:09Z mitza $ - #include "ace/ACE.h" namespace diff --git a/deps/acelite/ace/ACE_export.h b/deps/acelite/ace/ACE_export.h index 74c62ec34..7cb9fa2bb 100644 --- a/deps/acelite/ace/ACE_export.h +++ b/deps/acelite/ace/ACE_export.h @@ -1,5 +1,4 @@ // -*- C++ -*- -// $Id: ACE_export.h 91683 2010-09-09 09:07:49Z johnnyw $ // Definition for Win32 Export directives. // This file is generated automatically by // generate_export_file.pl @@ -8,7 +7,7 @@ #ifndef ACE_EXPORT_H #define ACE_EXPORT_H -#include "ace/config-lite.h" +#include /**/ "ace/config-lite.h" #if defined (ACE_AS_STATIC_LIBS) @@ -43,21 +42,10 @@ # define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) #endif /* ACE_HAS_DLL */ -// Added by hand to help with ACE_OS namespace -#if defined (__TANDEM) && defined (USE_EXPLICIT_EXPORT) -#define ACE_NAMESPACE_STORAGE_CLASS ACE_EXPORT_MACRO extern -#else #define ACE_NAMESPACE_STORAGE_CLASS extern ACE_EXPORT_MACRO -#endif #if defined (__ACE_INLINE__) -# if defined (_MSC_VER) || defined (__MINGW32__) || defined (CYGWIN32) || \ - (defined (__SUNPRO_CC) && __SUNPRO_CC >= 0x560) || \ - (defined (__HP_aCC) && (__HP_aCC >= 60500)) -# define ACE_NAMESPACE_INLINE_FUNCTION inline -# else -# define ACE_NAMESPACE_INLINE_FUNCTION ACE_NAMESPACE_STORAGE_CLASS inline -# endif +# define ACE_NAMESPACE_INLINE_FUNCTION inline # define ACE_INLINE_TEMPLATE_FUNCTION inline #else # define ACE_NAMESPACE_INLINE_FUNCTION ACE_NAMESPACE_STORAGE_CLASS diff --git a/deps/acelite/ace/ARGV.cpp b/deps/acelite/ace/ARGV.cpp index 8ad1fc001..18790043e 100644 --- a/deps/acelite/ace/ARGV.cpp +++ b/deps/acelite/ace/ARGV.cpp @@ -13,8 +13,8 @@ // Open versioned namespace, if enabled by the user. ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE (ACE_ARGV_Queue_Entry) -ACE_ALLOC_HOOK_DEFINE (ACE_ARGV) +ACE_ALLOC_HOOK_DEFINE_Tt (ACE_ARGV_Queue_Entry_T) +ACE_ALLOC_HOOK_DEFINE_Tt (ACE_ARGV_T) template void @@ -88,8 +88,14 @@ ACE_ARGV_T::ACE_ARGV_T (const CHAR_TYPE buf[], return; // Make an internal copy of the string. +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR(this->buf_, + static_cast (ACE_Allocator::instance()->malloc(sizeof (CHAR_TYPE) * (ACE_OS::strlen (buf) + 1)))); +#else ACE_NEW (this->buf_, CHAR_TYPE[ACE_OS::strlen (buf) + 1]); +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_OS::strcpy (this->buf_, buf); // Create this->argv_. @@ -201,8 +207,13 @@ ACE_ARGV_T::ACE_ARGV_T (CHAR_TYPE *first_argv[], ACE_OS::strcat (this->buf_, second_buf); // Delete the first and second buffers +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (first_buf); + ACE_Allocator::instance()->free (second_buf); +#else delete [] first_buf; delete [] second_buf; +#endif /* ACE_HAS_ALLOC_HOOKS */ } template @@ -260,11 +271,19 @@ ACE_ARGV_T::add (const CHAR_TYPE *next_arg, bool quote_arg) for (int i = 0; this->argv_[i] != 0; i++) ACE_OS::free ((void *) this->argv_[i]); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->argv_); +#else delete [] this->argv_; +#endif /* ACE_HAS_ALLOC_HOOKS */ this->argv_ = 0; } +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->buf_); +#else delete [] this->buf_; +#endif /* ACE_HAS_ALLOC_HOOKS */ this->buf_ = 0; return 0; @@ -290,10 +309,21 @@ ACE_ARGV_T::~ACE_ARGV_T (void) if (this->argv_ != 0) for (int i = 0; this->argv_[i] != 0; i++) +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free ((void *) this->argv_[i]); +#else ACE_OS::free ((void *) this->argv_[i]); +#endif /* ACE_HAS_ALLOC_HOOKS */ + + +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->argv_); + ACE_Allocator::instance()->free (this->buf_); +#else delete [] this->argv_; delete [] this->buf_; +#endif /* ACE_HAS_ALLOC_HOOKS */ } // Create buf_ out of the queue_. This is only used in the @@ -309,11 +339,21 @@ ACE_ARGV_T::create_buf_from_queue (void) if (this->argc_ <= 0) return -1; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->buf_); +#else delete [] this->buf_; +#endif /* ACE_HAS_ALLOC_HOOKS */ +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (this->buf_, + static_cast (ACE_Allocator::instance()->malloc(sizeof (CHAR_TYPE) * (this->length_ + this->argc_))), + -1); +#else ACE_NEW_RETURN (this->buf_, CHAR_TYPE[this->length_ + this->argc_], -1); +#endif /* ACE_HAS_ALLOC_HOOKS */ // Get an iterator over the queue ACE_Unbounded_Queue_Iterator > iter (this->queue_); diff --git a/deps/acelite/ace/ARGV.h b/deps/acelite/ace/ARGV.h index 1c291bd6e..34a1cda51 100644 --- a/deps/acelite/ace/ARGV.h +++ b/deps/acelite/ace/ARGV.h @@ -4,9 +4,7 @@ /** * @file ARGV.h * - * $Id: ARGV.h 95972 2012-07-26 10:20:42Z johnnyw $ - * - * @author Doug Schmidt + * @author Doug Schmidt * @author Everett Anderson */ //========================================================================== @@ -36,7 +34,6 @@ template class ACE_ARGV_Queue_Entry_T { public: - // = Initialization and termination. /// Initialize a ACE_ARGV_Queue_Entry_T. ACE_ARGV_Queue_Entry_T (void); @@ -96,7 +93,6 @@ template class ACE_ARGV_T { public: - // = Initialization and termination. /** * Splits the specified string into an argument vector. Arguments in the * string are delimited by whitespace. Whitespace-containing arguments @@ -299,7 +295,7 @@ private: /// The array of string arguments. CHAR_TYPE **argv_; - /// Buffer containing the contents. + /// Buffer containing the argv contents. CHAR_TYPE *buf_; /// Total length of the arguments in the queue, not counting diff --git a/deps/acelite/ace/ARGV.inl b/deps/acelite/ace/ARGV.inl index fdc5b13d7..cd538e9ec 100644 --- a/deps/acelite/ace/ARGV.inl +++ b/deps/acelite/ace/ARGV.inl @@ -1,6 +1,4 @@ /* -*- C++ -*- */ -// $Id: ARGV.inl 80826 2008-03-04 14:51:23Z wotte $ - #include "ace/Global_Macros.h" // Open versioned namespace, if enabled by the user. diff --git a/deps/acelite/ace/ATM_Acceptor.cpp b/deps/acelite/ace/ATM_Acceptor.cpp index db7d67658..1b9a03a19 100644 --- a/deps/acelite/ace/ATM_Acceptor.cpp +++ b/deps/acelite/ace/ATM_Acceptor.cpp @@ -1,7 +1,5 @@ #include "ace/ATM_Acceptor.h" - - #if defined (ACE_HAS_ATM) #if defined (ACE_HAS_LINUX_ATM) @@ -12,7 +10,6 @@ #include "ace/ATM_Acceptor.inl" #endif /* __ACE_INLINE__ */ - // Open versioned namespace, if enabled by the user. ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/ATM_Acceptor.h b/deps/acelite/ace/ATM_Acceptor.h index 736c980d6..0b42907fa 100644 --- a/deps/acelite/ace/ATM_Acceptor.h +++ b/deps/acelite/ace/ATM_Acceptor.h @@ -57,9 +57,7 @@ class ACE_Time_Value; */ class ACE_Export ACE_ATM_Acceptor { - public: - // = Initialization and termination methods. /// Default constructor. ACE_ATM_Acceptor (void); diff --git a/deps/acelite/ace/ATM_Addr.cpp b/deps/acelite/ace/ATM_Addr.cpp index afe10cc8f..74c32b6fc 100644 --- a/deps/acelite/ace/ATM_Addr.cpp +++ b/deps/acelite/ace/ATM_Addr.cpp @@ -13,8 +13,6 @@ #include "ace/ATM_Addr.inl" #endif /* __ACE_INLINE__ */ - - ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE(ACE_ATM_Addr) diff --git a/deps/acelite/ace/ATM_Addr.h b/deps/acelite/ace/ATM_Addr.h index 8f8aac81d..b42143a19 100644 --- a/deps/acelite/ace/ATM_Addr.h +++ b/deps/acelite/ace/ATM_Addr.h @@ -63,7 +63,6 @@ public: static const int OPT_FLAGS_PMP; static const int DEFAULT_SELECTOR; - // = Initialization methods. /// Default constructor. ACE_ATM_Addr (u_char selector = DEFAULT_SELECTOR); @@ -91,7 +90,6 @@ public: /// Default dtor. ~ACE_ATM_Addr (void); - // = Initialization methods (useful after object construction). /// Default initialization for non-address values (e.g., /// t_atm_sap_addr.SVE_tag_addr, t_atm_sap_addr.SVE_tag_selector) void init (u_char selector = DEFAULT_SELECTOR); diff --git a/deps/acelite/ace/ATM_Connector.cpp b/deps/acelite/ace/ATM_Connector.cpp index b05860557..42dd0f7a7 100644 --- a/deps/acelite/ace/ATM_Connector.cpp +++ b/deps/acelite/ace/ATM_Connector.cpp @@ -4,8 +4,6 @@ #include "ace/Handle_Set.h" - - #if !defined (__ACE_INLINE__) #include "ace/ATM_Connector.inl" #endif /* __ACE_INLINE__ */ diff --git a/deps/acelite/ace/ATM_Connector.h b/deps/acelite/ace/ATM_Connector.h index 2bca5b61d..1f05adfae 100644 --- a/deps/acelite/ace/ATM_Connector.h +++ b/deps/acelite/ace/ATM_Connector.h @@ -49,7 +49,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_ATM_Connector { public: - // = Initialization methods. /// Default constructor. ACE_ATM_Connector (void); diff --git a/deps/acelite/ace/ATM_Params.cpp b/deps/acelite/ace/ATM_Params.cpp index ac8a996e5..92d3ecef5 100644 --- a/deps/acelite/ace/ATM_Params.cpp +++ b/deps/acelite/ace/ATM_Params.cpp @@ -2,8 +2,6 @@ #if defined (ACE_HAS_ATM) - - #if !defined (__ACE_INLINE__) #include "ace/ATM_Params.inl" #endif /* __ACE_INLINE__ */ diff --git a/deps/acelite/ace/ATM_QoS.cpp b/deps/acelite/ace/ATM_QoS.cpp index a6b097326..b291d0e5b 100644 --- a/deps/acelite/ace/ATM_QoS.cpp +++ b/deps/acelite/ace/ATM_QoS.cpp @@ -1,7 +1,5 @@ #include "ace/ATM_QoS.h" - - #if defined (ACE_HAS_ATM) #if !defined (__ACE_INLINE__) diff --git a/deps/acelite/ace/ATM_QoS.h b/deps/acelite/ace/ATM_QoS.h index 02aa7d7c9..1417a5d0f 100644 --- a/deps/acelite/ace/ATM_QoS.h +++ b/deps/acelite/ace/ATM_QoS.h @@ -8,7 +8,6 @@ */ //========================================================================== - #ifndef ACE_ATM_QoS_H #define ACE_ATM_QoS_H #include /**/ "ace/pre.h" @@ -63,7 +62,6 @@ public: static const int DEFAULT_SELECTOR; static const int DEFAULT_PKT_SIZE; - // = Initializattion and termination methods. /// Default constructor. ACE_ATM_QoS(int = DEFAULT_PKT_SIZE); diff --git a/deps/acelite/ace/ATM_Stream.h b/deps/acelite/ace/ATM_Stream.h index 10bd3e700..2e840a8dc 100644 --- a/deps/acelite/ace/ATM_Stream.h +++ b/deps/acelite/ace/ATM_Stream.h @@ -8,7 +8,6 @@ */ //============================================================================= - #ifndef ACE_ATM_STREAM_H #define ACE_ATM_STREAM_H #include /**/ "ace/pre.h" @@ -46,7 +45,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_ATM_Stream { public: - // = Initialization and termination methods. /// Default constructor. ACE_ATM_Stream (void); diff --git a/deps/acelite/ace/Abstract_Timer_Queue.cpp b/deps/acelite/ace/Abstract_Timer_Queue.cpp index 3207733b2..021c637fe 100644 --- a/deps/acelite/ace/Abstract_Timer_Queue.cpp +++ b/deps/acelite/ace/Abstract_Timer_Queue.cpp @@ -1,5 +1,3 @@ -//$Id: Abstract_Timer_Queue.cpp 95334 2011-12-15 12:52:50Z msmit $ - #ifndef ACE_ABSTRACT_TIMER_QUEUE_CPP #define ACE_ABSTRACT_TIMER_QUEUE_CPP #include "ace/config-all.h" diff --git a/deps/acelite/ace/Abstract_Timer_Queue.h b/deps/acelite/ace/Abstract_Timer_Queue.h index ddb8abf7f..7dbbf7b4b 100644 --- a/deps/acelite/ace/Abstract_Timer_Queue.h +++ b/deps/acelite/ace/Abstract_Timer_Queue.h @@ -1,5 +1,3 @@ -//$Id: Abstract_Timer_Queue.h 95368 2011-12-19 13:38:49Z mcorino $ - #ifndef ACE_ABSTRACT_TIMER_QUEUE_H #define ACE_ABSTRACT_TIMER_QUEUE_H @@ -13,6 +11,8 @@ * Brunsch, Irfan Pyarali and a cast of thousands. */ +#include "ace/Versioned_Namespace.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Forward declares @@ -184,7 +184,7 @@ public: /** * Determine the next event to timeout. Returns @a max if there are * no pending timers or if all pending timers are longer than max. - * should be a pointer to storage for the timeout value, + * @a the_timeout should be a pointer to storage for the timeout value, * and this value is also returned. This method does not acquire a * lock internally since it doesn't modify internal state. If you * need to call this method when the queue is being modified diff --git a/deps/acelite/ace/Acceptor.cpp b/deps/acelite/ace/Acceptor.cpp index a2df5e836..6b0f8fdc2 100644 --- a/deps/acelite/ace/Acceptor.cpp +++ b/deps/acelite/ace/Acceptor.cpp @@ -15,7 +15,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Acceptor) +ACE_ALLOC_HOOK_DEFINE_Tca(ACE_Acceptor) template void ACE_Acceptor::dump (void) const @@ -172,11 +172,11 @@ ACE_Acceptor::info (ACE_TCHAR **strp, else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) return -1; - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s %s"), - ACE_TEXT ("ACE_Acceptor"), - addr_str, - ACE_TEXT ("# acceptor factory\n")); + ACE_OS::snprintf (buf, BUFSIZ, + ACE_TEXT ("%s\t %s %s"), + ACE_TEXT ("ACE_Acceptor"), + addr_str, + ACE_TEXT ("# acceptor factory\n")); if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) return -1; @@ -447,7 +447,7 @@ ACE_Acceptor::handle_input (ACE_HANDLE listener) return 0; } -ACE_ALLOC_HOOK_DEFINE(ACE_Strategy_Acceptor) +ACE_ALLOC_HOOK_DEFINE_Tca(ACE_Strategy_Acceptor) template int ACE_Strategy_Acceptor::suspend (void) @@ -832,15 +832,15 @@ ACE_Strategy_Acceptor::info (ACE_TCHAR **strp, return -1; // @@ Should add the protocol in... - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s #%s\n"), - this->service_name_ == 0 - ? ACE_TEXT ("") - : this->service_name_, - service_addr_str, - this->service_description_ == 0 - ? ACE_TEXT ("") - : this->service_description_); + ACE_OS::snprintf (buf, BUFSIZ, + ACE_TEXT ("%s\t %s #%s\n"), + this->service_name_ == 0 + ? ACE_TEXT ("") + : this->service_name_, + service_addr_str, + this->service_description_ == 0 + ? ACE_TEXT ("") + : this->service_description_); if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) return -1; @@ -856,7 +856,7 @@ ACE_Strategy_Acceptor::fini (void) return this->ACE_Strategy_Acceptor::handle_close (); } -ACE_ALLOC_HOOK_DEFINE(ACE_Oneshot_Acceptor) +ACE_ALLOC_HOOK_DEFINE_Tca(ACE_Oneshot_Acceptor) template void ACE_Oneshot_Acceptor::dump (void) const @@ -1199,11 +1199,11 @@ ACE_Oneshot_Acceptor::info (ACE_TCHAR **strp, else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) return -1; - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s %s"), - ACE_TEXT ("ACE_Oneshot_Acceptor"), - addr_str, - ACE_TEXT ("#oneshot acceptor factory\n")); + ACE_OS::snprintf (buf, BUFSIZ, + ACE_TEXT ("%s\t %s %s"), + ACE_TEXT ("ACE_Oneshot_Acceptor"), + addr_str, + ACE_TEXT ("#oneshot acceptor factory\n")); if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) return -1; diff --git a/deps/acelite/ace/Acceptor.h b/deps/acelite/ace/Acceptor.h index 5923718fb..da7834cc9 100644 --- a/deps/acelite/ace/Acceptor.h +++ b/deps/acelite/ace/Acceptor.h @@ -4,7 +4,7 @@ /** * @file Acceptor.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -59,7 +59,6 @@ template class ACE_Acceptor : public ACE_Service_Object { public: - // Useful STL-style traits. typedef typename PEER_ACCEPTOR::PEER_ADDR addr_type; typedef PEER_ACCEPTOR acceptor_type; @@ -68,7 +67,7 @@ public: /// "Do-nothing" constructor. ACE_Acceptor (ACE_Reactor * = 0, - int use_select = 1); + int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT); /** * Open the contained @c PEER_ACCEPTOR object to begin listening, and @@ -106,7 +105,7 @@ public: ACE_Acceptor (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr, ACE_Reactor *reactor = ACE_Reactor::instance (), int flags = 0, - int use_select = 1, + int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT, int reuse_addr = 1); /** @@ -148,7 +147,7 @@ public: virtual int open (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr, ACE_Reactor *reactor = ACE_Reactor::instance (), int flags = 0, - int use_select = 1, + int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT, int reuse_addr = 1); /// Close down the Acceptor's resources. @@ -281,7 +280,6 @@ class ACE_Strategy_Acceptor : public ACE_Acceptor { public: - // Useful STL-style traits. typedef ACE_Creation_Strategy creation_strategy_type; @@ -302,7 +300,7 @@ public: /// Default constructor. ACE_Strategy_Acceptor (const ACE_TCHAR service_name[] = 0, const ACE_TCHAR service_description[] = 0, - int use_select = 1, + int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT, int reuse_addr = 1); /** @@ -319,7 +317,7 @@ public: ACE_Scheduling_Strategy * = 0, const ACE_TCHAR service_name[] = 0, const ACE_TCHAR service_description[] = 0, - int use_select = 1, + int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT, int reuse_addr = 1); /** @@ -359,7 +357,7 @@ public: virtual int open (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr, ACE_Reactor *reactor, int flags = 0, - int use_select = 1, + int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT, int reuse_addr = 1); /** @@ -376,7 +374,7 @@ public: ACE_Scheduling_Strategy * = 0, const ACE_TCHAR *service_name = 0, const ACE_TCHAR *service_description = 0, - int use_select = 1, + int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT, int reuse_addr = 1); /// Close down the Strategy_Acceptor's resources. @@ -538,7 +536,6 @@ template class ACE_Oneshot_Acceptor : public ACE_Service_Object { public: - // Useful STL-style traits. typedef typename PEER_ACCEPTOR::PEER_ADDR addr_type; typedef PEER_ACCEPTOR acceptor_type; diff --git a/deps/acelite/ace/Activation_Queue.cpp b/deps/acelite/ace/Activation_Queue.cpp index 5921c26c4..61683993c 100644 --- a/deps/acelite/ace/Activation_Queue.cpp +++ b/deps/acelite/ace/Activation_Queue.cpp @@ -11,6 +11,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE (ACE_Activation_Queue) + void ACE_Activation_Queue::dump (void) const { diff --git a/deps/acelite/ace/Activation_Queue.h b/deps/acelite/ace/Activation_Queue.h index a386ca767..2dbc37ab0 100644 --- a/deps/acelite/ace/Activation_Queue.h +++ b/deps/acelite/ace/Activation_Queue.h @@ -5,7 +5,7 @@ * @file Activation_Queue.h * * @author Andres Kruse - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -147,7 +147,6 @@ protected: bool delete_queue_; private: - /// Allocation strategy of the queue. ACE_Allocator *allocator_; diff --git a/deps/acelite/ace/Activation_Queue.inl b/deps/acelite/ace/Activation_Queue.inl index 4c0ffc049..b464dbdef 100644 --- a/deps/acelite/ace/Activation_Queue.inl +++ b/deps/acelite/ace/Activation_Queue.inl @@ -1,7 +1,4 @@ // -*- C++ -*- -// -// $Id: Activation_Queue.inl 80826 2008-03-04 14:51:23Z wotte $ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE size_t diff --git a/deps/acelite/ace/Active_Map_Manager.cpp b/deps/acelite/ace/Active_Map_Manager.cpp index 574bcb857..b8813a0dd 100644 --- a/deps/acelite/ace/Active_Map_Manager.cpp +++ b/deps/acelite/ace/Active_Map_Manager.cpp @@ -1,5 +1,3 @@ -// $Id: Active_Map_Manager.cpp 91286 2010-08-05 09:04:31Z johnnyw $ - #include "ace/Active_Map_Manager.h" #if !defined (__ACE_INLINE__) diff --git a/deps/acelite/ace/Active_Map_Manager.h b/deps/acelite/ace/Active_Map_Manager.h index 7bade46aa..3bf29130b 100644 --- a/deps/acelite/ace/Active_Map_Manager.h +++ b/deps/acelite/ace/Active_Map_Manager.h @@ -4,8 +4,6 @@ /** * @file Active_Map_Manager.h * - * $Id: Active_Map_Manager.h 93359 2011-02-11 11:33:12Z mcorino $ - * * @author Irfan Pyarali */ //============================================================================= @@ -82,7 +80,6 @@ public: void increment_slot_generation_count (void); private: - /** * @brief Data for the Active Object Map Key. * diff --git a/deps/acelite/ace/Active_Map_Manager.inl b/deps/acelite/ace/Active_Map_Manager.inl index df90ada6a..2fc8c13e5 100644 --- a/deps/acelite/ace/Active_Map_Manager.inl +++ b/deps/acelite/ace/Active_Map_Manager.inl @@ -1,7 +1,4 @@ // -*- C++ -*- -// -// $Id: Active_Map_Manager.inl 80826 2008-03-04 14:51:23Z wotte $ - #include "ace/OS_NS_string.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Active_Map_Manager_T.cpp b/deps/acelite/ace/Active_Map_Manager_T.cpp index 732cc2951..6341ca711 100644 --- a/deps/acelite/ace/Active_Map_Manager_T.cpp +++ b/deps/acelite/ace/Active_Map_Manager_T.cpp @@ -1,5 +1,3 @@ -// $Id: Active_Map_Manager_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - #ifndef ACE_ACTIVE_MAP_MANAGER_T_CPP #define ACE_ACTIVE_MAP_MANAGER_T_CPP @@ -15,7 +13,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Active_Map_Manager) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Active_Map_Manager) ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Active_Map_Manager_T.h b/deps/acelite/ace/Active_Map_Manager_T.h index 80eaada26..472ea7191 100644 --- a/deps/acelite/ace/Active_Map_Manager_T.h +++ b/deps/acelite/ace/Active_Map_Manager_T.h @@ -4,8 +4,6 @@ /** * @file Active_Map_Manager_T.h * - * $Id: Active_Map_Manager_T.h 84316 2009-02-03 19:46:05Z johnnyw $ - * * @author Irfan Pyarali */ //============================================================================= @@ -39,7 +37,6 @@ template class ACE_Active_Map_Manager : public ACE_Map_Manager { public: - // = Traits. typedef ACE_Active_Map_Manager_Key key_type; typedef T mapped_type; @@ -52,7 +49,6 @@ public: typedef ITERATOR iterator; typedef REVERSE_ITERATOR reverse_iterator; - // = Initialization and termination methods. /// Initialize a Active_Map_Manager with the ACE_DEFAULT_MAP_SIZE. ACE_Active_Map_Manager (ACE_Allocator *alloc = 0); @@ -187,7 +183,6 @@ protected: typedef ACE_Map_Manager ACE_AMM_BASE; private: - // = Disallow these operations. ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Active_Map_Manager &)) ACE_UNIMPLEMENTED_FUNC (ACE_Active_Map_Manager (const ACE_Active_Map_Manager &)) diff --git a/deps/acelite/ace/Active_Map_Manager_T.inl b/deps/acelite/ace/Active_Map_Manager_T.inl index 647b55ebd..c8a6caf9b 100644 --- a/deps/acelite/ace/Active_Map_Manager_T.inl +++ b/deps/acelite/ace/Active_Map_Manager_T.inl @@ -1,7 +1,4 @@ // -*- C++ -*- -// -// $Id: Active_Map_Manager_T.inl 80826 2008-03-04 14:51:23Z wotte $ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL template ACE_INLINE int diff --git a/deps/acelite/ace/Addr.cpp b/deps/acelite/ace/Addr.cpp index dbf1a5c3b..85f3523cf 100644 --- a/deps/acelite/ace/Addr.cpp +++ b/deps/acelite/ace/Addr.cpp @@ -6,6 +6,9 @@ #include "ace/Log_Category.h" #include "ace/os_include/sys/os_socket.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Addr.h b/deps/acelite/ace/Addr.h index 6175fbb27..e7760cd2f 100644 --- a/deps/acelite/ace/Addr.h +++ b/deps/acelite/ace/Addr.h @@ -4,7 +4,7 @@ /** * @file Addr.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -30,7 +30,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Addr { public: - // = Initialization and termination methods. /// Initializes instance variables. ACE_Addr (int type = -1, int size = -1); diff --git a/deps/acelite/ace/Addr.inl b/deps/acelite/ace/Addr.inl index 0ff355eae..ad6f03e21 100644 --- a/deps/acelite/ace/Addr.inl +++ b/deps/acelite/ace/Addr.inl @@ -1,7 +1,4 @@ // -*- C++ -*- -// -// $Id: Addr.inl 87295 2009-11-02 14:45:59Z johnnyw $ - // Return the address of the address. ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Arg_Shifter.cpp b/deps/acelite/ace/Arg_Shifter.cpp index 626786035..29eace272 100644 --- a/deps/acelite/ace/Arg_Shifter.cpp +++ b/deps/acelite/ace/Arg_Shifter.cpp @@ -1,5 +1,3 @@ -// $Id: Arg_Shifter.cpp 91286 2010-08-05 09:04:31Z johnnyw $ - #ifndef ACE_ARG_SHIFTER_T_CPP #define ACE_ARG_SHIFTER_T_CPP @@ -8,6 +6,9 @@ #include "ace/OS_NS_strings.h" #include "ace/OS_Errno.h" #include "ace/OS_Memory.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -47,9 +48,13 @@ ACE_Arg_Shifter_T::init (void) { // If not provided with one, allocate a temporary array. if (this->temp_ == 0) +#if defined (ACE_HAS_ALLOC_HOOKS) + this->temp_ = reinterpret_cast + (ACE_Allocator::instance ()->malloc (sizeof (CHAR_TYPE*) * this->total_size_)); +#else ACE_NEW (this->temp_, const CHAR_TYPE *[this->total_size_]); - +#endif /* ACE_HAS_ALLOC_HOOKS */ if (this->temp_ != 0) { // Fill the temporary array. @@ -72,7 +77,12 @@ template ACE_Arg_Shifter_T::~ACE_Arg_Shifter_T (void) { // Delete the temporary vector. +#if defined (ACE_HAS_ALLOC_HOOKS) + if (this->temp_) + ACE_Allocator::instance ()->free (this->temp_); +#else delete [] temp_; +#endif /* ACE_HAS_ALLOC_HOOKS */ } template @@ -120,33 +130,20 @@ template int ACE_Arg_Shifter_T::cur_arg_strncasecmp (const CHAR_TYPE *flag) { - // Check for a current argument - if (this->is_anything_left()) - { - size_t const flag_length = ACE_OS::strlen (flag); + if (!this->is_anything_left ()) + return -1; - // Check for presence of the flag - if (ACE_OS::strncasecmp(this->temp_[current_index_], - flag, - flag_length) == 0) - { - if (ACE_OS::strlen(temp_[current_index_]) == flag_length) - { - // match and lengths are equal - return 0; - } - else - { - // matches, with more info to boot! - size_t const remaining = ACE_OS::strspn - (this->temp_[current_index_] + flag_length, - ACE_TEXT (" ")) + flag_length; - return static_cast (remaining); - } - } - } - // failure - return -1; + const size_t flag_length = ACE_OS::strlen (flag); + const CHAR_TYPE *arg = this->temp_[this->current_index_]; + + if (ACE_OS::strncasecmp (arg, flag, flag_length) != 0) + return -1; + + const size_t arg_length = ACE_OS::strlen (arg); + size_t remaining = flag_length; + while (remaining < arg_length && arg[remaining] == CHAR_TYPE (' ')) + ++remaining; + return (arg_length == flag_length) ? 0 : static_cast (remaining); } template diff --git a/deps/acelite/ace/Arg_Shifter.h b/deps/acelite/ace/Arg_Shifter.h index 123a70560..29a6b3451 100644 --- a/deps/acelite/ace/Arg_Shifter.h +++ b/deps/acelite/ace/Arg_Shifter.h @@ -4,8 +4,6 @@ /** * @file Arg_Shifter.h * - * $Id: Arg_Shifter.h 95972 2012-07-26 10:20:42Z johnnyw $ - * * @author Seth Widoff */ //============================================================================= @@ -55,7 +53,6 @@ template class ACE_Arg_Shifter_T { public: - // = Initialization and termination methods. /** * Initialize the ACE_Arg_Shifter to the vector over which to * iterate. Optionally, also provide the temporary array for @@ -77,13 +74,13 @@ public: * (the default) the object will allocate and free the temporary * vector transparently. */ - ACE_Arg_Shifter_T (int& argc, + ACE_Arg_Shifter_T (int &argc, const CHAR_TYPE **argv, const CHAR_TYPE **temp = 0); /// Same behavior as the preceding constructor, but without the /// "const" qualifier. - ACE_Arg_Shifter_T (int& argc, + ACE_Arg_Shifter_T (int &argc, CHAR_TYPE **argv, CHAR_TYPE **temp = 0); @@ -100,12 +97,12 @@ public: * * Safe to call without checking that a current arg exists * - * In the following examples, a pointer to the char* "value" is ret + * In the following examples, a pointer to the char* "value" is returned * * eg: main -foobar value, main -FooBar value * main -FOOBARvalue * - * all of the above will all match the @a flag == -FooBar + * all of the above will match the @a flag == -FooBar * and will return a char* to "value" * * main -foobar 4 would succeed and return a char* to "4" @@ -125,7 +122,7 @@ public: * together '-foobarflagVALUE', the flag is NOT consumed * and the cur arg is left pointing to the entire flag/value pair */ - const CHAR_TYPE *get_the_parameter (const CHAR_TYPE* flag); + const CHAR_TYPE *get_the_parameter (const CHAR_TYPE *flag); /** * Check if the current argument matches (case insensitive) @a flag @@ -136,7 +133,7 @@ public: * 0 is returned. * * ie: when current_arg = "-foobar" or "-FOOBAR" or "-fooBAR" - * this->cur_arg_strncasecmp ("-FooBar); + * this->cur_arg_strncasecmp ("-FooBar"); * will return 0 * * ------------------------------------------------------------ @@ -144,11 +141,19 @@ public: * Case B: Perfect Match (case insensitive) but the current_arg * is longer than the flag. Returns a number equal to the index * in the char* indicating the start of the extra characters + * after any initial spaces (see below). * * ie: when current_arg = "-foobar98023" - * this->cur_arg_strncasecmp ("-FooBar); + * this->cur_arg_strncasecmp ("-FooBar"); * will return 7 * + * Spaces separating the flag from its value (that are still part + * of the same argv element) are counted as part of the return value + * + * ie: when current_arg = "-foobar 98023" + * this->cur_arg_strncasecmp ("-FooBar"); + * will return 8 + * * Notice: this number will always be > 0 * * ------------------------------------------------------------ @@ -182,16 +187,16 @@ public: private: /// Copy Constructor should not be used. - ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T (const ACE_Arg_Shifter_T&)) + ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T (const ACE_Arg_Shifter_T &)) /// Assignment '=' operator should not be used. - ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T operator= (const ACE_Arg_Shifter_T&)) + ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T operator= (const ACE_Arg_Shifter_T &)) /// Refactor the constructor logic. void init (void); /// The size of the argument vector. - int& argc_; + int &argc_; /// The size of argv_. int total_size_; diff --git a/deps/acelite/ace/Argv_Type_Converter.h b/deps/acelite/ace/Argv_Type_Converter.h index 9734a1de0..c2a73f2c1 100644 --- a/deps/acelite/ace/Argv_Type_Converter.h +++ b/deps/acelite/ace/Argv_Type_Converter.h @@ -37,7 +37,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Argv_Type_Converter { public: - ACE_Argv_Type_Converter (int &argc, char** argv); #if defined (ACE_USES_WCHAR) @@ -56,7 +55,6 @@ public: int& get_argc (void); private: - /// Copy Constructor should not be used. ACE_Argv_Type_Converter (const ACE_Argv_Type_Converter&); diff --git a/deps/acelite/ace/Array_Base.h b/deps/acelite/ace/Array_Base.h index 4fafa4bb8..15ffe77c3 100644 --- a/deps/acelite/ace/Array_Base.h +++ b/deps/acelite/ace/Array_Base.h @@ -4,7 +4,7 @@ /** * @file Array_Base.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -41,7 +41,6 @@ template class ACE_Array_Base { public: - // Old/ACE-style traits. typedef T TYPE; typedef ACE_Array_Iterator ITERATOR; @@ -59,8 +58,6 @@ public: ACE_DECLARE_STL_REVERSE_ITERATORS - // = Initialization and termination methods. - /// Dynamically create an uninitialized array. ACE_Array_Base (size_type size = 0, ACE_Allocator * the_allocator = 0); @@ -205,7 +202,6 @@ template class ACE_Array_Iterator { public: - // = Initialization method. ACE_Array_Iterator (ACE_Array_Base &); // = Iteration methods. diff --git a/deps/acelite/ace/Array_Map.cpp b/deps/acelite/ace/Array_Map.cpp index 219144e82..4917c51e4 100644 --- a/deps/acelite/ace/Array_Map.cpp +++ b/deps/acelite/ace/Array_Map.cpp @@ -13,65 +13,64 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -template +template template -ACE_Array_Map::ACE_Array_Map (InputIterator f, - InputIterator l) +ACE_Array_Map::ACE_Array_Map (InputIterator f, + InputIterator l) : size_ (l - f) , capacity_ (size_) - , nodes_ (size_ == 0 ? 0 : new value_type[size_]) + , nodes_ (size_ == 0 ? 0 : this->alloc_.allocate (size_)) { - (void) std::copy (f, - l, - ACE_make_checked_array_iterator (this->begin (), - this->size_)); - -// iterator n = this->begin (); - -// for (InputIterator i = f; i != l; ++i, ++n) -// *n = *i; + (void) std::uninitialized_copy (f, + l, + ACE_make_checked_array_iterator (this->begin (), + this->size_)); } -template -ACE_Array_Map::ACE_Array_Map ( - ACE_Array_Map const & map) +template +ACE_Array_Map::ACE_Array_Map ( + ACE_Array_Map const & map) : size_ (map.size_) , capacity_ (map.size_) - , nodes_ (size_ == 0 ? 0 : new value_type[size_]) + , nodes_ (size_ == 0 ? 0 : this->alloc_.allocate (size_)) { - std::copy (map.begin (), - map.end (), - ACE_make_checked_array_iterator (this->begin (), - this->size_)); - -// iterator f = map.begin (); -// iterator l = map.end (); -// iterator n = this->begin (); - -// for (iterator i = f; i != l; ++i, ++n) -// *n = *i; + (void) std::uninitialized_copy (map.begin (), + map.end (), + ACE_make_checked_array_iterator (this->begin (), + this->size_)); } -template -ACE_Array_Map::~ACE_Array_Map (void) +template +ACE_Array_Map::~ACE_Array_Map (void) { - delete[] this->nodes_; + for (size_t idx = 0; idx != capacity_; ++idx) + { +#if defined (ACE_HAS_BCC32) + using std::pair; + (nodes_ + idx)->~pair(); +#else + (nodes_ + idx)->~value_type(); +#endif + + } + + alloc_.deallocate(this->nodes_, capacity_); } -template +template void -ACE_Array_Map::swap ( - ACE_Array_Map & map) +ACE_Array_Map::swap ( + ACE_Array_Map & map) { std::swap (this->size_, map.size_); std::swap (this->capacity_, map.capacity_); std::swap (this->nodes_, map.nodes_); } -template -std::pair::iterator, bool> -ACE_Array_Map::insert ( - typename ACE_Array_Map::value_type const & x) +template +std::pair::iterator, bool> +ACE_Array_Map::insert ( + typename ACE_Array_Map::value_type const & x) { // Linear insertion due to linear duplicate key search. @@ -96,10 +95,10 @@ ACE_Array_Map::insert ( return std::make_pair (i, inserted); } -template +template template void -ACE_Array_Map::insert (InputIterator f, InputIterator l) +ACE_Array_Map::insert (InputIterator f, InputIterator l) { this->grow (l - f); // Preallocate storage. @@ -109,10 +108,10 @@ ACE_Array_Map::insert (InputIterator f, InputIterator l) } } -template +template void -ACE_Array_Map::erase ( - typename ACE_Array_Map::iterator pos) +ACE_Array_Map::erase ( + typename ACE_Array_Map::iterator pos) { iterator const first = this->begin (); iterator const last = this->end (); @@ -136,10 +135,10 @@ ACE_Array_Map::erase ( } } -template -typename ACE_Array_Map::size_type -ACE_Array_Map::erase ( - typename ACE_Array_Map::key_type const & k) +template +typename ACE_Array_Map::size_type +ACE_Array_Map::erase ( + typename ACE_Array_Map::key_type const & k) { iterator pos = this->find (k); @@ -150,28 +149,28 @@ ACE_Array_Map::erase ( return old_size - this->size_; } -template +template void -ACE_Array_Map::erase ( - typename ACE_Array_Map::iterator first, - typename ACE_Array_Map::iterator last) +ACE_Array_Map::erase ( + typename ACE_Array_Map::iterator first, + typename ACE_Array_Map::iterator last) { if (this->begin () <= first && first < last && last < this->end ()) for (iterator i = first; i != last; ++i) this->erase (i); } -template +template void -ACE_Array_Map::clear (void) +ACE_Array_Map::clear (void) { this->size_ = 0; // No need to deallocate array nor destroy elements. } -template -typename ACE_Array_Map::iterator -ACE_Array_Map::find ( - typename ACE_Array_Map::key_type const & k) +template +typename ACE_Array_Map::iterator +ACE_Array_Map::find ( + typename ACE_Array_Map::key_type const & k) { iterator const the_end = this->end (); @@ -184,10 +183,10 @@ ACE_Array_Map::find ( return this->end (); } -template -typename ACE_Array_Map::const_iterator -ACE_Array_Map::find ( - typename ACE_Array_Map::key_type const & k) const +template +typename ACE_Array_Map::const_iterator +ACE_Array_Map::find ( + typename ACE_Array_Map::key_type const & k) const { const_iterator const the_end = this->end (); @@ -200,10 +199,10 @@ ACE_Array_Map::find ( return this->end (); } -template +template void -ACE_Array_Map::grow ( - typename ACE_Array_Map::size_type s) +ACE_Array_Map::grow ( + typename ACE_Array_Map::size_type s) { if (this->size () + s > this->capacity_) { @@ -212,7 +211,7 @@ ACE_Array_Map::grow ( // Strongly exception safe. - ACE_Array_Map temp (this->size () + s); + ACE_Array_Map temp (this->size () + s); std::copy (this->begin (), this->end (), @@ -231,10 +230,10 @@ ACE_Array_Map::grow ( // --------------------------------------------------------------- -template +template bool -operator== (ACE_Array_Map const & lhs, - ACE_Array_Map const & rhs) +operator== (ACE_Array_Map const & lhs, + ACE_Array_Map const & rhs) { // Do not include Array_Map capacity in comparison. It isn't useful // in this case. @@ -246,10 +245,10 @@ operator== (ACE_Array_Map const & lhs, rhs.size ()))); } -template +template bool -operator< (ACE_Array_Map const & lhs, - ACE_Array_Map const & rhs) +operator< (ACE_Array_Map const & lhs, + ACE_Array_Map const & rhs) { return std::lexicographical_compare (lhs.begin (), lhs.end (), rhs.begin (), rhs.end ()); diff --git a/deps/acelite/ace/Array_Map.h b/deps/acelite/ace/Array_Map.h index 03830b52c..5fd040069 100644 --- a/deps/acelite/ace/Array_Map.h +++ b/deps/acelite/ace/Array_Map.h @@ -29,9 +29,18 @@ #include #include #include +#include ACE_BEGIN_VERSIONED_NAMESPACE_DECL +#if defined __SUNPRO_CC && !defined _RWSTD_ALLOCATOR +# define ACE_ARRAY_MAP_DEFAULT_ALLOCATOR(K, V) std::allocator_interface< \ + std::allocator, \ + std::pair > +#else +# define ACE_ARRAY_MAP_DEFAULT_ALLOCATOR(K, V) std::allocator > +#endif + /** * @class ACE_Array_Map * @@ -82,24 +91,25 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * -# Copy constructor * -# operator= */ -template > +template, + class Alloc = ACE_ARRAY_MAP_DEFAULT_ALLOCATOR (Key, Value) > class ACE_Array_Map { public: - // STL-style typedefs/traits. - typedef Key key_type; - typedef Value data_type; - typedef std::pair value_type; - typedef value_type * iterator; - typedef value_type const * const_iterator; - typedef value_type & reference; - typedef value_type const & const_reference; - typedef value_type * pointer; - typedef value_type const * const_pointer; - typedef ptrdiff_t difference_type; - typedef size_t size_type; - + typedef Key key_type; + typedef Value mapped_type; + typedef Value data_type; + typedef std::pair value_type; + typedef Alloc allocator_type; + typedef value_type & reference; + typedef value_type const & const_reference; + typedef value_type * pointer; + typedef value_type const * const_pointer; + typedef value_type * iterator; + typedef value_type const * const_iterator; + typedef ptrdiff_t difference_type; + typedef size_t size_type; ACE_DECLARE_STL_REVERSE_ITERATORS /// Default Constructor. @@ -233,14 +243,16 @@ public: * @par * map["Foo"] = 12; */ - data_type & operator[] (key_type const & k); + mapped_type & operator[] (key_type const & k); + + allocator_type get_allocator() const { return alloc_; } private: - /// Increase size of underlying buffer by @a s. void grow (size_type s); -private: + /// The allocator. + allocator_type alloc_; /// Number of elements in the map. size_type size_; @@ -253,20 +265,19 @@ private: /// Underlying array containing keys and data. value_type * nodes_; - }; // -------------------------------------------------------------- /// @c ACE_Array_Map equality operator. -template -bool operator== (ACE_Array_Map const & lhs, - ACE_Array_Map const & rhs); +template +bool operator== (ACE_Array_Map const & lhs, + ACE_Array_Map const & rhs); /// @c ACE_Array_Map lexicographical comparison operator. -template -bool operator< (ACE_Array_Map const & lhs, - ACE_Array_Map const & rhs); +template +bool operator< (ACE_Array_Map const & lhs, + ACE_Array_Map const & rhs); // -------------------------------------------------------------- diff --git a/deps/acelite/ace/Array_Map.inl b/deps/acelite/ace/Array_Map.inl index c331fae80..32e7848c0 100644 --- a/deps/acelite/ace/Array_Map.inl +++ b/deps/acelite/ace/Array_Map.inl @@ -1,129 +1,130 @@ // -*- C++ -*- ACE_BEGIN_VERSIONED_NAMESPACE_DECL -template +template ACE_INLINE -ACE_Array_Map::ACE_Array_Map ( - typename ACE_Array_Map::size_type s) +ACE_Array_Map::ACE_Array_Map ( + typename ACE_Array_Map::size_type s) : size_ (0) , capacity_ (s) - , nodes_ (s == 0 ? 0 : new value_type[s]) + , nodes_ (s == 0 ? 0 : this->alloc_.allocate (s)) { + std::uninitialized_fill_n (this->nodes_, s, value_type ()); } -template -ACE_INLINE ACE_Array_Map & -ACE_Array_Map::operator= ( - ACE_Array_Map const & map) +template +ACE_INLINE ACE_Array_Map & +ACE_Array_Map::operator= ( + ACE_Array_Map const & map) { // Strongly exception-safe assignment. - ACE_Array_Map temp (map); + ACE_Array_Map temp (map); this->swap (temp); return *this; } -template -ACE_INLINE typename ACE_Array_Map::iterator -ACE_Array_Map::begin (void) +template +ACE_INLINE typename ACE_Array_Map::iterator +ACE_Array_Map::begin (void) { return this->nodes_; } -template -ACE_INLINE typename ACE_Array_Map::iterator -ACE_Array_Map::end (void) +template +ACE_INLINE typename ACE_Array_Map::iterator +ACE_Array_Map::end (void) { return this->nodes_ + this->size_; } -template -ACE_INLINE typename ACE_Array_Map::const_iterator -ACE_Array_Map::begin (void) const +template +ACE_INLINE typename ACE_Array_Map::const_iterator +ACE_Array_Map::begin (void) const { return this->nodes_; } -template -ACE_INLINE typename ACE_Array_Map::const_iterator -ACE_Array_Map::end (void) const +template +ACE_INLINE typename ACE_Array_Map::const_iterator +ACE_Array_Map::end (void) const { return this->nodes_ + this->size_; } -template -ACE_INLINE typename ACE_Array_Map::reverse_iterator -ACE_Array_Map::rbegin (void) +template +ACE_INLINE typename ACE_Array_Map::reverse_iterator +ACE_Array_Map::rbegin (void) { return reverse_iterator (this->end ()); } -template -ACE_INLINE typename ACE_Array_Map::reverse_iterator -ACE_Array_Map::rend (void) +template +ACE_INLINE typename ACE_Array_Map::reverse_iterator +ACE_Array_Map::rend (void) { return reverse_iterator (this->begin ()); } -template -ACE_INLINE typename ACE_Array_Map::const_reverse_iterator -ACE_Array_Map::rbegin (void) const +template +ACE_INLINE typename ACE_Array_Map::const_reverse_iterator +ACE_Array_Map::rbegin (void) const { return const_reverse_iterator (this->end ()); } -template -ACE_INLINE typename ACE_Array_Map::const_reverse_iterator -ACE_Array_Map::rend (void) const +template +ACE_INLINE typename ACE_Array_Map::const_reverse_iterator +ACE_Array_Map::rend (void) const { return const_reverse_iterator (this->begin ()); } -template -ACE_INLINE typename ACE_Array_Map::size_type -ACE_Array_Map::size (void) const +template +ACE_INLINE typename ACE_Array_Map::size_type +ACE_Array_Map::size (void) const { return this->size_; } -template -ACE_INLINE typename ACE_Array_Map::size_type -ACE_Array_Map::max_size (void) const +template +ACE_INLINE typename ACE_Array_Map::size_type +ACE_Array_Map::max_size (void) const { return size_type (-1) / sizeof (value_type); } -template +template ACE_INLINE bool -ACE_Array_Map::is_empty (void) const +ACE_Array_Map::is_empty (void) const { return this->size_ == 0; } // The following method is deprecated. -template +template ACE_INLINE bool -ACE_Array_Map::empty (void) const +ACE_Array_Map::empty (void) const { return this->is_empty (); } -template -ACE_INLINE typename ACE_Array_Map::size_type -ACE_Array_Map::count ( - typename ACE_Array_Map::key_type const & k) +template +ACE_INLINE typename ACE_Array_Map::size_type +ACE_Array_Map::count ( + typename ACE_Array_Map::key_type const & k) { return (this->find (k) == this->end () ? 0 : 1); // Only one datum per key. } -template -ACE_INLINE typename ACE_Array_Map::data_type & -ACE_Array_Map::operator[] ( - typename ACE_Array_Map::key_type const & k) +template +ACE_INLINE typename ACE_Array_Map::mapped_type & +ACE_Array_Map::operator[] ( + typename ACE_Array_Map::key_type const & k) { - iterator i = (this->insert (value_type (k, data_type ()))).first; + iterator i = (this->insert (value_type (k, mapped_type ()))).first; return (*i).second; } diff --git a/deps/acelite/ace/Assert.cpp b/deps/acelite/ace/Assert.cpp index 857884490..45524c643 100644 --- a/deps/acelite/ace/Assert.cpp +++ b/deps/acelite/ace/Assert.cpp @@ -14,7 +14,12 @@ __ace_assert(const char *file, int line, const ACE_TCHAR *expression) log->set (file, line, -1, error, log->restart (), log->msg_ostream (), log->msg_callback ()); - log->log (LM_ERROR, ACE_TEXT ("ACE_ASSERT: file %N, line %l assertion failed for '%s'.%a\n"), expression, -1); +#ifdef ACE_LACKS_VA_FUNCTIONS +#define LOG_ARGS +#else +#define LOG_ARGS(X) X +#endif + log->log LOG_ARGS ((LM_ERROR, ACE_TEXT ("ACE_ASSERT: file %N, line %l assertion failed for '%s'.%a\n"), expression, -1)); } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Assert.h b/deps/acelite/ace/Assert.h index 7732323f0..33c5a4c25 100644 --- a/deps/acelite/ace/Assert.h +++ b/deps/acelite/ace/Assert.h @@ -4,7 +4,7 @@ /** * @file Assert.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/Asynch_Acceptor.h b/deps/acelite/ace/Asynch_Acceptor.h index 520c7bf3f..03efa702e 100644 --- a/deps/acelite/ace/Asynch_Acceptor.h +++ b/deps/acelite/ace/Asynch_Acceptor.h @@ -171,7 +171,7 @@ public: * another accept should be initiated. If the method returns a non-zero * value, another accept is initiated. * - * The default implemenation always returns the value passed as the + * The default implementation always returns the value passed as the * @c open() method's @a reissue_accept argument. That value can also * be changed using the @c reissue_accept() method. */ diff --git a/deps/acelite/ace/Asynch_Connector.h b/deps/acelite/ace/Asynch_Connector.h index 8706fd222..584c29fb0 100644 --- a/deps/acelite/ace/Asynch_Connector.h +++ b/deps/acelite/ace/Asynch_Connector.h @@ -143,7 +143,6 @@ protected: virtual HANDLER *make_handler (void); private: - /// Asynch_Connect used to make life easier :-) ACE_Asynch_Connect asynch_connect_; diff --git a/deps/acelite/ace/Asynch_IO.h b/deps/acelite/ace/Asynch_IO.h index 6cc143d24..78db98fcd 100644 --- a/deps/acelite/ace/Asynch_IO.h +++ b/deps/acelite/ace/Asynch_IO.h @@ -101,7 +101,6 @@ class ACE_Time_Value; */ class ACE_Export ACE_Asynch_Result { - public: /// Number of bytes transferred by the operation. size_t bytes_transferred (void) const; @@ -198,7 +197,6 @@ class ACE_Asynch_Operation_Impl; */ class ACE_Export ACE_Asynch_Operation { - public: /** * Initializes the factory with information which will be used with @@ -288,7 +286,6 @@ class ACE_Asynch_Read_Stream_Impl; */ class ACE_Export ACE_Asynch_Read_Stream : public ACE_Asynch_Operation { - public: /// A do nothing constructor. ACE_Asynch_Read_Stream (void); @@ -379,7 +376,6 @@ public: */ class ACE_Export Result : public ACE_Asynch_Result { - /// The concrete implementation result classes only construct this /// class. friend class ACE_POSIX_Asynch_Read_Stream_Result; @@ -432,7 +428,6 @@ class ACE_Asynch_Write_Stream_Result_Impl; */ class ACE_Export ACE_Asynch_Write_Stream : public ACE_Asynch_Operation { - public: /// A do nothing constructor. ACE_Asynch_Write_Stream (void); @@ -535,7 +530,6 @@ public: */ class ACE_Export Result : public ACE_Asynch_Result { - /// The concrete implementation result classes only construct this /// class. friend class ACE_POSIX_Asynch_Write_Stream_Result; @@ -591,7 +585,6 @@ class ACE_Asynch_Read_File_Result_Impl; */ class ACE_Export ACE_Asynch_Read_File : public ACE_Asynch_Read_Stream { - public: /// A do nothing constructor. ACE_Asynch_Read_File (void); @@ -691,7 +684,6 @@ public: */ class ACE_Export Result : public ACE_Asynch_Read_Stream::Result { - /// The concrete implementation result classes only construct this /// class. friend class ACE_POSIX_Asynch_Read_File_Result; @@ -742,7 +734,6 @@ class ACE_Asynch_Write_File_Result_Impl; */ class ACE_Export ACE_Asynch_Write_File : public ACE_Asynch_Write_Stream { - public: /// A do nothing constructor. ACE_Asynch_Write_File (void); @@ -827,7 +818,6 @@ public: */ class ACE_Export Result : public ACE_Asynch_Write_Stream::Result { - /// The concrete implementation result classes only construct this /// class. friend class ACE_POSIX_Asynch_Write_File_Result; @@ -876,7 +866,6 @@ class ACE_Asynch_Accept_Impl; */ class ACE_Export ACE_Asynch_Accept : public ACE_Asynch_Operation { - public: /// A do nothing constructor. ACE_Asynch_Accept (void); @@ -959,7 +948,6 @@ public: */ class ACE_Export Result : public ACE_Asynch_Result { - /// The concrete implementation result classes only construct this /// class. friend class ACE_POSIX_Asynch_Accept_Result; @@ -983,13 +971,13 @@ public: ACE_Asynch_Accept_Result_Impl *implementation (void) const; protected: - /// Contructor. Implementation will not be deleted. + /// Constructor. Implementation will not be deleted. Result (ACE_Asynch_Accept_Result_Impl *implementation); /// Destructor. virtual ~Result (void); - /// Impelmentation class. + /// Implementation class. ACE_Asynch_Accept_Result_Impl *implementation_; }; private: @@ -1013,7 +1001,6 @@ class ACE_Asynch_Connect_Impl; */ class ACE_Export ACE_Asynch_Connect : public ACE_Asynch_Operation { - public: /// A do nothing constructor. ACE_Asynch_Connect (void); @@ -1065,7 +1052,6 @@ public: */ class ACE_Export Result : public ACE_Asynch_Result { - /// The concrete implementation result classes only construct this /// class. friend class ACE_POSIX_Asynch_Connect_Result; @@ -1080,13 +1066,13 @@ public: ACE_Asynch_Connect_Result_Impl *implementation (void) const; protected: - /// Contructor. Implementation will not be deleted. + /// Constructor. Implementation will not be deleted. Result (ACE_Asynch_Connect_Result_Impl *implementation); /// Destructor. virtual ~Result (void); - /// Impelmentation class. + /// Implementation class. ACE_Asynch_Connect_Result_Impl *implementation_; }; private: @@ -1118,7 +1104,6 @@ class ACE_Asynch_Transmit_File_Impl; */ class ACE_Export ACE_Asynch_Transmit_File : public ACE_Asynch_Operation { - public: // Forward declarations class Header_And_Trailer; @@ -1191,7 +1176,6 @@ public: */ class ACE_Export Result : public ACE_Asynch_Result { - /// The concrete implementation result classes only construct this /// class. friend class ACE_POSIX_Asynch_Transmit_File_Result; @@ -1243,7 +1227,6 @@ public: */ class ACE_Export Header_And_Trailer { - public: /// Constructor. Header_And_Trailer (ACE_Message_Block *header = 0, @@ -1329,7 +1312,6 @@ class ACE_Addr; */ class ACE_Export ACE_Asynch_Read_Dgram : public ACE_Asynch_Operation { - public: /// A do nothing constructor. ACE_Asynch_Read_Dgram (void); @@ -1404,14 +1386,12 @@ public: */ class ACE_Export Result : public ACE_Asynch_Result { - /// The concrete implementation result classes only construct this /// class. friend class ACE_POSIX_Asynch_Read_Dgram_Result; friend class ACE_WIN32_Asynch_Read_Dgram_Result; public: - /// The number of bytes which were requested at the start of the /// asynchronous read. size_t bytes_to_read (void) const; @@ -1465,7 +1445,6 @@ class ACE_Asynch_Write_Dgram_Result_Impl; */ class ACE_Export ACE_Asynch_Write_Dgram : public ACE_Asynch_Operation { - public: /// A do nothing constructor. ACE_Asynch_Write_Dgram (void); @@ -1540,14 +1519,12 @@ public: */ class ACE_Export Result : public ACE_Asynch_Result { - /// The concrete implementation result classes only construct this /// class. friend class ACE_POSIX_Asynch_Write_Dgram_Result; friend class ACE_WIN32_Asynch_Write_Dgram_Result; public: - /// The number of bytes which were requested at the start of the /// asynchronous write. size_t bytes_to_write (void) const; @@ -1719,7 +1696,6 @@ class ACE_Asynch_Acceptor; */ class ACE_Export ACE_Service_Handler : public ACE_Handler { - /// The Acceptor is the factory and therefore should have special /// privileges. friend class ACE_Asynch_Acceptor; diff --git a/deps/acelite/ace/Atomic_Op.cpp b/deps/acelite/ace/Atomic_Op.cpp index 5b8cc7a0d..e1075809b 100644 --- a/deps/acelite/ace/Atomic_Op.cpp +++ b/deps/acelite/ace/Atomic_Op.cpp @@ -32,7 +32,7 @@ single_cpu_increment (volatile long *value) (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_add_long ( reinterpret_cast (value), 1); -#elif defined(__GNUC__) && defined(PPC) +#elif defined(__GNUC__) && defined(__PPC__) long tmp; asm("lwz %0,%1" : "=r" (tmp) : "m" (*value) ); asm("addi %0,%0,1" : "+r" (tmp) ); @@ -56,7 +56,7 @@ single_cpu_decrement (volatile long *value) (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_add_long ( reinterpret_cast (value), -1); -#elif defined(__GNUC__) && defined(PPC) +#elif defined(__GNUC__) && defined(__PPC__) long tmp; asm("lwz %0,%1" : "=r" (tmp) : "m" (*value) ); asm("addi %0,%0,-1" : "+r" (tmp) ); @@ -79,7 +79,7 @@ single_cpu_exchange (volatile long *value, long rhs) (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_swap_long ( reinterpret_cast (value), rhs); -#elif defined(__GNUC__) && defined(PPC) +#elif defined(__GNUC__) && defined(__PPC__) long tmp; asm("lwz %0,%1" : "=r" (tmp) : "m" (rhs) ); asm("stw %0,%1" : "+r" (tmp), "=m" (*value) ); @@ -102,7 +102,7 @@ single_cpu_exchange_add (volatile long *value, long rhs) (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_swap_add_long ( reinterpret_cast (value), rhs); -#elif defined(__GNUC__) && defined(PPC) +#elif defined(__GNUC__) && defined(__PPC__) long tmp; asm("add %0,%1,%2" : "=r" (tmp) : "r" (*value), "r" (rhs) ); asm("stw %0,%1" : "+r" (tmp), "=m" (*value) ); diff --git a/deps/acelite/ace/Atomic_Op.h b/deps/acelite/ace/Atomic_Op.h index 8ae1b2e5e..b9b179c00 100644 --- a/deps/acelite/ace/Atomic_Op.h +++ b/deps/acelite/ace/Atomic_Op.h @@ -4,7 +4,7 @@ /** * @file Atomic_Op.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -142,14 +142,12 @@ public: static void init_functions (void); private: - /// This function cannot be supported by this template specialization. /// If you need access to an underlying lock, use the ACE_Atomic_Op_Ex /// template instead. ACE_Thread_Mutex &mutex (void); private: - /// Current object decorated by the atomic op. volatile long value_; @@ -242,14 +240,12 @@ public: static void init_functions (void); private: - /// This function cannot be supported by this template specialization. /// If you need access to an underlying lock, use the ACE_Atomic_Op_Ex /// template instead. ACE_Thread_Mutex &mutex (void); private: - /// Current object decorated by the atomic op. volatile unsigned long value_; diff --git a/deps/acelite/ace/Atomic_Op_GCC_T.h b/deps/acelite/ace/Atomic_Op_GCC_T.h index 6a25fe176..38485af3b 100644 --- a/deps/acelite/ace/Atomic_Op_GCC_T.h +++ b/deps/acelite/ace/Atomic_Op_GCC_T.h @@ -104,14 +104,12 @@ protected: ACE_Atomic_Op_GCC (const ACE_Atomic_Op_GCC &c); private: - // This function cannot be supported by this template specialization. // If you need access to an underlying lock, use the ACE_Atomic_Op_Ex // template instead. ACE_Thread_Mutex &mutex (void); private: - /// Current object decorated by the atomic op. volatile T value_; }; diff --git a/deps/acelite/ace/Atomic_Op_T.cpp b/deps/acelite/ace/Atomic_Op_T.cpp index 82311d3e2..d925d6e46 100644 --- a/deps/acelite/ace/Atomic_Op_T.cpp +++ b/deps/acelite/ace/Atomic_Op_T.cpp @@ -7,6 +7,10 @@ # include "ace/Log_Category.h" #endif /* ACE_HAS_DUMP */ +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ @@ -17,8 +21,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Atomic_Op_Ex) -ACE_ALLOC_HOOK_DEFINE(ACE_Atomic_Op) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Atomic_Op_Ex) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Atomic_Op) // ************************************************* template ACE_LOCK & diff --git a/deps/acelite/ace/Atomic_Op_T.h b/deps/acelite/ace/Atomic_Op_T.h index 86fb0ef09..c3d936c1f 100644 --- a/deps/acelite/ace/Atomic_Op_T.h +++ b/deps/acelite/ace/Atomic_Op_T.h @@ -4,7 +4,7 @@ /** * @file Atomic_Op_T.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -144,11 +144,8 @@ template class ACE_Atomic_Op_Ex { public: - typedef typename ACE_Type_Traits::parameter_type arg_type; - // = Initialization methods. - /// Initialize @c value_ to 0. ACE_Atomic_Op_Ex (ACE_LOCK & mtx); @@ -209,8 +206,8 @@ public: /// Dump the state of an object. void dump (void) const; - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; /// Manage copying... ACE_Atomic_Op_Ex (ACE_Atomic_Op_Ex const &); @@ -259,7 +256,6 @@ template class ACE_Atomic_Op { public: - typedef typename ACE_Type_Traits::parameter_type arg_type; /// Initialize @c value_ to 0. @@ -323,6 +319,9 @@ public: /// Dump the state of an object. void dump (void) const; + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + /** * Explicitly return @c value_ (by reference). This gives the user * full, unrestricted access to the underlying value. This method diff --git a/deps/acelite/ace/Auto_Event.cpp b/deps/acelite/ace/Auto_Event.cpp index 516755c68..c95c0e855 100644 --- a/deps/acelite/ace/Auto_Event.cpp +++ b/deps/acelite/ace/Auto_Event.cpp @@ -1,11 +1,54 @@ #include "ace/Auto_Event.h" #if !defined (__ACE_INLINE__) -//#include "ace/Auto_Event.inl" +#include "ace/Auto_Event.inl" #endif /* __ACE_INLINE__ */ +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Auto_Event_T) +template +ACE_Auto_Event_T::ACE_Auto_Event_T ( + int initial_state, + int type, + const char *name, + void *arg) + : ACE_Event_T (0, + initial_state, + type, + ACE_TEXT_CHAR_TO_TCHAR (name), + arg) +{ +} + +#if defined (ACE_HAS_WCHAR) +template +ACE_Auto_Event_T::ACE_Auto_Event_T ( + int initial_state, + int type, + const wchar_t *name, + void *arg) + : ACE_Event_T (0, + initial_state, + type, + ACE_TEXT_WCHAR_TO_TCHAR (name), + arg) +{ +} +#endif /* ACE_HAS_WCHAR */ + +template +void +ACE_Auto_Event_T::dump (void) const +{ +#if defined (ACE_HAS_DUMP) + ACE_Event_T::dump (); +#endif /* ACE_HAS_DUMP */ +} ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Auto_Event.h b/deps/acelite/ace/Auto_Event.h index ec62441d2..f01882c62 100644 --- a/deps/acelite/ace/Auto_Event.h +++ b/deps/acelite/ace/Auto_Event.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -42,40 +42,21 @@ public: ACE_Auto_Event_T (int initial_state = 0, int type = USYNC_THREAD, const char *name = 0, - void *arg = 0) : ACE_Event_T (0, - initial_state, - type, - ACE_TEXT_CHAR_TO_TCHAR (name), - arg) - { - } + void *arg = 0); #if defined (ACE_HAS_WCHAR) /// Constructor which will create auto event (wchar_t version) ACE_Auto_Event_T (int initial_state, int type, const wchar_t *name, - void *arg = 0) : ACE_Event_T (0, - initial_state, - type, - ACE_TEXT_WCHAR_TO_TCHAR (name), - arg) - { - } + void *arg = 0); #endif /* ACE_HAS_WCHAR */ /// Default dtor. - virtual ~ACE_Auto_Event_T (void) - { - } + virtual ~ACE_Auto_Event_T (void); /// Dump the state of an object. - void dump (void) const - { -#if defined (ACE_HAS_DUMP) - ACE_Event_T::dump (); -#endif /* ACE_HAS_DUMP */ - } + void dump (void) const; /// Declare the dynamic allocation hooks ACE_ALLOC_HOOK_DECLARE; diff --git a/deps/acelite/ace/Auto_Event.inl b/deps/acelite/ace/Auto_Event.inl index e1facac51..919c048d3 100644 --- a/deps/acelite/ace/Auto_Event.inl +++ b/deps/acelite/ace/Auto_Event.inl @@ -1,4 +1,10 @@ // -*- C++ -*- ACE_BEGIN_VERSIONED_NAMESPACE_DECL +template +ACE_INLINE +ACE_Auto_Event_T::~ACE_Auto_Event_T (void) +{ +} + ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Auto_IncDec_T.cpp b/deps/acelite/ace/Auto_IncDec_T.cpp index 56514ef44..5d408c7db 100644 --- a/deps/acelite/ace/Auto_IncDec_T.cpp +++ b/deps/acelite/ace/Auto_IncDec_T.cpp @@ -12,9 +12,13 @@ #include "ace/Auto_IncDec_T.inl" #endif /* __ACE_INLINE__ */ +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Auto_IncDec) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Auto_IncDec) template void ACE_Auto_IncDec::dump (void) const diff --git a/deps/acelite/ace/Auto_IncDec_T.h b/deps/acelite/ace/Auto_IncDec_T.h index 3e1eefa64..d8e028344 100644 --- a/deps/acelite/ace/Auto_IncDec_T.h +++ b/deps/acelite/ace/Auto_IncDec_T.h @@ -48,6 +48,9 @@ public: /// Dump the state of an object. void dump (void) const; + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /// Reference to the @c ACE_SAFELY_INCREMENTABLE_DECREMENTABLE counter /// we're incrementing/decrementing. diff --git a/deps/acelite/ace/Auto_Ptr.cpp b/deps/acelite/ace/Auto_Ptr.cpp index 9a23ab038..09028186a 100644 --- a/deps/acelite/ace/Auto_Ptr.cpp +++ b/deps/acelite/ace/Auto_Ptr.cpp @@ -3,16 +3,18 @@ #include "ace/Auto_Ptr.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/Auto_Ptr.inl" #endif /* __ACE_INLINE__ */ - - ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Auto_Basic_Ptr) -ACE_ALLOC_HOOK_DEFINE(ACE_Auto_Basic_Array_Ptr) +ACE_ALLOC_HOOK_DEFINE_Tt(ACE_Auto_Basic_Ptr) +ACE_ALLOC_HOOK_DEFINE_Tt(ACE_Auto_Basic_Array_Ptr) ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Auto_Ptr.h b/deps/acelite/ace/Auto_Ptr.h index 5ac19e616..47ad7c397 100644 --- a/deps/acelite/ace/Auto_Ptr.h +++ b/deps/acelite/ace/Auto_Ptr.h @@ -4,7 +4,7 @@ /** * @file Auto_Ptr.h * - * @author Doug Schmidt + * @author Doug Schmidt * @author Irfan Pyarali * @author Jack Reeves * @author Dr. Harald M. Mueller @@ -30,7 +30,6 @@ # pragma warning(disable: 4284) #endif /* _MSC_VER */ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -45,7 +44,6 @@ class ACE_Auto_Basic_Ptr public: typedef X element_type; - // = Initialization and termination methods explicit ACE_Auto_Basic_Ptr (X * p = 0) : p_ (p) {} ACE_Auto_Basic_Ptr (ACE_Auto_Basic_Ptr & ap); @@ -70,12 +68,21 @@ protected: ACE_END_VERSIONED_NAMESPACE_DECL +#if defined (ACE_HAS_CPP17) +// C++17 has removed std::auto_ptr but this is heavily used +// in ACE and TAO tests so for the moment we are providing +// our own auto_ptr implementation +# define ACE_LACKS_AUTO_PTR +# include +#endif /* ACE_HAS_CPP17 */ + #if !defined (ACE_LACKS_AUTO_PTR) && \ defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \ (ACE_HAS_STANDARD_CPP_LIBRARY != 0) #include #if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) && \ (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0) +using std::auto_ptr; #endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ #else /* ACE_HAS_STANDARD_CPP_LIBRARY */ @@ -90,7 +97,6 @@ class auto_ptr : public ACE_Auto_Basic_Ptr public: typedef X element_type; - // = Initialization and termination methods explicit auto_ptr (X * p = 0) : ACE_Auto_Basic_Ptr (p) {} auto_ptr (auto_ptr & ap) : ACE_Auto_Basic_Ptr (ap.release ()) {} @@ -111,7 +117,6 @@ class ACE_Auto_Ptr : public ACE_Auto_Basic_Ptr public: typedef X element_type; - // = Initialization and termination methods explicit ACE_Auto_Ptr (X * p = 0) : ACE_Auto_Basic_Ptr (p) {} X *operator-> () const; @@ -131,7 +136,6 @@ class ACE_Auto_Basic_Array_Ptr public: typedef X element_type; - // = Initialization and termination methods. explicit ACE_Auto_Basic_Array_Ptr (X * p = 0) : p_ (p) {} ACE_Auto_Basic_Array_Ptr (ACE_Auto_Basic_Array_Ptr & ap); @@ -167,7 +171,6 @@ class ACE_Auto_Array_Ptr : public ACE_Auto_Basic_Array_Ptr public: typedef X element_type; - // = Initialization and termination methods. explicit ACE_Auto_Array_Ptr (X *p = 0) : ACE_Auto_Basic_Array_Ptr (p) {} diff --git a/deps/acelite/ace/Auto_Ptr.inl b/deps/acelite/ace/Auto_Ptr.inl index a172ea9dc..1cc93536e 100644 --- a/deps/acelite/ace/Auto_Ptr.inl +++ b/deps/acelite/ace/Auto_Ptr.inl @@ -1,6 +1,10 @@ // -*- C++ -*- #include "ace/Global_Macros.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL template ACE_INLINE void @@ -117,7 +121,12 @@ ACE_Auto_Basic_Array_Ptr::reset (X *p) { ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::reset"); if (this->get () != p) +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(this->get ()); +#else delete [] this->get (); +#endif /* ACE_HAS_ALLOC_HOOKS */ + this->p_ = p; } @@ -143,7 +152,11 @@ template ACE_INLINE ACE_Auto_Basic_Array_Ptr::~ACE_Auto_Basic_Array_Ptr (void) { ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::~ACE_Auto_Basic_Array_Ptr"); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(this->get ()); +#else delete [] this->get (); +#endif /* ACE_HAS_ALLOC_HOOKS */ } template ACE_INLINE X & diff --git a/deps/acelite/ace/Barrier.cpp b/deps/acelite/ace/Barrier.cpp index e6f33efee..9eb706785 100644 --- a/deps/acelite/ace/Barrier.cpp +++ b/deps/acelite/ace/Barrier.cpp @@ -9,6 +9,10 @@ #include "ace/Guard_T.h" #include "ace/OS_NS_errno.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if defined (ACE_HAS_DUMP) # include "ace/Log_Category.h" #endif /* ACE_HAS_DUMP */ diff --git a/deps/acelite/ace/Barrier.h b/deps/acelite/ace/Barrier.h index b9a06ea68..d6efaf2b8 100644 --- a/deps/acelite/ace/Barrier.h +++ b/deps/acelite/ace/Barrier.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/Base_Thread_Adapter.h b/deps/acelite/ace/Base_Thread_Adapter.h index d45ce6574..e98df29a2 100644 --- a/deps/acelite/ace/Base_Thread_Adapter.h +++ b/deps/acelite/ace/Base_Thread_Adapter.h @@ -87,7 +87,6 @@ class ACE_Service_Gestalt; class ACE_Export ACE_Base_Thread_Adapter { public: - virtual ~ACE_Base_Thread_Adapter (void); /// Virtual method invoked by the thread entry point. diff --git a/deps/acelite/ace/Based_Pointer_Repository.cpp b/deps/acelite/ace/Based_Pointer_Repository.cpp index ef094f02e..6ec16f555 100644 --- a/deps/acelite/ace/Based_Pointer_Repository.cpp +++ b/deps/acelite/ace/Based_Pointer_Repository.cpp @@ -5,6 +5,10 @@ #include "ace/Synch_Traits.h" #include "ace/RW_Thread_Mutex.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -30,8 +34,12 @@ public: /// Synchronize concurrent access to the map. ACE_SYNCH_MUTEX lock_; + + ACE_ALLOC_HOOK_DECLARE; }; +ACE_ALLOC_HOOK_DEFINE(ACE_Based_Pointer_Repository_Rep); + ACE_Based_Pointer_Repository::ACE_Based_Pointer_Repository (void) { ACE_TRACE ("ACE_Based_Pointer_Repository::ACE_Based_Pointer_Repository"); diff --git a/deps/acelite/ace/Based_Pointer_Repository.h b/deps/acelite/ace/Based_Pointer_Repository.h index 00b6d2c4f..8139a8edb 100644 --- a/deps/acelite/ace/Based_Pointer_Repository.h +++ b/deps/acelite/ace/Based_Pointer_Repository.h @@ -41,7 +41,6 @@ class ACE_Export ACE_Based_Pointer_Repository public: // = Use ACE_Null_Mutex to allow locking while iterating. - // = Initialization and termination methods. ACE_Based_Pointer_Repository (void); ~ACE_Based_Pointer_Repository (void); @@ -64,7 +63,6 @@ public: int unbind (void *addr); private: - /// Use the "Cheshire-Cat" technique to hide the implementation in /// order to avoid circular #include dependencies. ACE_Based_Pointer_Repository_Rep *rep_; diff --git a/deps/acelite/ace/Based_Pointer_T.cpp b/deps/acelite/ace/Based_Pointer_T.cpp index b36939aec..df983903c 100644 --- a/deps/acelite/ace/Based_Pointer_T.cpp +++ b/deps/acelite/ace/Based_Pointer_T.cpp @@ -13,6 +13,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Based_Pointer_Basic) + template ACE_Based_Pointer::ACE_Based_Pointer (void) { diff --git a/deps/acelite/ace/Based_Pointer_T.h b/deps/acelite/ace/Based_Pointer_T.h index e0211603c..71432eb1e 100644 --- a/deps/acelite/ace/Based_Pointer_T.h +++ b/deps/acelite/ace/Based_Pointer_T.h @@ -157,7 +157,6 @@ template class ACE_Based_Pointer : public ACE_Based_Pointer_Basic { public: - // = Initialization method. /// Constructor. See constructor for ACE_Based_Pointer_Basic for /// details. ACE_Based_Pointer (void); diff --git a/deps/acelite/ace/Basic_Types.h b/deps/acelite/ace/Basic_Types.h index b9feefb5e..67916f8dc 100644 --- a/deps/acelite/ace/Basic_Types.h +++ b/deps/acelite/ace/Basic_Types.h @@ -29,8 +29,8 @@ * - ACE_UINT16 * - ACE_INT32 * - ACE_UINT32 - * - ACE_UINT64 * - ACE_INT64 + * - ACE_UINT64 * * Byte-order (endian-ness) determination: * ACE_BYTE_ORDER, to either ACE_BIG_ENDIAN or ACE_LITTLE_ENDIAN @@ -70,6 +70,17 @@ # include # endif +# if defined (ACE_HAS_CPP11) +# define ACE_HAS_INT8_T +# define ACE_HAS_UINT8_T +# define ACE_HAS_INT16_T +# define ACE_HAS_UINT16_T +# define ACE_HAS_INT32_T +# define ACE_HAS_UINT32_T +# define ACE_HAS_INT64_T +# define ACE_HAS_UINT64_T +# endif /* ACE_HAS_CPP11 */ + #ifdef ACE_LACKS_INTPTR_T # include "ace/If_Then_Else.h" @@ -208,28 +219,28 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL // typedefs for whatever we can. Some of these are needed for certain // cases of ACE_UINT64, so do them before the 64-bit stuff. -#if defined (ACE_INT8_TYPE) - typedef ACE_INT8_TYPE ACE_INT8; -#elif defined (ACE_HAS_INT8_T) +#if defined (ACE_HAS_INT8_T) typedef int8_t ACE_INT8; +#elif defined (ACE_INT8_TYPE) + typedef ACE_INT8_TYPE ACE_INT8; #elif !defined (ACE_LACKS_SIGNED_CHAR) typedef signed char ACE_INT8; #else typedef char ACE_INT8; #endif /* defined (ACE_INT8_TYPE) */ -#if defined (ACE_UINT8_TYPE) - typedef ACE_UINT8_TYPE ACE_UINT8; -#elif defined (ACE_HAS_UINT8_T) +#if defined (ACE_HAS_UINT8_T) typedef uint8_t ACE_UINT8; +#elif defined (ACE_UINT8_TYPE) + typedef ACE_UINT8_TYPE ACE_UINT8; #else typedef unsigned char ACE_UINT8; #endif /* defined (ACE_UINT8_TYPE) */ -#if defined (ACE_INT16_TYPE) - typedef ACE_INT16_TYPE ACE_INT16; -#elif defined (ACE_HAS_INT16_T) +#if defined (ACE_HAS_INT16_T) typedef int16_t ACE_INT16; +#elif defined (ACE_INT16_TYPE) + typedef ACE_INT16_TYPE ACE_INT16; #elif ACE_SIZEOF_SHORT == 2 typedef short ACE_INT16; #elif ACE_SIZEOF_INT == 2 @@ -238,10 +249,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL # error Have to add to the ACE_INT16 type setting #endif /* defined (ACE_INT16_TYPE) */ -#if defined (ACE_UINT16_TYPE) - typedef ACE_UINT16_TYPE ACE_UINT16; -#elif defined (ACE_HAS_UINT16_T) +#if defined (ACE_HAS_UINT16_T) typedef uint16_t ACE_UINT16; +#elif defined (ACE_UINT16_TYPE) + typedef ACE_UINT16_TYPE ACE_UINT16; #elif ACE_SIZEOF_SHORT == 2 typedef unsigned short ACE_UINT16; #elif ACE_SIZEOF_INT == 2 @@ -250,10 +261,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL # error Have to add to the ACE_UINT16 type setting #endif /* defined (ACE_UINT16_TYPE) */ -#if defined (ACE_INT32_TYPE) - typedef ACE_INT32_TYPE ACE_INT32; -#elif defined (ACE_HAS_INT32_T) +#if defined (ACE_HAS_INT32_T) typedef int32_t ACE_INT32; +#elif defined (ACE_INT32_TYPE) + typedef ACE_INT32_TYPE ACE_INT32; #elif ACE_SIZEOF_INT == 4 typedef int ACE_INT32; #elif ACE_SIZEOF_LONG == 4 @@ -262,10 +273,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL # error Have to add to the ACE_INT32 type setting #endif /* defined (ACE_INT32_TYPE) */ -#if defined (ACE_UINT32_TYPE) - typedef ACE_UINT32_TYPE ACE_UINT32; -#elif defined (ACE_HAS_UINT32_T) +#if defined (ACE_HAS_UINT32_T) typedef uint32_t ACE_UINT32; +#elif defined (ACE_UINT32_TYPE) + typedef ACE_UINT32_TYPE ACE_UINT32; #elif ACE_SIZEOF_INT == 4 typedef unsigned int ACE_UINT32; #elif ACE_SIZEOF_LONG == 4 @@ -274,10 +285,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL # error Have to add to the ACE_UINT32 type setting #endif /* defined (ACE_UINT32_TYPE) */ -#if defined (ACE_INT64_TYPE) - typedef ACE_INT64_TYPE ACE_INT64; -#elif defined (ACE_HAS_INT64_T) +#if defined (ACE_HAS_INT64_T) typedef int64_t ACE_INT64; +#elif defined (ACE_INT64_TYPE) + typedef ACE_INT64_TYPE ACE_INT64; #elif ACE_SIZEOF_LONG == 8 typedef long ACE_INT64; #elif ACE_SIZEOF_LONG_LONG == 8 @@ -289,10 +300,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL typedef long long ACE_INT64; #endif /* defined (ACE_INT64_TYPE) */ -#if defined (ACE_UINT64_TYPE) - typedef ACE_UINT64_TYPE ACE_UINT64; -#elif defined (ACE_HAS_UINT64_T) +#if defined (ACE_HAS_UINT64_T) typedef uint64_t ACE_UINT64; +#elif defined (ACE_UINT64_TYPE) + typedef ACE_UINT64_TYPE ACE_UINT64; #elif ACE_SIZEOF_LONG == 8 typedef unsigned long ACE_UINT64; #elif ACE_SIZEOF_LONG_LONG == 8 @@ -393,8 +404,14 @@ ACE_END_VERSIONED_NAMESPACE_DECL # define ACE_IDL_NSTOHL(X) ((X) << 16) # endif /* ACE_LITTLE_ENDIAN */ -#define ACE_HTONS(x) htons(x) -#define ACE_NTOHS(x) ntohs(x) +// MQX doesn't define these macros correctly. +# if defined (ACE_LITTLE_ENDIAN) && defined (ACE_MQX) +# define ACE_HTONS(x) x +# define ACE_NTOHS(x) x +# else +# define ACE_HTONS(x) htons(x) +# define ACE_NTOHS(x) ntohs(x) +# endif # define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \ reinterpret_cast (static_cast (L)) @@ -423,9 +440,6 @@ ACE_END_VERSIONED_NAMESPACE_DECL # define ACE_UINT64_LITERAL(n) n ## ui64 # define ACE_INT64_LITERAL(n) n ## i64 # endif /* defined (__MINGW32__) */ -#elif defined (__TANDEM) -# define ACE_UINT64_LITERAL(n) n ## LL -# define ACE_INT64_LITERAL(n) n ## LL #else /* ! ACE_WIN32 */ # define ACE_UINT64_LITERAL(n) n ## ull # define ACE_INT64_LITERAL(n) n ## ll diff --git a/deps/acelite/ace/Bound_Ptr.cpp b/deps/acelite/ace/Bound_Ptr.cpp new file mode 100644 index 000000000..930fe6bd4 --- /dev/null +++ b/deps/acelite/ace/Bound_Ptr.cpp @@ -0,0 +1,17 @@ +/* -*- C++ -*- */ +#ifndef ACE_BOUND_PTR_CPP +#define ACE_BOUND_PTR_CPP + +#include "ace/Bound_Ptr.h" + +#if !defined (__ACE_INLINE__) +#include "ace/Bound_Ptr.inl" +#endif /* __ACE_INLINE__ */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Bound_Ptr_Counter) + +ACE_END_VERSIONED_NAMESPACE_DECL + +#endif /* ACE_BOUND_PTR_CPP */ diff --git a/deps/acelite/ace/Bound_Ptr.h b/deps/acelite/ace/Bound_Ptr.h index 6ab33018c..6626b97b3 100644 --- a/deps/acelite/ace/Bound_Ptr.h +++ b/deps/acelite/ace/Bound_Ptr.h @@ -20,7 +20,9 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Auto_Ptr.h" +#if !defined (ACE_HAS_CPP11) +# include "ace/Auto_Ptr.h" +#endif /* !ACE_HAS_CPP11 */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -72,13 +74,11 @@ public: static bool object_was_deleted (ACE_Bound_Ptr_Counter *counter); private: - /// Allocate a new ACE_Bound_Ptr_Counter instance, /// returning NULL if it cannot be created. static ACE_Bound_Ptr_Counter *internal_create (long init_obj_ref_count); private: - /// Reference count of underlying object. Is set to -1 once the /// object has been destroyed to indicate to all weak pointers that /// it is no longer valid. @@ -114,9 +114,11 @@ public: /// object \ immediately. explicit ACE_Strong_Bound_Ptr (X *p = 0); +#if !defined (ACE_HAS_CPP11) /// Constructor that initializes an ACE_Strong_Bound_Ptr by stealing /// ownership of an object from an auto_ptr. - explicit ACE_Strong_Bound_Ptr (std::unique_ptr p); + explicit ACE_Strong_Bound_Ptr (auto_ptr p); +#endif /* !ACE_HAS_CPP11 */ /// Copy constructor binds @c this and @a r to the same object. ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr &r); @@ -214,10 +216,12 @@ public: /// underlying object. void reset (X *p = 0); +#if !defined (ACE_HAS_CPP11) /// Resets the ACE_Strong_Bound_Ptr to refer to a different /// underlying object, ownership of which is stolen from the /// auto_ptr. - void reset (std::unique_ptr p); + void reset (auto_ptr p); +#endif /* !ACE_HAS_CPP11 */ /// Allows us to check for NULL on all ACE_Strong_Bound_Ptr /// objects. @@ -379,7 +383,17 @@ private: ACE_END_VERSIONED_NAMESPACE_DECL +#if defined (__ACE_INLINE__) #include "ace/Bound_Ptr.inl" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Bound_Ptr.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Bound_Ptr.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ #include /**/ "ace/post.h" diff --git a/deps/acelite/ace/Bound_Ptr.inl b/deps/acelite/ace/Bound_Ptr.inl index ccb6cbe13..826c9aa98 100644 --- a/deps/acelite/ace/Bound_Ptr.inl +++ b/deps/acelite/ace/Bound_Ptr.inl @@ -1,6 +1,4 @@ /* -*- C++ -*- */ -// Bound_Ptr.i - #include "ace/Guard_T.h" #if !defined (ACE_NEW_THROWS_EXCEPTIONS) # include "ace/Log_Category.h" @@ -148,12 +146,14 @@ ACE_Strong_Bound_Ptr::ACE_Strong_Bound_Ptr (X *p) { } +#if !defined (ACE_HAS_CPP11) template inline -ACE_Strong_Bound_Ptr::ACE_Strong_Bound_Ptr (std::unique_ptr p) +ACE_Strong_Bound_Ptr::ACE_Strong_Bound_Ptr (auto_ptr p) : counter_ (COUNTER::create_strong ()), ptr_ (p.release()) { } +#endif /* !ACE_HAS_CPP11 */ template inline ACE_Strong_Bound_Ptr::ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr &r) @@ -303,8 +303,9 @@ ACE_Strong_Bound_Ptr::reset (X *p) delete old_ptr; } +#if !defined (ACE_HAS_CPP11) template inline void -ACE_Strong_Bound_Ptr::reset(std::unique_ptr p) +ACE_Strong_Bound_Ptr::reset (auto_ptr p) { COUNTER *old_counter = this->counter_; X_t *old_ptr = this->ptr_; @@ -313,6 +314,7 @@ ACE_Strong_Bound_Ptr::reset(std::unique_ptr p) if (COUNTER::detach_strong (old_counter) == 0) delete old_ptr; } +#endif /* !ACE_HAS_CPP11 */ template inline ACE_Weak_Bound_Ptr::ACE_Weak_Bound_Ptr (X *p) diff --git a/deps/acelite/ace/CDR_Base.cpp b/deps/acelite/ace/CDR_Base.cpp index b2ee413e9..b87380ee5 100644 --- a/deps/acelite/ace/CDR_Base.cpp +++ b/deps/acelite/ace/CDR_Base.cpp @@ -52,7 +52,7 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n) } #else char const * const o4 = ACE_ptr_align_binary (orig, 4); - // this is an _if_, not a _while_. The mistmatch can only be by 2. + // this is an _if_, not a _while_. The mismatch can only be by 2. if (orig != o4) { ACE_CDR::swap_2 (orig, target); @@ -74,7 +74,7 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n) // end marks our barrier for not falling outside. char const * const end = orig + 2 * (n & (~3)); - // See if we're aligned for writting in 64 or 32 bit chunks... + // See if we're aligned for writing in 64 or 32 bit chunks... #if ACE_SIZEOF_LONG == 8 && \ !((defined(__amd64__) || defined (__x86_64__)) && defined(__GNUG__)) if (target == ACE_ptr_align_binary (target, 8)) @@ -110,25 +110,22 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n) __asm mov 4[edx], ebx; #elif ACE_SIZEOF_LONG == 8 // 64 bit architecture. - ACE_REGISTER unsigned long a = - * reinterpret_cast (orig); + unsigned long a = * reinterpret_cast (orig); - ACE_REGISTER unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; - ACE_REGISTER unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; + unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; + unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; a = (a1 | a2); * reinterpret_cast (target) = a; #else - ACE_REGISTER ACE_UINT32 a = - * reinterpret_cast (orig); - ACE_REGISTER ACE_UINT32 b = - * reinterpret_cast (orig + 4); + ACE_UINT32 a = * reinterpret_cast (orig); + ACE_UINT32 b = * reinterpret_cast (orig + 4); - ACE_REGISTER ACE_UINT32 a1 = (a & 0x00ff00ffU) << 8; - ACE_REGISTER ACE_UINT32 b1 = (b & 0x00ff00ffU) << 8; - ACE_REGISTER ACE_UINT32 a2 = (a & 0xff00ff00U) >> 8; - ACE_REGISTER ACE_UINT32 b2 = (b & 0xff00ff00U) >> 8; + ACE_UINT32 a1 = (a & 0x00ff00ffU) << 8; + ACE_UINT32 b1 = (b & 0x00ff00ffU) << 8; + ACE_UINT32 a2 = (a & 0xff00ff00U) >> 8; + ACE_UINT32 b2 = (b & 0xff00ff00U) >> 8; a = (a1 | a2); b = (b1 | b2); @@ -181,11 +178,10 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n) __asm mov 4[edx], bx; #elif ACE_SIZEOF_LONG == 8 // 64 bit architecture. - ACE_REGISTER unsigned long a = - * reinterpret_cast (orig); + unsigned long a = * reinterpret_cast (orig); - ACE_REGISTER unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; - ACE_REGISTER unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; + unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; + unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; a = (a1 | a2); @@ -206,15 +202,13 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n) * reinterpret_cast (target + 6) = b4; #endif #else - ACE_REGISTER ACE_UINT32 a = - * reinterpret_cast (orig); - ACE_REGISTER ACE_UINT32 b = - * reinterpret_cast (orig + 4); + ACE_UINT32 a = * reinterpret_cast (orig); + ACE_UINT32 b = * reinterpret_cast (orig + 4); - ACE_REGISTER ACE_UINT32 a1 = (a & 0x00ff00ff) << 8; - ACE_REGISTER ACE_UINT32 b1 = (b & 0x00ff00ff) << 8; - ACE_REGISTER ACE_UINT32 a2 = (a & 0xff00ff00) >> 8; - ACE_REGISTER ACE_UINT32 b2 = (b & 0xff00ff00) >> 8; + ACE_UINT32 a1 = (a & 0x00ff00ff) << 8; + ACE_UINT32 b1 = (b & 0x00ff00ff) << 8; + ACE_UINT32 a2 = (a & 0xff00ff00) >> 8; + ACE_UINT32 b2 = (b & 0xff00ff00) >> 8; a = (a1 | a2); b = (b1 | b2); @@ -248,10 +242,12 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n) ACE_CDR::swap_2 (orig, target); orig += 2; target += 2; + // fallthrough case 2: ACE_CDR::swap_2 (orig, target); orig += 2; target += 2; + // fallthrough case 1: ACE_CDR::swap_2 (orig, target); } @@ -296,10 +292,8 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n) { while (orig < end) { - ACE_REGISTER unsigned long a = - * reinterpret_cast (orig); - ACE_REGISTER unsigned long b = - * reinterpret_cast (orig + 8); + unsigned long a = * reinterpret_cast (orig); + unsigned long b = * reinterpret_cast (orig + 8); #if defined(ACE_HAS_INTEL_ASSEMBLY) asm ("bswapq %1" : "=r" (a) : "0" (a)); @@ -307,14 +301,14 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n) asm ("rol $32, %1" : "=r" (a) : "0" (a)); asm ("rol $32, %1" : "=r" (b) : "0" (b)); #else - ACE_REGISTER unsigned long a84 = (a & 0x000000ff000000ffL) << 24; - ACE_REGISTER unsigned long b84 = (b & 0x000000ff000000ffL) << 24; - ACE_REGISTER unsigned long a73 = (a & 0x0000ff000000ff00L) << 8; - ACE_REGISTER unsigned long b73 = (b & 0x0000ff000000ff00L) << 8; - ACE_REGISTER unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8; - ACE_REGISTER unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8; - ACE_REGISTER unsigned long a51 = (a & 0xff000000ff000000L) >> 24; - ACE_REGISTER unsigned long b51 = (b & 0xff000000ff000000L) >> 24; + unsigned long a84 = (a & 0x000000ff000000ffL) << 24; + unsigned long b84 = (b & 0x000000ff000000ffL) << 24; + unsigned long a73 = (a & 0x0000ff000000ff00L) << 8; + unsigned long b73 = (b & 0x0000ff000000ff00L) << 8; + unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8; + unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8; + unsigned long a51 = (a & 0xff000000ff000000L) >> 24; + unsigned long b51 = (b & 0xff000000ff000000L) >> 24; a = (a84 | a73 | a62 | a51); b = (b84 | b73 | b62 | b51); @@ -332,10 +326,8 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n) // We are out of luck, we have to write in 4 byte chunks. while (orig < end) { - ACE_REGISTER unsigned long a = - * reinterpret_cast (orig); - ACE_REGISTER unsigned long b = - * reinterpret_cast (orig + 8); + unsigned long a = * reinterpret_cast (orig); + unsigned long b = * reinterpret_cast (orig + 8); #if defined(ACE_HAS_INTEL_ASSEMBLY) asm ("bswapq %1" : "=r" (a) : "0" (a)); @@ -343,14 +335,14 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n) asm ("rol $32, %1" : "=r" (a) : "0" (a)); asm ("rol $32, %1" : "=r" (b) : "0" (b)); #else - ACE_REGISTER unsigned long a84 = (a & 0x000000ff000000ffL) << 24; - ACE_REGISTER unsigned long b84 = (b & 0x000000ff000000ffL) << 24; - ACE_REGISTER unsigned long a73 = (a & 0x0000ff000000ff00L) << 8; - ACE_REGISTER unsigned long b73 = (b & 0x0000ff000000ff00L) << 8; - ACE_REGISTER unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8; - ACE_REGISTER unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8; - ACE_REGISTER unsigned long a51 = (a & 0xff000000ff000000L) >> 24; - ACE_REGISTER unsigned long b51 = (b & 0xff000000ff000000L) >> 24; + unsigned long a84 = (a & 0x000000ff000000ffL) << 24; + unsigned long b84 = (b & 0x000000ff000000ffL) << 24; + unsigned long a73 = (a & 0x0000ff000000ff00L) << 8; + unsigned long b73 = (b & 0x0000ff000000ff00L) << 8; + unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8; + unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8; + unsigned long a51 = (a & 0xff000000ff000000L) >> 24; + unsigned long b51 = (b & 0xff000000ff000000L) >> 24; a = (a84 | a73 | a62 | a51); b = (b84 | b73 | b62 | b51); @@ -382,14 +374,10 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n) while (orig < end) { #if defined (ACE_HAS_PENTIUM) && defined (__GNUG__) - ACE_REGISTER unsigned int a = - *reinterpret_cast (orig); - ACE_REGISTER unsigned int b = - *reinterpret_cast (orig + 4); - ACE_REGISTER unsigned int c = - *reinterpret_cast (orig + 8); - ACE_REGISTER unsigned int d = - *reinterpret_cast (orig + 12); + unsigned int a = *reinterpret_cast (orig); + unsigned int b = *reinterpret_cast (orig + 4); + unsigned int c = *reinterpret_cast (orig + 8); + unsigned int d = *reinterpret_cast (orig + 12); asm ("bswap %1" : "=r" (a) : "0" (a)); asm ("bswap %1" : "=r" (b) : "0" (b)); @@ -418,14 +406,10 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n) __asm mov 8[esi], ebx __asm mov 12[esi], eax #else - ACE_REGISTER ACE_UINT32 a = - * reinterpret_cast (orig); - ACE_REGISTER ACE_UINT32 b = - * reinterpret_cast (orig + 4); - ACE_REGISTER ACE_UINT32 c = - * reinterpret_cast (orig + 8); - ACE_REGISTER ACE_UINT32 d = - * reinterpret_cast (orig + 12); + ACE_UINT32 a = * reinterpret_cast (orig); + ACE_UINT32 b = * reinterpret_cast (orig + 4); + ACE_UINT32 c = * reinterpret_cast (orig + 8); + ACE_UINT32 d = * reinterpret_cast (orig + 12); // Expect the optimizer reordering this A LOT. // We leave it this way for clarity. @@ -452,10 +436,12 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n) ACE_CDR::swap_4 (orig, target); orig += 4; target += 4; + // fallthrough case 2: ACE_CDR::swap_4 (orig, target); orig += 4; target += 4; + // fallthrough case 1: ACE_CDR::swap_4 (orig, target); } @@ -598,21 +584,6 @@ ACE_CDR::consolidate (ACE_Message_Block *dst, return 0; } -#if defined (NONNATIVE_LONGLONG) -bool -ACE_CDR::LongLong::operator== (const ACE_CDR::LongLong &rhs) const -{ - return this->h == rhs.h && this->l == rhs.l; -} - -bool -ACE_CDR::LongLong::operator!= (const ACE_CDR::LongLong &rhs) const -{ - return this->l != rhs.l || this->h != rhs.h; -} - -#endif /* NONNATIVE_LONGLONG */ - #if defined (NONNATIVE_LONGDOUBLE) ACE_CDR::LongDouble& ACE_CDR::LongDouble::assign (const ACE_CDR::LongDouble::NativeImpl& rhs) @@ -843,7 +814,7 @@ ACE_CDR::Fixed ACE_CDR::Fixed::from_integer (ACE_CDR::ULongLong val) ACE_CDR::Fixed ACE_CDR::Fixed::from_floating (LongDouble val) { -#ifdef ACE_OPENVMS +#if defined ACE_OPENVMS || (defined ACE_VXWORKS && !defined __RTP__) typedef double BigFloat; #elif defined NONNATIVE_LONGDOUBLE typedef LongDouble::NativeImpl BigFloat; @@ -852,7 +823,7 @@ ACE_CDR::Fixed ACE_CDR::Fixed::from_floating (LongDouble val) #endif Fixed f; - f.digits_ = 0; + f.digits_ = f.scale_ = 0; bool negative = false; if (val < 0) { @@ -864,7 +835,10 @@ ACE_CDR::Fixed ACE_CDR::Fixed::from_floating (LongDouble val) const size_t digits_left = static_cast (1 + ((val > 0) ? std::log10 (val) : 0)); if (digits_left > MAX_DIGITS) - return f; + { + ACE_OS::memset (f.value_, 0, sizeof f.value_); + return f; + } f.digits_ = MAX_DIGITS; f.scale_ = 0; @@ -914,42 +888,25 @@ void ACE_CDR::Fixed::normalize (UShort min_scale) if (this->value_[15] & 0xf0 || !this->scale_) return; - size_t bytes = 0; // number of bytes to shift down - while (2 * (bytes + 1) < this->scale_ - && this->scale_ - 2 * (bytes + 1) >= min_scale - && !this->value_[14 - bytes]) - ++bytes; + // Calculate the number of nibbles that can be moved. + ACE_CDR::Octet nibbles = 0; + while (this->digit(nibbles) == 0 && this->scale_ - nibbles > min_scale) + ++nibbles; - const bool extra_nibble = 2 * (bytes + 1) <= this->scale_ - && this->scale_ - 2 * (bytes + 1) >= min_scale - && !(this->value_[14 - bytes] & 0xf); - const size_t nibbles = 1 /*[15].high*/ + bytes * 2 + extra_nibble; - this->digits_ -= static_cast (nibbles); - this->scale_ -= static_cast (nibbles); + // Move and clear the nibbles. + for (ACE_CDR::Octet idx = nibbles; idx != this->digits_; ++idx) { + this->digit (idx - nibbles, this->digit (idx)); + this->digit (idx, 0); + } - if (extra_nibble) - { - const bool sign = this->sign (); - std::memmove (this->value_ + bytes + 1, this->value_, 15 - bytes); - std::memset (this->value_, 0, bytes + 1); - this->value_[15] |= sign ? NEGATIVE : POSITIVE; - } - else - { - this->value_[15] = (this->value_[14 - bytes] & 0xf) << 4 - | (this->value_[15] & 0xf); - for (size_t i = 14; i > bytes; --i) - this->value_[i] = (this->value_[i - bytes - 1] & 0xf) << 4 - | (this->value_[i - bytes] >> 4); - this->value_[bytes] = this->value_[0] >> 4; - std::memset (this->value_, 0, bytes); - } + this->scale_ -= nibbles; + this->digits_ -= nibbles; } ACE_CDR::Fixed ACE_CDR::Fixed::from_string (const char *str) { - const bool negative = str && *str == '-'; - if (negative || (str && *str == '+')) + const bool negative = *str == '-'; + if (negative || *str == '+') ++str; const size_t span = ACE_OS::strspn (str, ".0123456789"); @@ -1157,14 +1114,16 @@ ACE_CDR::Fixed::ConstIterator ACE_CDR::Fixed::pre_add (const ACE_CDR::Fixed &f) if (f.digits_ - f.scale_ > this->digits_ - this->scale_) { - this->digits_ += f.digits_ - f.scale_ - this->digits_ + this->scale_; - if (this->digits_ > MAX_DIGITS) + ACE_CDR::Octet new_digits = this->digits_ + (f.digits_ - f.scale_) - (this->digits_ - this->scale_); + if (new_digits > MAX_DIGITS) { - for (size_t i = 0; i < static_cast (this->digits_ - MAX_DIGITS); ++i) + for (size_t i = 0; i < static_cast (new_digits - MAX_DIGITS); ++i) this->digit (static_cast (i), 0); - this->normalize (this->scale_ - MAX_DIGITS - this->digits_); + this->normalize (this->scale_ - (new_digits - MAX_DIGITS)); this->digits_ = MAX_DIGITS; } + else + this->digits_ = new_digits; } return rhs_iter; } @@ -1391,10 +1350,15 @@ ACE_CDR::Fixed &ACE_CDR::Fixed::operator/= (const Fixed &rhs) if (neg) this->value_[15] = (this->value_[15] & 0xf0) | POSITIVE; - Fixed r, q = this->div_helper2 (rhs_no_scale, r); + Fixed r; + Fixed q = this->div_helper2 (rhs_no_scale, r); + q.scale_ = this->scale_; - if (!r) - return *this = neg ? -q : q;; + if (!r) { + *this = neg ? -q : q; + this->normalize (); + return *this; + } const int shift = q.lshift (MAX_DIGITS); if (shift) @@ -1458,6 +1422,7 @@ ACE_CDR::Fixed ACE_CDR::Fixed::div_helper1 (const Fixed &rhs, Fixed &r) const if (q > 9) q = 9; Fixed t = from_integer (LongLong (q)) * rhs; + t.scale_ = this->scale_; for (int i = 0; i < 2 && t > *this; ++i) { --q; diff --git a/deps/acelite/ace/CDR_Base.h b/deps/acelite/ace/CDR_Base.h index 22dd8adf9..a8b49e5a0 100644 --- a/deps/acelite/ace/CDR_Base.h +++ b/deps/acelite/ace/CDR_Base.h @@ -21,7 +21,6 @@ */ //============================================================================= - #ifndef ACE_CDR_BASE_H #define ACE_CDR_BASE_H @@ -206,53 +205,9 @@ public: typedef ACE_UINT16 UShort; typedef ACE_INT32 Long; typedef ACE_UINT32 ULong; + typedef ACE_INT64 LongLong; typedef ACE_UINT64 ULongLong; -# if (defined (_MSC_VER)) || (defined (__BORLANDC__)) - typedef __int64 LongLong; -# elif ACE_SIZEOF_LONG == 8 - typedef long LongLong; -# elif defined(__TANDEM) - typedef long long LongLong; -# elif ACE_SIZEOF_LONG_LONG == 8 -# if defined (sun) && !defined (ACE_LACKS_U_LONGLONG_T) - // sun #defines u_longlong_t, maybe other platforms do also. - // Use it, at least with g++, so that its -pedantic doesn't - // complain about no ANSI C++ long long. - typedef longlong_t LongLong; -# else - typedef long long LongLong; -# endif /* sun */ -# else /* no native 64 bit integer type */ -# define NONNATIVE_LONGLONG - struct ACE_Export LongLong - { -# if defined (ACE_BIG_ENDIAN) - ACE_CDR::Long h; - ACE_CDR::Long l; -# else - ACE_CDR::Long l; - ACE_CDR::Long h; -# endif /* ! ACE_BIG_ENDIAN */ - - /** - * @name Overloaded Relation Operators. - * - * The canonical comparison operators. - */ - //@{ - bool operator== (const LongLong &rhs) const; - bool operator!= (const LongLong &rhs) const; - //@} - }; -# endif /* no native 64 bit integer type */ - -# if defined (NONNATIVE_LONGLONG) -# define ACE_CDR_LONGLONG_INITIALIZER {0,0} -# else -# define ACE_CDR_LONGLONG_INITIALIZER 0 -# endif /* NONNATIVE_LONGLONG */ - # if ACE_SIZEOF_FLOAT == 4 typedef float Float; # else /* ACE_SIZEOF_FLOAT != 4 */ @@ -362,7 +317,7 @@ public: /// See OMG 2012-07-02 IDL-to-C++ Mapping v1.3 section 5.13 /// This class doesn't exactly match the IDL-to-C++ mapping because /// it is meant for use inside a union in the IDL compiler and therefore - /// has no constructors. Standards-based middlware libraries such as + /// has no constructors. Standards-based middleware libraries such as /// ORBs and DDSs can wrap this class in a class of their own to provide /// the exact interface described by the mapping specification. class ACE_Export Fixed diff --git a/deps/acelite/ace/CDR_Base.inl b/deps/acelite/ace/CDR_Base.inl index 2a93c82b6..c31c3b785 100644 --- a/deps/acelite/ace/CDR_Base.inl +++ b/deps/acelite/ace/CDR_Base.inl @@ -66,6 +66,9 @@ ACE_CDR::swap_2 (const char *orig, char* target) // function. *reinterpret_cast (target) = _byteswap_ushort (*reinterpret_cast (orig)); +#elif defined (ACE_HAS_BUILTIN_BSWAP16) + *reinterpret_cast (target) = + __builtin_bswap16 (*reinterpret_cast (orig)); #elif defined (ACE_HAS_BSWAP16) *reinterpret_cast (target) = bswap16 (*reinterpret_cast (orig)); @@ -86,8 +89,8 @@ ACE_CDR::swap_2 (const char *orig, char* target) __asm rol ax, 8; __asm mov [ecx], ax; #else - ACE_REGISTER ACE_UINT16 usrc = * reinterpret_cast (orig); - ACE_REGISTER ACE_UINT16* udst = reinterpret_cast (target); + ACE_UINT16 usrc = * reinterpret_cast (orig); + ACE_UINT16* udst = reinterpret_cast (target); *udst = (usrc << 8) | (usrc >> 8); #endif /* ACE_HAS_PENTIUM */ } @@ -100,6 +103,9 @@ ACE_CDR::swap_4 (const char* orig, char* target) // function. *reinterpret_cast (target) = _byteswap_ulong (*reinterpret_cast (orig)); +#elif defined (ACE_HAS_BUILTIN_BSWAP32) + *reinterpret_cast (target) = + __builtin_bswap32 (*reinterpret_cast (orig)); #elif defined (ACE_HAS_BSWAP32) *reinterpret_cast (target) = bswap32 (*reinterpret_cast (orig)); @@ -108,7 +114,7 @@ ACE_CDR::swap_4 (const char* orig, char* target) bswap_32 (*reinterpret_cast (orig)); #elif defined(ACE_HAS_INTEL_ASSEMBLY) // We have ACE_HAS_PENTIUM, so we know the sizeof's. - ACE_REGISTER unsigned int j = + unsigned int j = *reinterpret_cast (orig); asm ("bswap %1" : "=r" (j) : "0" (j)); *reinterpret_cast (target) = j; @@ -121,7 +127,7 @@ ACE_CDR::swap_4 (const char* orig, char* target) __asm bswap eax; __asm mov [ecx], eax; #else - ACE_REGISTER ACE_UINT32 x = * reinterpret_cast (orig); + ACE_UINT32 x = * reinterpret_cast (orig); x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); * reinterpret_cast (target) = x; #endif /* ACE_HAS_INTRINSIC_BYTESWAP */ @@ -135,6 +141,9 @@ ACE_CDR::swap_8 (const char* orig, char* target) // function. *reinterpret_cast (target) = _byteswap_uint64 (*reinterpret_cast (orig)); +#elif defined (ACE_HAS_BUILTIN_BSWAP64) + *reinterpret_cast (target) = + __builtin_bswap64 (*reinterpret_cast (orig)); #elif defined (ACE_HAS_BSWAP64) *reinterpret_cast (target) = bswap64 (*reinterpret_cast (orig)); @@ -143,16 +152,14 @@ ACE_CDR::swap_8 (const char* orig, char* target) bswap_64 (*reinterpret_cast (orig)); #elif (defined (__amd64__) || defined (__x86_64__)) && defined(__GNUG__) \ && !defined(ACE_LACKS_INLINE_ASSEMBLY) - ACE_REGISTER unsigned long x = + unsigned long x = * reinterpret_cast (orig); asm ("bswapq %1" : "=r" (x) : "0" (x)); *reinterpret_cast (target) = x; #elif defined(ACE_HAS_PENTIUM) && defined(__GNUG__) \ && !defined(ACE_LACKS_INLINE_ASSEMBLY) - ACE_REGISTER unsigned int i = - *reinterpret_cast (orig); - ACE_REGISTER unsigned int j = - *reinterpret_cast (orig + 4); + unsigned int i =*reinterpret_cast (orig); + unsigned int j = *reinterpret_cast (orig + 4); asm ("bswap %1" : "=r" (i) : "0" (i)); asm ("bswap %1" : "=r" (j) : "0" (j)); *reinterpret_cast (target + 4) = i; @@ -170,20 +177,17 @@ ACE_CDR::swap_8 (const char* orig, char* target) __asm mov [edx], ebx; #elif ACE_SIZEOF_LONG == 8 // 64 bit architecture. - ACE_REGISTER unsigned long x = - * reinterpret_cast (orig); - ACE_REGISTER unsigned long x84 = (x & 0x000000ff000000ffUL) << 24; - ACE_REGISTER unsigned long x73 = (x & 0x0000ff000000ff00UL) << 8; - ACE_REGISTER unsigned long x62 = (x & 0x00ff000000ff0000UL) >> 8; - ACE_REGISTER unsigned long x51 = (x & 0xff000000ff000000UL) >> 24; + unsigned long x = * reinterpret_cast (orig); + unsigned long x84 = (x & 0x000000ff000000ffUL) << 24; + unsigned long x73 = (x & 0x0000ff000000ff00UL) << 8; + unsigned long x62 = (x & 0x00ff000000ff0000UL) >> 8; + unsigned long x51 = (x & 0xff000000ff000000UL) >> 24; x = (x84 | x73 | x62 | x51); x = (x << 32) | (x >> 32); *reinterpret_cast (target) = x; #else - ACE_REGISTER ACE_UINT32 x = - * reinterpret_cast (orig); - ACE_REGISTER ACE_UINT32 y = - * reinterpret_cast (orig + 4); + ACE_UINT32 x = * reinterpret_cast (orig); + ACE_UINT32 y = * reinterpret_cast (orig + 4); x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); y = (y << 24) | ((y & 0xff00) << 8) | ((y & 0xff0000) >> 8) | (y >> 24); * reinterpret_cast (target) = y; diff --git a/deps/acelite/ace/CDR_Size.h b/deps/acelite/ace/CDR_Size.h index ad229bca3..c535924f1 100644 --- a/deps/acelite/ace/CDR_Size.h +++ b/deps/acelite/ace/CDR_Size.h @@ -44,7 +44,7 @@ public: ACE_SizeCDR (ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION); - /// Returns @c false if an error has ocurred. + /// Returns @c false if an error has occurred. bool good_bit (void) const; /// Reset current size. @@ -78,6 +78,10 @@ public: ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x); ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length, const ACE_CDR::WChar *x); + ACE_CDR::Boolean write_string (const std::string &x); +#if !defined(ACE_LACKS_STD_WSTRING) + ACE_CDR::Boolean write_wstring (const std::wstring &x); +#endif //@} /// @note the portion written starts at and ends @@ -112,7 +116,7 @@ public: ACE_CDR::ULong length); /// - /// Adjust to @a size and count octets. + /// Adjust to @a size and count @a size octets. void adjust (size_t size); /// As above, but now the size and alignment requirements may be @@ -153,7 +157,7 @@ private: ACE_CDR::ULong length); private: - /// Set to false when an error ocurrs. + /// Set to false when an error occurs. bool good_bit_; /// Current size. @@ -223,6 +227,12 @@ extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, const ACE_CDR::Char* x); extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, const ACE_CDR::WChar* x); +extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, + const std::string& x); +#if !defined(ACE_LACKS_STD_WSTRING) +extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, + const std::wstring& x); +#endif ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/CDR_Size.inl b/deps/acelite/ace/CDR_Size.inl index 9b83b6f72..d138b3de1 100644 --- a/deps/acelite/ace/CDR_Size.inl +++ b/deps/acelite/ace/CDR_Size.inl @@ -143,6 +143,26 @@ ACE_SizeCDR::write_wstring (const ACE_CDR::WChar *x) return this->write_wstring (0, 0); } +ACE_INLINE ACE_CDR::Boolean +ACE_SizeCDR::write_string (const std::string &x) +{ + ACE_CDR::ULong len = + static_cast (x.size ()); + return this->write_string (len, + x.empty () ? 0 : x.c_str ()); +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE ACE_CDR::Boolean +ACE_SizeCDR::write_wstring (const std::wstring &x) +{ + ACE_CDR::ULong len = + static_cast (x.size ()); + return this->write_wstring (len, + x.empty () ? 0 : x.c_str ()); +} +#endif + ACE_INLINE ACE_CDR::Boolean ACE_SizeCDR::write_char_array (const ACE_CDR::Char *x, ACE_CDR::ULong length) @@ -372,6 +392,22 @@ operator<< (ACE_SizeCDR &ss, const ACE_CDR::WChar *x) return (ACE_CDR::Boolean) ss.good_bit (); } +ACE_INLINE ACE_CDR::Boolean +operator<< (ACE_SizeCDR &ss, const std::string& x) +{ + ss.write_string (x); + return (ACE_CDR::Boolean) ss.good_bit (); +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE ACE_CDR::Boolean +operator<< (ACE_SizeCDR &ss, const std::wstring& x) +{ + ss.write_wstring (x); + return (ACE_CDR::Boolean) ss.good_bit (); +} +#endif + // The following use the helper classes ACE_INLINE ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_boolean x) diff --git a/deps/acelite/ace/CDR_Stream.cpp b/deps/acelite/ace/CDR_Stream.cpp index bf9917897..32654aedd 100644 --- a/deps/acelite/ace/CDR_Stream.cpp +++ b/deps/acelite/ace/CDR_Stream.cpp @@ -1520,9 +1520,15 @@ ACE_InputCDR::read_string (ACE_CDR::Char *&x) // the memory is allocated. if (len > 0 && len <= this->length()) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (x, + static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::Char) * (len))), + 0); +#else ACE_NEW_RETURN (x, ACE_CDR::Char[len], 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_Auto_Basic_Array_Ptr safe_data (x); @@ -1536,9 +1542,16 @@ ACE_InputCDR::read_string (ACE_CDR::Char *&x) { // Convert any null strings to empty strings since empty // strings can cause crashes. (See bug 58.) +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (x, + static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::Char) * (1))), + 0); +#else ACE_NEW_RETURN (x, ACE_CDR::Char[1], 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_OS::strcpy (const_cast (x), ""); return true; } @@ -1601,9 +1614,15 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x) ACE_OutputCDR::wchar_maxbytes_); //allocating one extra for the null character needed by applications +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (x, + static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::WChar) * (len + 1))), + 0); +#else ACE_NEW_RETURN (x, ACE_CDR::WChar [len + 1], false); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_auto_ptr_reset (safe_data, x); @@ -1622,9 +1641,15 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x) } else { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (x, + static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::WChar) * (len))), + 0); +#else ACE_NEW_RETURN (x, ACE_CDR::WChar [len], false); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_auto_ptr_reset (safe_data, x); @@ -1640,9 +1665,16 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x) { // Convert any null strings to empty strings since empty // strings can cause crashes. (See bug 58.) - ACE_NEW_RETURN (x, - ACE_CDR::WChar[1], - false); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (x, + static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::WChar) * (1))), + 0); +#else + ACE_NEW_RETURN (x, + ACE_CDR::WChar [1], + false); +#endif /* ACE_HAS_ALLOC_HOOKS */ + x[0] = '\x00'; return true; } @@ -1652,6 +1684,146 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x) return false; } +// As of C++11 std::string guarantees contiguous memory storage. +// That provides the opportunity to optimize CDR streaming. +ACE_CDR::Boolean +ACE_InputCDR::read_string (std::string& x) +{ +#if defined (ACE_HAS_CPP11) + // @@ This is a slight violation of "Optimize for the common case", + // i.e. normally the translator will be 0, but OTOH the code is + // smaller and should be better for the cache ;-) ;-) + if (this->char_translator_ != 0) + { + this->good_bit_ = this->char_translator_->read_string (*this, x); + return this->good_bit_; + } + + ACE_CDR::ULong len = 0; + + if (!this->read_ulong (len)) + return false; + + // A check for the length being too great is done later in the + // call to read_char_array but we want to have it done before + // the memory is allocated. + if (len > 0 && len <= this->length()) + { + try + { + x.resize (len-1); // no need to include the terminating '\0' here + } + catch (const std::bad_alloc&) + { + return false; + } + + if (len == 0 || this->read_char_array (&x[0], len-1)) + { + return this->skip_char (); // skip the terminating '\0' + } + } + + this->good_bit_ = false; + x.clear (); + return false; +#else + ACE_CDR::Char *buf = 0; + ACE_CDR::Boolean const marshal_flag = this->read_string (buf); + x.assign (buf); + ACE::strdelete (buf); + return marshal_flag; +#endif +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_CDR::Boolean +ACE_InputCDR::read_wstring (std::wstring& x) +{ +#if defined (ACE_HAS_CPP11) + // @@ This is a slight violation of "Optimize for the common case", + // i.e. normally the translator will be 0, but OTOH the code is + // smaller and should be better for the cache ;-) ;-) + if (this->wchar_translator_ != 0) + { + this->good_bit_ = this->wchar_translator_->read_wstring (*this, x); + return this->good_bit_; + } + if (ACE_OutputCDR::wchar_maxbytes_ == 0) + { + errno = EACCES; + return (this->good_bit_ = false); + } + + ACE_CDR::ULong len = 0; + + if (!this->read_ulong (len)) + { + return false; + } + + // A check for the length being too great is done later in the + // call to read_char_array but we want to have it done before + // the memory is allocated. + if (len > 0 && len <= this->length ()) + { + if (static_cast (this->major_version_) == 1 + && static_cast (this->minor_version_) == 2) + { + len /= + ACE_Utils::truncate_cast ( + ACE_OutputCDR::wchar_maxbytes_); + + try + { + x.resize (len); + } + catch (const std::bad_alloc&) + { + return false; + } + + if (this->read_wchar_array (&x[0], len)) + { + return true; + } + } + else + { + try + { + x.resize (len-1); // no need to include the terminating '\0' here + } + catch (const std::bad_alloc&) + { + return false; + } + + if (len == 1 || this->read_wchar_array (&x[0], len-1)) + { + return this->skip_wchar (); // skip the terminating '\0' + } + } + } + else if (len == 0) + { + x.clear (); + return true; + } + + this->good_bit_ = false; + x.clear (); + return false; +#else + ACE_CDR::WChar *buf = 0; + ACE_CDR::Boolean const marshal_flag = this->read_wstring (buf); + x.assign (buf); + ACE::strdelete (buf); + return marshal_flag; +#endif +} +#endif + ACE_CDR::Boolean ACE_InputCDR::read_array (void* x, size_t size, @@ -2195,12 +2367,36 @@ ACE_Char_Codeset_Translator::~ACE_Char_Codeset_Translator (void) { } +ACE_CDR::Boolean +ACE_Char_Codeset_Translator::read_string (ACE_InputCDR &cdr, + std::string &x) +{ + ACE_CDR::Char *buf = 0; + ACE_CDR::Boolean const marshal_flag = this->read_string (cdr, buf); + x.assign (buf); + ACE::strdelete (buf); + return marshal_flag; +} + // -------------------------------------------------------------- ACE_WChar_Codeset_Translator::~ACE_WChar_Codeset_Translator (void) { } +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_CDR::Boolean +ACE_WChar_Codeset_Translator::read_wstring (ACE_InputCDR &cdr, + std::wstring &x) +{ + ACE_CDR::WChar *buf = 0; + ACE_CDR::Boolean const marshal_flag = this->read_wstring (cdr, buf); + x.assign (buf); + ACE::strdelete (buf); + return marshal_flag; +} +#endif + // -------------------------------------------------------------- ACE_CDR::Boolean diff --git a/deps/acelite/ace/CDR_Stream.h b/deps/acelite/ace/CDR_Stream.h index 8197b0f4b..4ce2402a5 100644 --- a/deps/acelite/ace/CDR_Stream.h +++ b/deps/acelite/ace/CDR_Stream.h @@ -56,6 +56,7 @@ #include "Monitor_Size.h" #endif /* ACE_HAS_MONITOR_POINTS==1 */ +#include ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -121,7 +122,7 @@ public: /// with the alignment of @a data. /** * Create an output stream from an arbitrary buffer, care must be - * exercised with alignment, because this contructor will align if + * exercised with alignment, because this constructor will align if * needed. In this case @a data will not point to the start of the * output stream. @c begin()->rd_ptr() points to the start of the * output stream. See @c ACE_ptr_align_binary() to properly align a @@ -138,11 +139,11 @@ public: ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION); /// Build a CDR stream with an initial data block, it will *not* remove - /// , since it did not allocated it. It's important to be - // careful with the alignment of . + /// @a data_block, since it did not allocated it. It's important to be + /// careful with the alignment of @a data_block. /** * Create an output stream from an arbitrary data block, care must be - * exercised with alignment, because this contructor will align if + * exercised with alignment, because this constructor will align if * needed. In this case @a data_block will not point to the * start of the output stream. begin()->rd_ptr() points to the start * off the output stream. See ACE_ptr_align_binary() to properly align a @@ -221,6 +222,24 @@ public: ACE_CDR::ULong bound_; ACE_CDR::Boolean nocopy_; }; + + struct ACE_Export from_std_string + { + from_std_string (const std::string &s, + ACE_CDR::ULong b); + const std::string &val_; + ACE_CDR::ULong bound_; + }; + +#if !defined(ACE_LACKS_STD_WSTRING) + struct ACE_Export from_std_wstring + { + from_std_wstring (const std::wstring &ws, + ACE_CDR::ULong b); + const std::wstring &val_; + ACE_CDR::ULong bound_; + }; +#endif //@} /** @@ -250,6 +269,11 @@ public: ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x); ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length, const ACE_CDR::WChar *x); + ACE_CDR::Boolean write_string (const std::string &x); +#if !defined(ACE_LACKS_STD_WSTRING) + ACE_CDR::Boolean write_wstring (const std::wstring &x); +#endif + //@} /// @note the portion written starts at @a x and ends @@ -330,7 +354,7 @@ public: * type to insert. This requirement is satisfied by using one of the * placeholder-writing methods to align the stream for the anticipated * value and obtain the correct location. - * Treatment of @a x with repect to byte swapping is the same as for when + * Treatment of @a x with respect to byte swapping is the same as for when * any value is inserted. * * @param x The value to insert into the specified location. @@ -375,7 +399,7 @@ public: ACE_CDR::Boolean append_string (ACE_InputCDR &); //@} - /// Returns @c false if an error has ocurred. + /// Returns @c false if an error has occurred. /** * @note The only expected error is to run out of memory. */ @@ -500,7 +524,6 @@ public: #endif /* ACE_HAS_MONITOR_POINTS==1 */ private: - // Find the message block in the chain of message blocks // that the provide location locates. ACE_Message_Block* find (char* loc); @@ -645,7 +668,7 @@ public: /** * Create an input stream from an arbitrary buffer. The buffer must - * be properly aligned because this contructor will *not* work if + * be properly aligned because this constructor will *not* work if * the buffer is aligned unproperly.See ACE_ptr_align_binary() for * instructions on how to align a pointer properly and use * ACE_CDR::MAX_ALIGNMENT for the correct alignment. @@ -677,7 +700,7 @@ public: ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION, ACE_Lock* lock = 0); - /// Create an input stream from an ACE_Data_Block. The + /// Create an input stream from an ACE_Data_Block. The @a flag /// indicates whether the @a data can be deleted by the CDR stream /// or not ACE_InputCDR (ACE_Data_Block *data, @@ -733,7 +756,7 @@ public: ACE_InputCDR &rhs_; }; - /// Transfer the contents from to a new CDR + /// Transfer the contents from @a rhs to a new CDR ACE_InputCDR (Transfer_Contents rhs); /// Destructor @@ -794,6 +817,25 @@ public: const ACE_CDR::WChar *&val_; ACE_CDR::ULong bound_; }; + + /// Helper classes for extracting bounded strings into std::string/wstring. + struct ACE_Export to_std_string + { + to_std_string (std::string &s, + ACE_CDR::ULong b); + std::string &val_; + ACE_CDR::ULong bound_; + }; + +#if !defined(ACE_LACKS_STD_WSTRING) + struct ACE_Export to_std_wstring + { + to_std_wstring (std::wstring &ws, + ACE_CDR::ULong b); + std::wstring &val_; + ACE_CDR::ULong bound_; + }; +#endif /* ACE_LACKS_STD_WSTRING */ //@} /** @@ -818,6 +860,10 @@ public: ACE_CDR::Boolean read_string (ACE_CDR::Char *&x); ACE_CDR::Boolean read_string (ACE_CString &x); ACE_CDR::Boolean read_wstring (ACE_CDR::WChar*& x); + ACE_CDR::Boolean read_string (std::string& x); +#if !defined(ACE_LACKS_STD_WSTRING) + ACE_CDR::Boolean read_wstring (std::wstring& x); +#endif //@} /** @@ -1036,7 +1082,6 @@ protected: #endif /* ACE_HAS_MONITOR_POINTS==1 */ private: - ACE_CDR::Boolean read_1 (ACE_CDR::Octet *x); ACE_CDR::Boolean read_2 (ACE_CDR::UShort *x); ACE_CDR::Boolean read_4 (ACE_CDR::ULong *x); @@ -1048,7 +1093,7 @@ private: // We could use void* or char* to make the interface more // consistent, but using native types let us exploit the strict // alignment requirements of CDR streams and implement the - // operations using asignment. + // operations using assignment. /** * Read an array of @a length elements, each of @a size bytes and the @@ -1114,6 +1159,12 @@ public: virtual ACE_CDR::Boolean read_string (ACE_InputCDR&, ACE_CDR::Char *&) = 0; + /// Read a std::string from the stream, including the length, converting + /// the characters from the stream codeset to the native codeset + /// (provide non-optimized default implementation) + virtual ACE_CDR::Boolean read_string (ACE_InputCDR&, + std::string &); + /// Read an array of characters from the stream, converting the /// characters from the stream codeset to the native codeset. virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR&, @@ -1210,6 +1261,13 @@ public: ACE_CDR::WChar&) = 0; virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR&, ACE_CDR::WChar *&) = 0; +#if !defined(ACE_LACKS_STD_WSTRING) + /// Read a std::wstring from the stream, including the length, converting + /// the characters from the stream codeset to the native codeset + /// (provide non-optimized default implementation) + virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR&, + std::wstring &); +#endif virtual ACE_CDR::Boolean read_wchar_array (ACE_InputCDR&, ACE_CDR::WChar*, ACE_CDR::ULong) = 0; @@ -1344,6 +1402,16 @@ extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, const ACE_CDR::Char* x); extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, const ACE_CDR::WChar* x); +extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, + ACE_OutputCDR::from_std_string x); +extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, + const std::string& x); +#if !defined(ACE_LACKS_STD_WSTRING) +extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, + ACE_OutputCDR::from_std_wstring x); +extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, + const std::wstring& x); +#endif // Not used by CORBA or TAO extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, @@ -1389,6 +1457,16 @@ extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, ACE_CDR::Char*& x); extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, ACE_CDR::WChar*& x); +extern ACE_Export ACE_CDR::Boolean operator<< (ACE_InputCDR &os, + ACE_InputCDR::to_std_string x); +extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, + std::string& x); +#if !defined(ACE_LACKS_STD_WSTRING) +extern ACE_Export ACE_CDR::Boolean operator<< (ACE_InputCDR &os, + ACE_InputCDR::to_std_wstring x); +extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, + std::wstring& x); +#endif ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/CDR_Stream.inl b/deps/acelite/ace/CDR_Stream.inl index 0103d2792..fe25108da 100644 --- a/deps/acelite/ace/CDR_Stream.inl +++ b/deps/acelite/ace/CDR_Stream.inl @@ -127,6 +127,40 @@ ACE_InputCDR::to_wstring::to_wstring (const ACE_CDR::WChar *&ws, { } +ACE_INLINE +ACE_InputCDR::to_std_string::to_std_string (std::string &s, + ACE_CDR::ULong b) + : val_ (s), + bound_ (b) +{ +} + +ACE_INLINE +ACE_OutputCDR::from_std_string::from_std_string (const std::string &ws, + ACE_CDR::ULong b) + : val_ (ws), + bound_ (b) +{ +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE +ACE_InputCDR::to_std_wstring::to_std_wstring (std::wstring &s, + ACE_CDR::ULong b) + : val_ (s), + bound_ (b) +{ +} + +ACE_INLINE +ACE_OutputCDR::from_std_wstring::from_std_wstring (const std::wstring &ws, + ACE_CDR::ULong b) + : val_ (ws), + bound_ (b) +{ +} +#endif + ACE_INLINE ACE_InputCDR::Transfer_Contents::Transfer_Contents (ACE_InputCDR &rhs) : rhs_ (rhs) @@ -301,6 +335,26 @@ ACE_OutputCDR::write_wstring (const ACE_CDR::WChar *x) return this->write_wstring (0, 0); } +ACE_INLINE ACE_CDR::Boolean +ACE_OutputCDR::write_string (const std::string &x) +{ + ACE_CDR::ULong const len = + static_cast (x.size ()); + return this->write_string (len, + x.empty () ? 0 : x.c_str ()); +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE ACE_CDR::Boolean +ACE_OutputCDR::write_wstring (const std::wstring &x) +{ + ACE_CDR::ULong const len = + static_cast (x.size ()); + return this->write_wstring (len, + x.empty () ? 0 : x.c_str ()); +} +#endif + ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_char_array (const ACE_CDR::Char *x, ACE_CDR::ULong length) @@ -1220,6 +1274,46 @@ operator<< (ACE_OutputCDR &os, const ACE_CDR::WChar *x) return (ACE_CDR::Boolean) os.good_bit (); } +ACE_INLINE ACE_CDR::Boolean +operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_std_string x) +{ + ACE_CDR::ULong len = + static_cast (x.val_.size ()); + + os.write_string (len, x.val_.c_str ()); + return + (ACE_CDR::Boolean) (os.good_bit () && (!x.bound_ || len <= x.bound_)); +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE ACE_CDR::Boolean +operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_std_wstring x) +{ + ACE_CDR::ULong len = + static_cast (x.val_.size ()); + + os.write_wstring (len, x.val_.c_str ()); + return + (ACE_CDR::Boolean) (os.good_bit () && (!x.bound_ || len <= x.bound_)); +} +#endif + +ACE_INLINE ACE_CDR::Boolean +operator<< (ACE_OutputCDR &os, const std::string& x) +{ + os.write_string (x); + return (ACE_CDR::Boolean) os.good_bit (); +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE ACE_CDR::Boolean +operator<< (ACE_OutputCDR &os, const std::wstring& x) +{ + os.write_wstring (x); + return (ACE_CDR::Boolean) os.good_bit (); +} +#endif + // The following use the helper classes ACE_INLINE ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_boolean x) @@ -1359,6 +1453,20 @@ operator>> (ACE_InputCDR &is, ACE_CDR::WChar *&x) return is.read_wstring (x) && is.good_bit (); } +ACE_INLINE ACE_CDR::Boolean +operator>> (ACE_InputCDR &is, std::string& x) +{ + return is.read_string (x) && is.good_bit (); +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE ACE_CDR::Boolean +operator>> (ACE_InputCDR &is, std::wstring& x) +{ + return is.read_wstring (x) && is.good_bit (); +} +#endif + // The following use the helper classes ACE_INLINE ACE_CDR::Boolean operator>> (ACE_InputCDR &is, ACE_InputCDR::to_boolean x) @@ -1406,6 +1514,29 @@ operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wstring x) || ACE_OS::strlen (x.val_) <= x.bound_)); } +ACE_INLINE ACE_CDR::Boolean +operator>> (ACE_InputCDR &is, ACE_InputCDR::to_std_string x) +{ + // check if the bounds are satisfied + return + (is.read_string (x.val_) + && is.good_bit () + && (!x.bound_ + || static_cast (x.val_.size ()) <= x.bound_)); +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE ACE_CDR::Boolean +operator>> (ACE_InputCDR &is, ACE_InputCDR::to_std_wstring x) +{ + // check if the bounds are satisfied + return + (is.read_wstring (x.val_) + && is.good_bit () + && (!x.bound_ + || static_cast (x.val_.size ()) <= x.bound_)); +} +#endif // *************************************************************************** // We must define these methods here because they use the "read_*" inlined // methods of the ACE_InputCDR class @@ -1515,7 +1646,11 @@ ACE_OutputCDR::append_string (ACE_InputCDR &stream) ACE_CDR::Char *x = 0; ACE_CDR::Boolean const flag = (stream.read_string (x) ? this->write_string (x) : false); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(x); +#else delete [] x; +#endif /* ACE_HAS_ALLOC_HOOKS */ return flag; } @@ -1525,7 +1660,11 @@ ACE_OutputCDR::append_wstring (ACE_InputCDR &stream) ACE_CDR::WChar *x = 0; ACE_CDR::Boolean const flag = (stream.read_wstring (x) ? this->write_wstring (x) : false); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(x); +#else delete [] x; +#endif /* ACE_HAS_ALLOC_HOOKS */ return flag; } diff --git a/deps/acelite/ace/CE_Screen_Output.h b/deps/acelite/ace/CE_Screen_Output.h index 65c697daa..f2497487d 100644 --- a/deps/acelite/ace/CE_Screen_Output.h +++ b/deps/acelite/ace/CE_Screen_Output.h @@ -46,7 +46,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_CE_Screen_Output : public ACE_Log_Msg_Callback { public: - ACE_CE_Screen_Output (HWND hEdit); ACE_CE_Screen_Output (void); @@ -89,11 +88,9 @@ public: ACE_CE_Screen_Output& operator << (FILE* pFile); private: - ACE_CE_Screen_Output (ACE_CE_Screen_Output&); private: - HWND handler_; /// FILE pointer that used to save output to file. This class does diff --git a/deps/acelite/ace/CMakeLists.txt b/deps/acelite/ace/CMakeLists.txt deleted file mode 100644 index e795a2f67..000000000 --- a/deps/acelite/ace/CMakeLists.txt +++ /dev/null @@ -1,360 +0,0 @@ -# Copyright (C) -# -# This file is free software; as a special exception the author 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. - -# NOTE: Do not use glob here, it would include files we don't want -set(ace_STAT_SRCS - ACE.cpp - ACE_crc32.cpp - ACE_crc_ccitt.cpp - ace_wchar.cpp - Activation_Queue.cpp - Active_Map_Manager.cpp - Addr.cpp - Argv_Type_Converter.cpp - Assert.cpp - Asynch_IO.cpp - Asynch_IO_Impl.cpp - Asynch_Pseudo_Task.cpp - ATM_Acceptor.cpp - ATM_Addr.cpp - ATM_Connector.cpp - ATM_Params.cpp - ATM_QoS.cpp - ATM_Stream.cpp - Atomic_Op.cpp - Atomic_Op_Sparc.c - Auto_Event.cpp - Barrier.cpp - Base_Thread_Adapter.cpp - Based_Pointer_Repository.cpp - Basic_Stats.cpp - Basic_Types.cpp - Capabilities.cpp - CDR_Base.cpp - CDR_Size.cpp - CDR_Stream.cpp - Cleanup.cpp - Codecs.cpp - Codeset_IBM1047.cpp - Codeset_Registry.cpp - Codeset_Registry_db.cpp - Condition_Attributes.cpp - Condition_Recursive_Thread_Mutex.cpp - Condition_Thread_Mutex.cpp - Configuration.cpp - Configuration_Import_Export.cpp - Connection_Recycling_Strategy.cpp - Containers.cpp - Copy_Disabled.cpp - Date_Time.cpp - DEV.cpp - DEV_Addr.cpp - DEV_Connector.cpp - DEV_IO.cpp - Dev_Poll_Reactor.cpp - Dirent.cpp - Dirent_Selector.cpp - DLL.cpp - DLL_Manager.cpp - Dump.cpp - Dynamic.cpp - Dynamic_Message_Strategy.cpp - Dynamic_Service_Base.cpp - Dynamic_Service_Dependency.cpp - Encoding_Converter.cpp - Encoding_Converter_Factory.cpp - Event.cpp - Event_Handler.cpp - Event_Handler_Handle_Timeout_Upcall.cpp - Event_Base.cpp - FIFO.cpp - FIFO_Recv.cpp - FIFO_Recv_Msg.cpp - FIFO_Send.cpp - FIFO_Send_Msg.cpp - FILE.cpp - FILE_Addr.cpp - FILE_Connector.cpp - FILE_IO.cpp - File_Lock.cpp - Filecache.cpp - Flag_Manip.cpp - Framework_Component.cpp - Functor.cpp - Functor_String.cpp - Get_Opt.cpp - Handle_Ops.cpp - Handle_Set.cpp - Hashable.cpp - High_Res_Timer.cpp - ICMP_Socket.cpp - INET_Addr.cpp - Init_ACE.cpp - IO_Cntl_Msg.cpp - IO_SAP.cpp - IOStream.cpp - IPC_SAP.cpp - Lib_Find.cpp - Local_Memory_Pool.cpp - Local_Name_Space.cpp - Local_Tokens.cpp - Lock.cpp - Log_Category.cpp - Log_Msg.cpp - Log_Msg_Backend.cpp - Log_Msg_Callback.cpp - Log_Msg_IPC.cpp - Log_Msg_NT_Event_Log.cpp - Log_Msg_UNIX_Syslog.cpp - Log_Record.cpp - Logging_Strategy.cpp - LSOCK.cpp - LSOCK_Acceptor.cpp - LSOCK_CODgram.cpp - LSOCK_Connector.cpp - LSOCK_Dgram.cpp - LSOCK_Stream.cpp - Malloc.cpp - Malloc_Allocator.cpp - Manual_Event.cpp - MEM_Acceptor.cpp - MEM_Addr.cpp - MEM_Connector.cpp - MEM_IO.cpp - Mem_Map.cpp - MEM_SAP.cpp - MEM_Stream.cpp - Message_Block.cpp - Message_Queue.cpp - Message_Queue_NT.cpp - Message_Queue_Vx.cpp - Method_Request.cpp - MMAP_Memory_Pool.cpp - Monitor_Admin.cpp - Monitor_Admin_Manager.cpp - Monitor_Base.cpp - Monitor_Control_Action.cpp - Monitor_Control_Types.cpp - Monitor_Point_Registry.cpp - Monitor_Size.cpp - Msg_WFMO_Reactor.cpp - Multihomed_INET_Addr.cpp - Mutex.cpp - Name_Proxy.cpp - Name_Request_Reply.cpp - Name_Space.cpp - Naming_Context.cpp - Netlink_Addr.cpp - Notification_Queue.cpp - Notification_Strategy.cpp - NT_Service.cpp - Obchunk.cpp - Object_Manager.cpp - Object_Manager_Base.cpp - Obstack.cpp - OS_Errno.cpp - OS_Log_Msg_Attributes.cpp - OS_main.cpp - OS_NS_arpa_inet.cpp - OS_NS_ctype.cpp - OS_NS_dirent.cpp - OS_NS_dlfcn.cpp - OS_NS_errno.cpp - OS_NS_fcntl.cpp - OS_NS_math.cpp - OS_NS_netdb.cpp - OS_NS_poll.cpp - OS_NS_pwd.cpp - OS_NS_regex.cpp - OS_NS_signal.cpp - OS_NS_stdio.cpp - OS_NS_stdlib.cpp - OS_NS_string.cpp - OS_NS_strings.cpp - OS_NS_stropts.cpp - OS_NS_sys_mman.cpp - OS_NS_sys_msg.cpp - OS_NS_sys_resource.cpp - OS_NS_sys_select.cpp - OS_NS_sys_sendfile.cpp - OS_NS_sys_shm.cpp - OS_NS_sys_socket.cpp - OS_NS_sys_stat.cpp - OS_NS_sys_time.cpp - OS_NS_sys_uio.cpp - OS_NS_sys_utsname.cpp - OS_NS_sys_wait.cpp - OS_NS_Thread.cpp - OS_NS_time.cpp - OS_NS_unistd.cpp - OS_NS_wchar.cpp - OS_QoS.cpp - OS_Thread_Adapter.cpp - OS_TLI.cpp - Pagefile_Memory_Pool.cpp - Parse_Node.cpp - PI_Malloc.cpp - Ping_Socket.cpp - Pipe.cpp - POSIX_Asynch_IO.cpp - POSIX_CB_Proactor.cpp - POSIX_Proactor.cpp - Priority_Reactor.cpp - Proactor.cpp - Proactor_Impl.cpp - Process.cpp - Process_Manager.cpp - Process_Mutex.cpp - Process_Semaphore.cpp - Profile_Timer.cpp - Reactor.cpp - Reactor_Impl.cpp - Reactor_Notification_Strategy.cpp - Reactor_Timer_Interface.cpp - Read_Buffer.cpp - Recursive_Thread_Mutex.cpp - Recyclable.cpp - Registry.cpp - Registry_Name_Space.cpp - Remote_Name_Space.cpp - Remote_Tokens.cpp - Rtems_init.c - RW_Mutex.cpp - RW_Process_Mutex.cpp - RW_Thread_Mutex.cpp - Sample_History.cpp - Sbrk_Memory_Pool.cpp - Sched_Params.cpp - Select_Reactor_Base.cpp - Semaphore.cpp - Service_Config.cpp - Service_Gestalt.cpp - Service_Manager.cpp - Service_Object.cpp - Service_Repository.cpp - Service_Types.cpp - Shared_Memory.cpp - Shared_Memory_MM.cpp - Shared_Memory_Pool.cpp - Shared_Memory_SV.cpp - Shared_Object.cpp - Sig_Adapter.cpp - Sig_Handler.cpp - Signal.cpp - SOCK.cpp - SOCK_Acceptor.cpp - SOCK_CODgram.cpp - Sock_Connect.cpp - SOCK_Connector.cpp - SOCK_Dgram.cpp - SOCK_Dgram_Bcast.cpp - SOCK_Dgram_Mcast.cpp - SOCK_IO.cpp - SOCK_Netlink.cpp - SOCK_SEQPACK_Acceptor.cpp - SOCK_SEQPACK_Association.cpp - SOCK_SEQPACK_Connector.cpp - SOCK_Stream.cpp - SPIPE.cpp - SPIPE_Acceptor.cpp - SPIPE_Addr.cpp - SPIPE_Connector.cpp - SPIPE_Stream.cpp - SString.cpp - Stack_Trace.cpp - Stats.cpp - String_Base_Const.cpp - SUN_Proactor.cpp - SV_Message.cpp - SV_Message_Queue.cpp - SV_Semaphore_Complex.cpp - SV_Semaphore_Simple.cpp - SV_Shared_Memory.cpp - Svc_Conf_Lexer.cpp - Svc_Conf_y.cpp - Synch_Options.cpp - System_Time.cpp - Task.cpp - Thread.cpp - Thread_Adapter.cpp - Thread_Control.cpp - Thread_Exit.cpp - Thread_Hook.cpp - Thread_Manager.cpp - Thread_Mutex.cpp - Thread_Semaphore.cpp - Throughput_Stats.cpp - Time_Policy.cpp - Time_Value.cpp - Timeprobe.cpp - TLI.cpp - TLI_Acceptor.cpp - TLI_Connector.cpp - TLI_Stream.cpp - Token.cpp - Token_Collection.cpp - Token_Invariants.cpp - Token_Manager.cpp - Token_Request_Reply.cpp - TP_Reactor.cpp - Trace.cpp - TSS_Adapter.cpp - TTY_IO.cpp - UNIX_Addr.cpp - UPIPE_Acceptor.cpp - UPIPE_Connector.cpp - UPIPE_Stream.cpp - UTF16_Encoding_Converter.cpp - UTF32_Encoding_Converter.cpp - UTF8_Encoding_Converter.cpp - UUID.cpp - WFMO_Reactor.cpp - WIN32_Asynch_IO.cpp - WIN32_Proactor.cpp - XML_Svc_Conf.cpp - XTI_ATM_Mcast.cpp -) - -if (USE_COREPCH) - set(PRIVATE_PCH_HEADER PrecompiledHeaders/WinAcePCH.h) -endif() - -# Group sources -GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) - -add_library(ace SHARED - ${ace_STAT_SRCS} -) - -target_include_directories(ace - PUBLIC - ${CMAKE_SOURCE_DIR}/deps/acelite - PRIVATE - ${CMAKE_SOURCE_DIR}/deps/zlib) - -# Needed for PCH support -set_source_files_properties(Atomic_Op_Sparc.c Rtems_init.c PROPERTIES LANGUAGE CXX) - -add_definitions(-DACE_BUILD_DLL) - -if (MINGW) # GCC ignores "#prama comment" - target_link_libraries(ace ws2_32 iphlpapi netapi32 mswsock) -endif() - -target_link_libraries(ace - PRIVATE - acore-dependency-interface) - -# Generate precompiled header -if(USE_COREPCH) - add_cxx_pch(ace ${PRIVATE_PCH_HEADER}) -endif() - -install(TARGETS ace RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}") diff --git a/deps/acelite/ace/Cache_Map_Manager_T.cpp b/deps/acelite/ace/Cache_Map_Manager_T.cpp index c6a6d9d39..b92876a7f 100644 --- a/deps/acelite/ace/Cache_Map_Manager_T.cpp +++ b/deps/acelite/ace/Cache_Map_Manager_T.cpp @@ -16,11 +16,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Manager) - -ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Iterator) - -ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Reverse_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tc7(ACE_Cache_Map_Manager) +ACE_ALLOC_HOOK_DEFINE_Tc5(ACE_Cache_Map_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tc5(ACE_Cache_Map_Reverse_Iterator) template ACE_Cache_Map_Manager::ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_s, diff --git a/deps/acelite/ace/Cache_Map_Manager_T.h b/deps/acelite/ace/Cache_Map_Manager_T.h index 3e1d90a08..da181cb0e 100644 --- a/deps/acelite/ace/Cache_Map_Manager_T.h +++ b/deps/acelite/ace/Cache_Map_Manager_T.h @@ -59,7 +59,6 @@ template CACHE_VALUE; - // = Initialization and termination methods. - /// Initialize a with and /// @a size entries. ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_strategy, @@ -217,6 +214,9 @@ public: /// The caching strategy used on the cache. CACHING_STRATEGY &caching_strategy (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /// The underlying map which needs to be cached. @@ -226,11 +226,9 @@ protected: CACHING_STRATEGY &caching_strategy_; private: - // = Disallow these operations. ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Cache_Map_Manager &)) ACE_UNIMPLEMENTED_FUNC (ACE_Cache_Map_Manager (const ACE_Cache_Map_Manager &)) - }; /** @@ -244,9 +242,7 @@ private: template class ACE_Cache_Map_Iterator { - public: - // = Traits. /// The actual value mapped to the key in the cache. The /// are used by the strategy and is transparent to the cache user. @@ -322,7 +318,6 @@ template /// are used by the strategy and is transparent to the cache user. diff --git a/deps/acelite/ace/Cached_Connect_Strategy_T.cpp b/deps/acelite/ace/Cached_Connect_Strategy_T.cpp index 7af662606..7987655b4 100644 --- a/deps/acelite/ace/Cached_Connect_Strategy_T.cpp +++ b/deps/acelite/ace/Cached_Connect_Strategy_T.cpp @@ -15,6 +15,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tcoccc (ACE_Cached_Connect_Strategy_Ex) +ACE_ALLOC_HOOK_DEFINE_Tcoccc (ACE_Bounded_Cached_Connect_Strategy) + template ACE_Cached_Connect_Strategy_Ex::ACE_Cached_Connect_Strategy_Ex (CACHING_STRATEGY &caching_s, @@ -152,12 +155,12 @@ ACE_Cached_Connect_Strategy_Exint_id_.first; // Is the connection clean? - int state_result = + int const state_result = ACE::handle_ready (sh->peer ().get_handle (), &ACE_Time_Value::zero, - 1, // read ready - 0, // write ready - 1);// exception ready + true, // read ready + false, // write ready + true);// exception ready if (state_result == 1) { @@ -555,7 +558,6 @@ ACE_Cached_Connect_Strategy_Ex @@ -605,9 +607,9 @@ ACE_Bounded_Cached_Connect_Strategypeer ().get_handle (), &ACE_Time_Value::zero, - 1, // read ready - 0, // write ready - 1);// exception ready + true, // read ready + false, // write ready + true);// exception ready if (state_result == 1) { @@ -721,8 +723,6 @@ ACE_Bounded_Cached_Connect_Strategy &search_addr, ACE_Hash_Map_Entry, std::pair > *&entry); @@ -203,7 +205,6 @@ template { - typedef ACE_Cached_Connect_Strategy_Ex CCSEBASE; @@ -212,7 +213,6 @@ class ACE_Bounded_Cached_Connect_Strategy REFCOUNTED_HASH_RECYCLABLE_ADDRESS; public: - /// Constructor ACE_Bounded_Cached_Connect_Strategy (size_t max_size, CACHING_STRATEGY &caching_s, @@ -222,14 +222,13 @@ public: MUTEX *lock = 0, int delete_lock = 0); - /// Destructor - virtual ~ACE_Bounded_Cached_Connect_Strategy (void); + /// Destructor + virtual ~ACE_Bounded_Cached_Connect_Strategy (void); - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; protected: - virtual int find_or_create_svc_handler_i (SVC_HANDLER *&sh, const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, @@ -242,7 +241,6 @@ protected: int &found); protected: - /// Max items in the cache, used as a bound for the creation of svc_handlers. size_t max_size_; }; diff --git a/deps/acelite/ace/Caching_Strategies_T.cpp b/deps/acelite/ace/Caching_Strategies_T.cpp index 9db1902e7..0cc25407a 100644 --- a/deps/acelite/ace/Caching_Strategies_T.cpp +++ b/deps/acelite/ace/Caching_Strategies_T.cpp @@ -47,10 +47,11 @@ ACE_FIFO_Caching_Strategy::ACE_FIFO_Caching_Strateg //////////////////////////////////////////////////////////////////////////////////////////////// -ACE_ALLOC_HOOK_DEFINE(ACE_LRU_Caching_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_LFU_Caching_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Caching_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Null_Caching_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tccc(ACE_Caching_Strategy_Adapter) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_LRU_Caching_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_LFU_Caching_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_FIFO_Caching_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Null_Caching_Strategy) ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Caching_Strategies_T.h b/deps/acelite/ace/Caching_Strategies_T.h index 864b7c21d..243d10c6a 100644 --- a/deps/acelite/ace/Caching_Strategies_T.h +++ b/deps/acelite/ace/Caching_Strategies_T.h @@ -107,9 +107,7 @@ template class ACE_Caching_Strategy_Adapter : public ACE_Caching_Strategy { - public: - /// Constructor. ACE_Caching_Strategy_Adapter (IMPLEMENTATION *implementation = 0, bool delete_implementation = false); @@ -162,8 +160,10 @@ public: /// Dumps the state of the object. void dump (void) const; -private: + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; +private: /// Implementation class. IMPLEMENTATION *implementation_; @@ -197,7 +197,6 @@ template class ACE_LRU_Caching_Strategy { public: - // Traits. typedef ATTRIBUTES CACHING_ATTRIBUTES; @@ -257,8 +256,10 @@ public: /// Dumps the state of the object. void dump (void) const; -private: + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; +private: /// This element is the one which is the deciding factor for purging /// of an ITEM. ATTRIBUTES timer_; @@ -296,9 +297,7 @@ private: template class ACE_LFU_Caching_Strategy { - public: - // Traits. typedef ATTRIBUTES CACHING_ATTRIBUTES; @@ -356,8 +355,10 @@ public: /// Dumps the state of the object. void dump (void) const; -private: + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; +private: /// The level about which the purging will happen automagically. double purge_percent_; @@ -389,9 +390,7 @@ private: template class ACE_FIFO_Caching_Strategy { - public: - typedef ATTRIBUTES CACHING_ATTRIBUTES; // = Initialisation and termination. @@ -447,8 +446,10 @@ public: /// Dumps the state of the object. void dump (void) const; -private: + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; +private: /// The order is the deciding factor for the item to be removed from /// the cache. ATTRIBUTES order_; @@ -476,9 +477,7 @@ private: template class ACE_Null_Caching_Strategy { - public: - // = Traits. typedef ATTRIBUTES CACHING_ATTRIBUTES; @@ -524,8 +523,10 @@ public: /// Dumps the state of the object. void dump (void) const; -private: + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; +private: /// This is the helper class which will decide and expunge entries /// from the cache. CACHING_UTILITY caching_utility_; diff --git a/deps/acelite/ace/Caching_Utility_T.h b/deps/acelite/ace/Caching_Utility_T.h index bdeb165fb..ac046b974 100644 --- a/deps/acelite/ace/Caching_Utility_T.h +++ b/deps/acelite/ace/Caching_Utility_T.h @@ -43,7 +43,6 @@ template CLEANUP_STRATEGY; /// Constructor. @@ -91,9 +90,7 @@ protected: template class ACE_Recyclable_Handler_Caching_Utility : private ACE_Copy_Disabled { - public: - typedef ACE_Recyclable_Handler_Cleanup_Strategy CLEANUP_STRATEGY; typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; @@ -202,7 +199,6 @@ template CLEANUP_STRATEGY; typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; @@ -257,7 +253,6 @@ template CLEANUP_STRATEGY; typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; diff --git a/deps/acelite/ace/Capabilities.cpp b/deps/acelite/ace/Capabilities.cpp index b6b9bd0f6..9ffceda2a 100644 --- a/deps/acelite/ace/Capabilities.cpp +++ b/deps/acelite/ace/Capabilities.cpp @@ -283,7 +283,6 @@ ACE_Capabilities::getval (const ACE_TCHAR *keyname, int &val) return 0; } -#if !defined (ACE_IS_SPLITTING) static int is_empty (const ACE_TCHAR *line) { @@ -301,7 +300,6 @@ is_line (const ACE_TCHAR *line) return *line != ACE_TEXT ('\0'); } -#endif /* !ACE_IS_SPLITTING */ int ACE_Capabilities::getent (const ACE_TCHAR *fname, const ACE_TCHAR *name) @@ -347,4 +345,8 @@ ACE_Capabilities::getent (const ACE_TCHAR *fname, const ACE_TCHAR *name) return -1; } +ACE_ALLOC_HOOK_DEFINE(ACE_StringCapEntry) +ACE_ALLOC_HOOK_DEFINE(ACE_IntCapEntry) +ACE_ALLOC_HOOK_DEFINE(ACE_BoolCapEntry) + ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Capabilities.h b/deps/acelite/ace/Capabilities.h index 16776ed44..e43ace9d2 100644 --- a/deps/acelite/ace/Capabilities.h +++ b/deps/acelite/ace/Capabilities.h @@ -25,11 +25,6 @@ #include "ace/SString.h" #include "ace/Functor_String.h" -#if defined (ACE_IS_SPLITTING) -# include "ace/OS_NS_ctype.h" -#endif /* ACE_IS_SPLITTING */ - - ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -45,11 +40,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_CapEntry { public: - virtual ~ACE_CapEntry (void); protected: - enum { ACE_INTCAP = 0, @@ -60,9 +53,7 @@ protected: ACE_CapEntry (int captype); protected: - int captype_; - }; /** @@ -78,6 +69,7 @@ class ACE_Export ACE_IntCapEntry : public ACE_CapEntry public: ACE_IntCapEntry (int val); int getval (void) const; + ACE_ALLOC_HOOK_DECLARE; protected: int val_; @@ -96,6 +88,7 @@ class ACE_Export ACE_StringCapEntry : public ACE_CapEntry public: ACE_StringCapEntry (const ACE_TString &val); ACE_TString getval (void) const; + ACE_ALLOC_HOOK_DECLARE; protected: ACE_TString val_; @@ -114,6 +107,7 @@ class ACE_Export ACE_BoolCapEntry : public ACE_CapEntry public: ACE_BoolCapEntry (int val); int getval (void) const; + ACE_ALLOC_HOOK_DECLARE; protected: int val_; @@ -138,7 +132,6 @@ protected: class ACE_Export ACE_Capabilities { public: - typedef ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> CAPABILITIES_MAP; /// The Constructor @@ -148,7 +141,6 @@ public: ~ACE_Capabilities(void); public: - /// Get a string entry. int getval (const ACE_TCHAR *ent, ACE_TString &val); @@ -160,7 +152,6 @@ public: int getent (const ACE_TCHAR *fname, const ACE_TCHAR *name); protected: - /// Parse an integer property const ACE_TCHAR *parse (const ACE_TCHAR *buf, int &cap); @@ -184,31 +175,10 @@ protected: void resetcaps (void); private: - /// This is the set of ACE_CapEntry. CAPABILITIES_MAP caps_; }; -#if defined (ACE_IS_SPLITTING) -int -is_empty (const ACE_TCHAR *line) -{ - while (*line && ACE_OS::ace_isspace (*line)) - ++line; - - return *line == ACE_TEXT ('\0') || *line == ACE_TEXT ('#'); -} - -int -is_line (const ACE_TCHAR *line) -{ - while (*line && ACE_OS::ace_isspace (*line)) - ++line; - - return *line != ACE_TEXT ('\0'); -} -#endif /* ACE_IS_SPLITTING */ - ACE_END_VERSIONED_NAMESPACE_DECL #if defined (__ACE_INLINE__) diff --git a/deps/acelite/ace/Cleanup.cpp b/deps/acelite/ace/Cleanup.cpp index d83022c85..0e162c8cf 100644 --- a/deps/acelite/ace/Cleanup.cpp +++ b/deps/acelite/ace/Cleanup.cpp @@ -8,6 +8,10 @@ #include "ace/OS_NS_string.h" #include "ace/os_include/os_typeinfo.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL void @@ -52,9 +56,15 @@ ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (void *object, ACE_Cleanup_Info_Node::~ACE_Cleanup_Info_Node (void) { if (this->name_) +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free ((void *) name_); +#else ACE_OS::free ((void *) name_); +#endif /* ACE_HAS_ALLOC_HOOKS */ } +ACE_ALLOC_HOOK_DEFINE(ACE_Cleanup_Info_Node) + bool ACE_Cleanup_Info_Node::operator== (const ACE_Cleanup_Info_Node &o) const { diff --git a/deps/acelite/ace/Cleanup.h b/deps/acelite/ace/Cleanup.h index 33d944630..86044c85c 100644 --- a/deps/acelite/ace/Cleanup.h +++ b/deps/acelite/ace/Cleanup.h @@ -4,7 +4,7 @@ /** * @file Cleanup.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt * @author Jesper S. M|ller * @author and a cast of thousands... * @@ -87,6 +87,9 @@ public: ACE_CLEANUP_FUNC cleanup_hook (void); void *param (void); + + ACE_ALLOC_HOOK_DECLARE; + private: /// Point to object that gets passed into the . void *object_; diff --git a/deps/acelite/ace/Cleanup_Strategies_T.h b/deps/acelite/ace/Cleanup_Strategies_T.h index 96900418a..c90dd5c5a 100644 --- a/deps/acelite/ace/Cleanup_Strategies_T.h +++ b/deps/acelite/ace/Cleanup_Strategies_T.h @@ -8,7 +8,6 @@ */ //============================================================================= - #ifndef CLEANUP_STRATEGIES_H #define CLEANUP_STRATEGIES_H #include /**/ "ace/pre.h" @@ -36,9 +35,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL template class ACE_Cleanup_Strategy { - public: - /// Destructor. virtual ~ACE_Cleanup_Strategy (void); @@ -63,9 +60,7 @@ public: template class ACE_Recyclable_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy { - public: - /// The method which will do the cleanup of the entry in the container. virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); }; diff --git a/deps/acelite/ace/Codecs.cpp b/deps/acelite/ace/Codecs.cpp index eafc05973..7b22f2735 100644 --- a/deps/acelite/ace/Codecs.cpp +++ b/deps/acelite/ace/Codecs.cpp @@ -3,6 +3,10 @@ #include "ace/OS_Memory.h" #include "ace/OS_NS_ctype.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + namespace { // Just in case ... @@ -47,7 +51,11 @@ ACE_Base64::encode (const ACE_Byte* input, size_t length = ((input_len + 2) / 3) * 4; size_t num_lines = length / max_columns + 1; length += num_lines + 1; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (result, static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_Byte) * length)), 0); +#else ACE_NEW_RETURN (result, ACE_Byte[length], 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ int char_count = 0; int bits = 0; @@ -135,7 +143,12 @@ ACE_Base64::decode (const ACE_Byte* input, size_t* output_len) size_t result_len = ACE_Base64::length (input); ACE_Byte* result = 0; + +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (result, static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_Byte) * result_len)), 0); +#else ACE_NEW_RETURN (result, ACE_Byte[result_len], 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_Byte* ptr = const_cast (input); while (*ptr != 0 && @@ -204,7 +217,11 @@ ACE_Base64::decode (const ACE_Byte* input, size_t* output_len) if (errors) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(result); +#else delete[] result; +#endif /* ACE_HAS_ALLOC_HOOKS */ return 0; } result[pos] = 0; diff --git a/deps/acelite/ace/Codecs.h b/deps/acelite/ace/Codecs.h index 1f0ee3a9a..6440e7dad 100644 --- a/deps/acelite/ace/Codecs.h +++ b/deps/acelite/ace/Codecs.h @@ -27,7 +27,6 @@ #include "ace/Basic_Types.h" #include "ace/Global_Macros.h" - ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -42,7 +41,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Base64 { public: - //@{ /** @@ -55,7 +53,6 @@ public: * @return Encoded Base64 data in byte stream or NULL if input data cannot * be encoded. */ - static ACE_Byte* encode (const ACE_Byte* input, const size_t input_len, size_t* output_len, @@ -83,12 +80,10 @@ public: //@} protected: - // Prevent default construction. ACE_Base64 (void) {} private: - // Preventing copying and assignment. ACE_Base64 (ACE_Base64 const &); ACE_Base64 & operator= (ACE_Base64 const &); @@ -97,7 +92,6 @@ private: static void init (void); private: - /// Alphabet used for decoding i.e decoder_[alphabet_[i = 0..63]] = i static ACE_Byte decoder_[]; @@ -107,7 +101,6 @@ private: /// Boolean to denote whether initialization is complete static bool init_; - }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Codeset_IBM1047.cpp b/deps/acelite/ace/Codeset_IBM1047.cpp index ba8d1eb9c..edfd2bab4 100644 --- a/deps/acelite/ace/Codeset_IBM1047.cpp +++ b/deps/acelite/ace/Codeset_IBM1047.cpp @@ -119,6 +119,42 @@ ACE_IBM1047_ISO8859::read_string (ACE_InputCDR& in, return 0; } +ACE_CDR::Boolean +ACE_IBM1047_ISO8859::read_string (ACE_InputCDR& in, + std::string & x) +{ +#if defined (ACE_HAS_CPP11) + ACE_CDR::ULong len; + + in.read_ulong (len); + + if (len > 0) + { + try + { + x.resize (len); + } + catch (const std::bad_alloc&) + { + return false; + } + + if (this->read_char_array (in, &x[0], len)) + { + x.resize (len-1); // drop terminating '\0' read from stream + return true; + } + + delete [] x; + } + + x.clear (); + return false; +#else + return this->ACE_Char_Codeset_Translator::read_string (in, x); +#endif +} + ACE_CDR::Boolean ACE_IBM1047_ISO8859::read_char_array (ACE_InputCDR& in, ACE_CDR::Char* x, @@ -236,6 +272,42 @@ ACE_ISO8859_IBM1047::read_string (ACE_InputCDR &in, return 0; } +ACE_CDR::Boolean +ACE_ISO8859_IBM1047::read_string (ACE_InputCDR& in, + std::string & x) +{ +#if defined (ACE_HAS_CPP11) + ACE_CDR::ULong len; + + in.read_ulong (len); + + if (len > 0) + { + try + { + x.resize (len); + } + catch (const std::bad_alloc&) + { + return false; + } + + if (this->read_char_array (in, &x[0], len)) + { + x.resize (len-1); // drop terminating '\0' read from stream + return true; + } + + delete [] x; + } + + x.clear (); + return false; +#else + return this->ACE_Char_Codeset_Translator::read_string (in, x); +#endif +} + ACE_CDR::Boolean ACE_ISO8859_IBM1047::read_char_array (ACE_InputCDR &in, ACE_CDR::Char *x, diff --git a/deps/acelite/ace/Codeset_IBM1047.h b/deps/acelite/ace/Codeset_IBM1047.h index d04b5997b..d9d84aa40 100644 --- a/deps/acelite/ace/Codeset_IBM1047.h +++ b/deps/acelite/ace/Codeset_IBM1047.h @@ -53,6 +53,8 @@ public: ACE_CDR::Char &); virtual ACE_CDR::Boolean read_string (ACE_InputCDR &, ACE_CDR::Char *&); + virtual ACE_CDR::Boolean read_string (ACE_InputCDR &, + std::string &); virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR &, ACE_CDR::Char *, ACE_CDR::ULong); @@ -96,6 +98,8 @@ public: ACE_CDR::Char &); virtual ACE_CDR::Boolean read_string (ACE_InputCDR &, ACE_CDR::Char *&); + virtual ACE_CDR::Boolean read_string (ACE_InputCDR &, + std::string &); virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR &, ACE_CDR::Char *, ACE_CDR::ULong); diff --git a/deps/acelite/ace/Codeset_Registry.cpp b/deps/acelite/ace/Codeset_Registry.cpp index 3a0610741..7ae55118d 100644 --- a/deps/acelite/ace/Codeset_Registry.cpp +++ b/deps/acelite/ace/Codeset_Registry.cpp @@ -35,7 +35,11 @@ ACE_Codeset_Registry::locale_to_registry_i (const ACE_CString &locale, *num_sets = element->num_sets_; if (char_sets != 0) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (*char_sets,static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::UShort) * (element->num_sets_))),0); +#else ACE_NEW_RETURN (*char_sets,ACE_CDR::UShort[element->num_sets_],0); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_OS::memcpy (*char_sets, element->char_sets_, element->num_sets_ * sizeof (ACE_CDR::UShort)); } @@ -59,7 +63,11 @@ ACE_Codeset_Registry::registry_to_locale_i (ACE_CDR::ULong codeset_id, *num_sets = element->num_sets_; if (char_sets != 0) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (*char_sets,static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::UShort) * (element->num_sets_))),0); +#else ACE_NEW_RETURN (*char_sets,ACE_CDR::UShort[element->num_sets_],0); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_OS::memcpy (*char_sets, element->char_sets_, element->num_sets_ * sizeof (ACE_CDR::UShort)); } diff --git a/deps/acelite/ace/Codeset_Registry.h b/deps/acelite/ace/Codeset_Registry.h index 86599663f..8fc9944c8 100644 --- a/deps/acelite/ace/Codeset_Registry.h +++ b/deps/acelite/ace/Codeset_Registry.h @@ -36,7 +36,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Codeset_Registry { public: - /// Based on a locale string, find the registry value and optional codeset /// collection. This wraps the dce_cs_loc_to_rgy function, or emulates it. static int locale_to_registry (const ACE_CString &locale, diff --git a/deps/acelite/ace/Compression/ACE_Compression.mpc b/deps/acelite/ace/Compression/ACE_Compression.mpc deleted file mode 100644 index e9bd69aec..000000000 --- a/deps/acelite/ace/Compression/ACE_Compression.mpc +++ /dev/null @@ -1,24 +0,0 @@ -// -*- MPC -*- -project(ACE_Compression) : acelib, install, ace_output { - sharedname = * - dynamicflags += ACE_COMPRESSION_BUILD_DLL - - //prebuild = perl $(ACE_ROOT)/bin/generate_export_file.pl ACE_Compression > ACE_Compression_export.h - - Source_Files { - Compressor.cpp - } - - Header_Files { - Compressor.h - ACE_Compression_export.h - } - - Inline_Files { - Compressor.inl - } - - specific { - install_dir = ace/Compression - } -} diff --git a/deps/acelite/ace/Compression/ACE_Compression_export.h b/deps/acelite/ace/Compression/ACE_Compression_export.h deleted file mode 100644 index 2b07d8e27..000000000 --- a/deps/acelite/ace/Compression/ACE_Compression_export.h +++ /dev/null @@ -1,57 +0,0 @@ - -// -*- C++ -*- -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl ACE_Compression -// ------------------------------ -#ifndef ACE_COMPRESSION_EXPORT_H -#define ACE_COMPRESSION_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_COMPRESSION_HAS_DLL) -# define ACE_COMPRESSION_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && ACE_COMPRESSION_HAS_DLL */ - -#if !defined (ACE_COMPRESSION_HAS_DLL) -# define ACE_COMPRESSION_HAS_DLL 1 -#endif /* ! ACE_COMPRESSION_HAS_DLL */ - -#if defined (ACE_COMPRESSION_HAS_DLL) && (ACE_COMPRESSION_HAS_DLL == 1) -# if defined (ACE_COMPRESSION_BUILD_DLL) -# define ACE_Compression_Export ACE_Proper_Export_Flag -# define ACE_COMPRESSION_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_COMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* ACE_COMPRESSION_BUILD_DLL */ -# define ACE_Compression_Export ACE_Proper_Import_Flag -# define ACE_COMPRESSION_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_COMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_COMPRESSION_BUILD_DLL */ -#else /* ACE_COMPRESSION_HAS_DLL == 1 */ -# define ACE_Compression_Export -# define ACE_COMPRESSION_SINGLETON_DECLARATION(T) -# define ACE_COMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_COMPRESSION_HAS_DLL == 1 */ - -// Set ACE_COMPRESSION_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (ACE_COMPRESSION_NTRACE) -# if (ACE_NTRACE == 1) -# define ACE_COMPRESSION_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define ACE_COMPRESSION_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !ACE_COMPRESSION_NTRACE */ - -#if (ACE_COMPRESSION_NTRACE == 1) -# define ACE_COMPRESSION_TRACE(X) -#else /* (ACE_COMPRESSION_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define ACE_COMPRESSION_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (ACE_COMPRESSION_NTRACE == 1) */ - -#endif /* ACE_COMPRESSION_EXPORT_H */ - -// End of auto generated file. diff --git a/deps/acelite/ace/Compression/Compressor.cpp b/deps/acelite/ace/Compression/Compressor.cpp deleted file mode 100644 index 191bc839a..000000000 --- a/deps/acelite/ace/Compression/Compressor.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "Compressor.h" - -#if !defined (__ACE_INLINE__) -#include "Compressor.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Compressor::ACE_Compressor( ACE_CompressorId compressor_id, - ACE_UINT32 compression_level ) - : compressor_id_ (compressor_id) - , compression_level_ (compression_level) - , compressed_bytes_ (0) - , uncompressed_bytes_ (0) -{} - -ACE_Compressor::~ACE_Compressor () -{ -} - -ACE_UINT64 -ACE_Compressor::compressed_bytes(void) const -{ - ACE_GUARD_RETURN( ACE_SYNCH_MUTEX, ace_mon, this->mutex_, 0 ); - return this->compressed_bytes_; -} - -ACE_UINT64 -ACE_Compressor::uncompressed_bytes(void) const -{ - ACE_GUARD_RETURN( ACE_SYNCH_MUTEX, ace_mon, this->mutex_, 0 ); - return this->uncompressed_bytes_; -} - -void -ACE_Compressor::reset_stats(void) -{ - ACE_GUARD( ACE_SYNCH_MUTEX, ace_mon, this->mutex_ ); - this->compressed_bytes_ = 0; - this->uncompressed_bytes_ = 0; -} - -void -ACE_Compressor::update_stats(ACE_UINT64 uncompressed_bytes, ACE_UINT64 compressed_bytes) -{ - ACE_GUARD( ACE_SYNCH_MUTEX, ace_mon, this->mutex_ ); - this->compressed_bytes_ += compressed_bytes; - this->uncompressed_bytes_ += uncompressed_bytes; -} - -float -ACE_Compressor::compression_ratio(void) const -{ - ACE_GUARD_RETURN( ACE_SYNCH_MUTEX, ace_mon, this->mutex_, 0.0f ); - if (this->uncompressed_bytes_ > 0) { - return static_cast(this->compressed_bytes_) / this->uncompressed_bytes_; - } - return 0.0f; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Compression/Compressor.h b/deps/acelite/ace/Compression/Compressor.h deleted file mode 100644 index 315104bbd..000000000 --- a/deps/acelite/ace/Compression/Compressor.h +++ /dev/null @@ -1,138 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file Compressor.h - * - * @author ACE version by - * @author Derek Dominish - */ -//============================================================================= - -#ifndef ACE_COMPRESSOR_H -#define ACE_COMPRESSOR_H - -#include /**/ "ace/pre.h" - -#include /**/ "ACE_Compression_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Guard_T.h" -#include "ace/Thread_Mutex.h" -#include "ace/Synch_Traits.h" -#include "ace/Copy_Disabled.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * CompressorId from OMG Compression::CompressorId - * see $(TAO_ROOT)/tao/Compression.pidl - */ -enum ACE_CompressorId -{ - ACE_COMPRESSORID_NONE = 0, - ACE_COMPRESSORID_GZIP = 1, - ACE_COMPRESSORID_PKZIP = 2, - ACE_COMPRESSORID_BZIP2 = 3, - ACE_COMPRESSORID_ZLIB = 4, - ACE_COMPRESSORID_LZMA = 5, - ACE_COMPRESSORID_LZO = 6, - ACE_COMPRESSORID_RZIP = 7, - ACE_COMPRESSORID_7X = 8, - ACE_COMPRESSORID_XAR = 9, - ACE_COMPRESSORID_RLE = 10 -}; - -class ACE_Compression_Export ACE_Compressor -{ -public: - - ACE_CompressorId get_compressor_id(void) const; - - ACE_UINT32 get_compression_level(void) const; - - /** - * Compress the @a in_ptr buffer for @a in_len into the - * @a dest_ptr buffer with a maximum @a max_out_len. If the - * @a max_out_len is exhausted through the compress process - * then a value of -1 will be returned from the function, - * otherwise the return value will indicate the resultant - * @a out_ptr compressed buffer length. - * - * NOTE: it is advisable that the @max_out_len be slightly - * larger of the input @a in_len (i.e. x 1.1F) to cater - * for the possibility that a reduced compressed length - * is not possible. - */ - virtual ACE_UINT64 compress( const void *in_ptr, - ACE_UINT64 in_len, - void *out_ptr, - ACE_UINT64 max_out_len ) = 0; - - /** - * DeCompress the @a in_ptr buffer for @a in_len into the - * @a out_ptr buffer with a maximum @a max_out_len. If the - * @a max_out_len is exhausted during decompression - * then a value of -1 will be returned from the function, - * otherwise the return value will indicate the resultant - * @a out_ptr decompressed buffer length. - */ - virtual ACE_UINT64 decompress( const void *in_ptr, - ACE_UINT64 in_len, - void *out_ptr, - ACE_UINT64 max_out_len ) = 0; - - /** - * Return the current compressed bytes statistics counter. - */ - virtual ACE_UINT64 compressed_bytes(void) const; - - /** - * Return the current uncompressed bytes statistics counter. - */ - virtual ACE_UINT64 uncompressed_bytes(void) const; - - /** - * Return the current compression ratio statistics. - */ - virtual float compression_ratio(void) const; - - /** - * Reset the statistics to zero. - */ - virtual void reset_stats(void); - - virtual ~ACE_Compressor (void); - -protected: - ACE_Compressor(ACE_CompressorId compressor_id, - ACE_UINT32 compression_level = 0); // Must be inherited. - - virtual void update_stats( ACE_UINT64 uncompressed_bytes, - ACE_UINT64 compressed_bytes ); - -private: - ACE_CompressorId compressor_id_; - ACE_UINT32 compression_level_; - - // Ensure we can lock with imutability (i.e. const) - mutable ACE_SYNCH_MUTEX mutex_; - - ACE_UINT64 compressed_bytes_; - ACE_UINT64 uncompressed_bytes_; - - ACE_UNIMPLEMENTED_FUNC (ACE_Compressor (const ACE_Compressor&)) - ACE_UNIMPLEMENTED_FUNC (ACE_Compressor& operator= (const ACE_Compressor&)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "Compressor.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif // ACE_COMPRESSOR_H diff --git a/deps/acelite/ace/Compression/Compressor.inl b/deps/acelite/ace/Compression/Compressor.inl deleted file mode 100644 index 5f9a10af7..000000000 --- a/deps/acelite/ace/Compression/Compressor.inl +++ /dev/null @@ -1,16 +0,0 @@ -// -*- C++ -*- -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ACE_CompressorId -ACE_Compressor::get_compressor_id(void) const -{ - return this->compressor_id_; -} - -ACE_INLINE ACE_UINT32 -ACE_Compressor::get_compression_level(void) const -{ - return this->compression_level_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Compression/rle/ACE_RLECompression.mpc b/deps/acelite/ace/Compression/rle/ACE_RLECompression.mpc deleted file mode 100644 index 40c3bc0d9..000000000 --- a/deps/acelite/ace/Compression/rle/ACE_RLECompression.mpc +++ /dev/null @@ -1,18 +0,0 @@ -// -*- MPC -*- -project(ACE_RLECompression) : ace_compressionlib, install, ace_output { - sharedname = * - dynamicflags += ACE_RLECOMPRESSION_BUILD_DLL - - Source_Files { - RLECompressor.cpp - } - - Header_Files { - RLECompressor.h - ACE_RLECompression_export.h - } - - specific { - install_dir = ace/Compression/rle - } -} diff --git a/deps/acelite/ace/Compression/rle/ACE_RLECompression_export.h b/deps/acelite/ace/Compression/rle/ACE_RLECompression_export.h deleted file mode 100644 index 7850212d6..000000000 --- a/deps/acelite/ace/Compression/rle/ACE_RLECompression_export.h +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl ACE_RLECompression -// ------------------------------ -#ifndef ACE_RLECOMPRESSION_EXPORT_H -#define ACE_RLECOMPRESSION_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_RLECOMPRESSION_HAS_DLL) -# define ACE_RLECOMPRESSION_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && ACE_RLECOMPRESSION_HAS_DLL */ - -#if !defined (ACE_RLECOMPRESSION_HAS_DLL) -# define ACE_RLECOMPRESSION_HAS_DLL 1 -#endif /* ! ACE_RLECOMPRESSION_HAS_DLL */ - -#if defined (ACE_RLECOMPRESSION_HAS_DLL) && (ACE_RLECOMPRESSION_HAS_DLL == 1) -# if defined (ACE_RLECOMPRESSION_BUILD_DLL) -# define ACE_RLECompression_Export ACE_Proper_Export_Flag -# define ACE_RLECOMPRESSION_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_RLECOMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* ACE_RLECOMPRESSION_BUILD_DLL */ -# define ACE_RLECompression_Export ACE_Proper_Import_Flag -# define ACE_RLECOMPRESSION_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_RLECOMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_RLECOMPRESSION_BUILD_DLL */ -#else /* ACE_RLECOMPRESSION_HAS_DLL == 1 */ -# define ACE_RLECompression_Export -# define ACE_RLECOMPRESSION_SINGLETON_DECLARATION(T) -# define ACE_RLECOMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_RLECOMPRESSION_HAS_DLL == 1 */ - -// Set ACE_RLECOMPRESSION_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (ACE_RLECOMPRESSION_NTRACE) -# if (ACE_NTRACE == 1) -# define ACE_RLECOMPRESSION_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define ACE_RLECOMPRESSION_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !ACE_RLECOMPRESSION_NTRACE */ - -#if (ACE_RLECOMPRESSION_NTRACE == 1) -# define ACE_RLECOMPRESSION_TRACE(X) -#else /* (ACE_RLECOMPRESSION_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define ACE_RLECOMPRESSION_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (ACE_RLECOMPRESSION_NTRACE == 1) */ - -#endif /* ACE_RLECOMPRESSION_EXPORT_H */ - -// End of auto generated file. diff --git a/deps/acelite/ace/Compression/rle/RLECompressor.cpp b/deps/acelite/ace/Compression/rle/RLECompressor.cpp deleted file mode 100644 index f027b5667..000000000 --- a/deps/acelite/ace/Compression/rle/RLECompressor.cpp +++ /dev/null @@ -1,145 +0,0 @@ -#include "RLECompressor.h" -#include "ace/OS_NS_string.h" - -#if defined (__BORLANDC__) && (__BORLANDC__ >= 0x660) && (__BORLANDC__ <= 0x680) -# pragma option push -w-8072 -#endif - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_RLECompressor::ACE_RLECompressor(void) - : ACE_Compressor(ACE_COMPRESSORID_RLE) -{ -} - -ACE_RLECompressor::~ACE_RLECompressor(void) -{ -} - -// Compress using Run Length Encoding (RLE) -ACE_UINT64 -ACE_RLECompressor::compress( const void *in_ptr, - ACE_UINT64 in_len, - void *out_ptr, - ACE_UINT64 max_out_len ) -{ - const ACE_Byte *in_p = static_cast(in_ptr); - ACE_Byte *out_p = static_cast(out_ptr); - - ACE_UINT64 src_len = in_len; // Save for stats - ACE_UINT64 out_index = 0; - ACE_UINT64 out_base = 0; - size_t run_count = 0; - bool run_code = false; - - if (in_p && out_p && in_len) { - - while (in_len-- > 0) { - - ACE_Byte cur_byte = *in_p++; - - switch (out_index ? run_count : 128U) { // BootStrap to 128 - - case 128: - - if ((out_base = out_index++) >= max_out_len) { - return ACE_UINT64(-1); // Output Exhausted - } - run_code = false; - run_count = 0; // Switch off compressing - - // Fall Through - - default: - - // Fix problem where input exhaused but maybe compressing - if (in_len ? cur_byte == *in_p : run_code) { - - if (run_code) { // In Compression? - out_p[out_base] = ACE_Byte(run_count++ | 0x80); - continue; // Stay in Compression - } else if (run_count) { // Xfering to Compression - if ((out_base = out_index++) >= max_out_len) { - return ACE_UINT64(-1); // Output Exhausted - } - run_count = 0; - } - run_code = true; // We Are Now Compressing - - } else if (run_code) { // Are we in Compression? - // Finalise the Compression Run Length - out_p[out_base] = ACE_Byte(run_count | 0x80); - // Reset for Uncmpressed - if (in_len && (out_base = out_index++) >= max_out_len) { - return ACE_UINT64(-1); // Output Exhausted - } - run_code = false; - run_count = 0; - continue; // Now restart Uncompressed - } - - break; - } - - out_p[out_base] = ACE_Byte(run_count++ | (run_code ? 0x80 : 0)); - - if (out_index >= max_out_len) { - return ACE_UINT64(-1); // Output Exhausted - } - out_p[out_index++] = cur_byte; - } - this->update_stats(src_len, out_index); - } - - return out_index; // return as our output length -} - -// Decompress using Run Length Encoding (RLE) -ACE_UINT64 -ACE_RLECompressor::decompress( const void *in_ptr, - ACE_UINT64 in_len, - void *out_ptr, - ACE_UINT64 max_out_len ) -{ - ACE_UINT64 out_len = 0; - - const ACE_Byte *in_p = static_cast(in_ptr); - ACE_Byte *out_p = static_cast(out_ptr); - - if (in_p && out_p) while(in_len-- > 0) { - - ACE_Byte cur_byte = *in_p++; - ACE_UINT32 cpy_len = ACE_UINT32((cur_byte & ACE_CHAR_MAX) + 1); - - if (cpy_len > max_out_len) { - return ACE_UINT64(-1); // Output Exhausted - } else if ((cur_byte & 0x80) != 0) { // compressed - if (in_len-- > 0) { - ACE_OS::memset(out_p, *in_p++, cpy_len); - } else { - return ACE_UINT64(-1); // Output Exhausted - } - } else if (in_len >= cpy_len) { - ACE_OS::memcpy(out_p, in_p, cpy_len); - in_p += cpy_len; - in_len -= cpy_len; - } else { - return ACE_UINT64(-1); // Output Exhausted - } - - out_p += cpy_len; - max_out_len -= cpy_len; - out_len += cpy_len; - } - - return out_len; -} - -ACE_SINGLETON_TEMPLATE_INSTANTIATE(ACE_Singleton, ACE_RLECompressor, ACE_SYNCH_MUTEX); - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__BORLANDC__) && (__BORLANDC__ >= 0x660) && (__BORLANDC__ <= 0x680) -# pragma option pop -#endif diff --git a/deps/acelite/ace/Compression/rle/RLECompressor.h b/deps/acelite/ace/Compression/rle/RLECompressor.h deleted file mode 100644 index 816401553..000000000 --- a/deps/acelite/ace/Compression/rle/RLECompressor.h +++ /dev/null @@ -1,106 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file RLECompressor.h - * - * @author TAO version by - * @author Derek Dominish - * @author ACE version by - * @author Derek Dominish - * - * Run-length encoding (RLE) is a very simple form of data compression - * in which runs of data (that is, sequences in which the same data value - * occurs in many consecutive data elements) are stored as a single data - * value and count, rather than as the original run. This is most useful - * on data that contains many such runs: for example, simple graphic - * images such as icons, line drawings, and animations. It is not useful - * with files that don't have many runs as it could slightly increase the - * output size. - * ALGORITHM: This algorithm is an optimized version of the traditional - * RLE algorithm in that it behaves better with very few runs. - * - * With a run of a character where that run is >= 3 this is - * replaced with the repeat indicator 0X80 and then the repeat count OR'd - * over this ident. This repeat count is therefore has a maximum value - * of 127 (0x7F) which is to be interpreted as the next character repeated - * another 'repeat count' times (i.e. a maximum of 128 characters can be - * represented in any single dupal). if the repeat ident is not present - * then the count is to be interpreted as a copy of the next repeat count - * characters + 1. - * - * EXAMPLE: the following arbitary string of 67 bytes:- - * WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW - * will produce (as a HEXDUMP) of 14 bytes - * 8B 57 00 42 8B 57 82 42 97 57 00 42 8D 57 .W.B.W.B.W.B.W - */ -//============================================================================= - -#ifndef ACE_RLECOMPRESSOR_H -#define ACE_RLECOMPRESSOR_H - -#include /**/ "ace/pre.h" - -#include "ACE_RLECompression_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Compression/Compressor.h" -#include "ace/Singleton.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_RLECompression_Export ACE_RLECompressor : public ACE_Compressor -{ -public: - /** - * Default constructor. Should use instance() to get global instance. - */ - ACE_RLECompressor(void); - - virtual ~ACE_RLECompressor(void); - - /** - * Compress the @a in_ptr buffer for @a in_len into the - * @a dest_ptr buffer with a maximum @a max_out_len using - * the Run Length Ecoding (RLE) algorithm. If the - * @a max_out_len is exhausted through the compress process - * then a value of -1 will be returned from the function, - * otherwise the return value will indicate the resultant - * @a out_ptr compressed buffer length. - * - * @note It is advisable that the @max_out_len be slightly - * larger of the input @a in_len (i.e. x 1.1F) to cater - * for the possibility that a reduced compressed length - * is not possible. - */ - virtual ACE_UINT64 compress( const void *in_ptr, - ACE_UINT64 in_len, - void *out_ptr, - ACE_UINT64 max_out_len ); - - /** - * DeCompress the @a in_ptr buffer for @a in_len into the - * @a out_ptr buffer with a maximum @a max_out_len using - * the Run Length Ecoding (RLE) algorithm. If the - * @a max_out_len is exhausted during decompression - * then a value of -1 will be returned from the function, - * otherwise the return value will indicate the resultant - * @a out_ptr decompressed buffer length. - */ - virtual ACE_UINT64 decompress( const void *in_ptr, - ACE_UINT64 in_len, - void *out_ptr, - ACE_UINT64 max_out_len ); -}; - -ACE_RLECOMPRESSION_SINGLETON_DECLARE(ACE_Singleton, ACE_RLECompressor, ACE_SYNCH_MUTEX); - -typedef class ACE_Singleton ACE_RLECompression; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif // ACE_RLECOMPRESSOR_H diff --git a/deps/acelite/ace/Condition_Attributes.cpp b/deps/acelite/ace/Condition_Attributes.cpp index 044dfacc5..9257b602d 100644 --- a/deps/acelite/ace/Condition_Attributes.cpp +++ b/deps/acelite/ace/Condition_Attributes.cpp @@ -4,7 +4,7 @@ * * Originally in Synch.cpp * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ #include "ace/Condition_Thread_Mutex.h" diff --git a/deps/acelite/ace/Condition_Attributes.h b/deps/acelite/ace/Condition_Attributes.h index 13c1b8abf..06b2676d8 100644 --- a/deps/acelite/ace/Condition_Attributes.h +++ b/deps/acelite/ace/Condition_Attributes.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/Condition_Attributes.inl b/deps/acelite/ace/Condition_Attributes.inl index 7fecc4aaf..f63106ad4 100644 --- a/deps/acelite/ace/Condition_Attributes.inl +++ b/deps/acelite/ace/Condition_Attributes.inl @@ -24,7 +24,7 @@ ACE_INLINE ACE_Condition_Attributes_T::ACE_Condition_Attributes_T (int type) : ACE_Condition_Attributes (type) { -#if (defined (_POSIX_MONOTONIC_CLOCK) && !defined (ACE_LACKS_MONOTONIC_TIME)) || defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC) +#if defined (ACE_HAS_POSIX_MONOTONIC_CONDITIONS) (void) ACE_OS::condattr_setclock (this->attributes_, CLOCK_MONOTONIC); #endif } diff --git a/deps/acelite/ace/Condition_Recursive_Thread_Mutex.cpp b/deps/acelite/ace/Condition_Recursive_Thread_Mutex.cpp index 2f68f8c8b..e7a23dfe7 100644 --- a/deps/acelite/ace/Condition_Recursive_Thread_Mutex.cpp +++ b/deps/acelite/ace/Condition_Recursive_Thread_Mutex.cpp @@ -5,7 +5,7 @@ * * Originally in Synch.cpp * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ #include "ace/Condition_Recursive_Thread_Mutex.h" diff --git a/deps/acelite/ace/Condition_Recursive_Thread_Mutex.h b/deps/acelite/ace/Condition_Recursive_Thread_Mutex.h index a7ce9944c..f53ab12eb 100644 --- a/deps/acelite/ace/Condition_Recursive_Thread_Mutex.h +++ b/deps/acelite/ace/Condition_Recursive_Thread_Mutex.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -87,19 +87,16 @@ public: void dump (void) const; private: - // = Prevent assignment and copying. void operator= (const ACE_Condition &); ACE_Condition (const ACE_Condition &); private: - /// A normal (i.e., non-recursive) condition variable. ACE_cond_t cond_; /// Reference to the recursive mutex. ACE_Recursive_Thread_Mutex &mutex_; - }; typedef ACE_Condition ACE_Condition_Recursive_Thread_Mutex; diff --git a/deps/acelite/ace/Condition_T.cpp b/deps/acelite/ace/Condition_T.cpp index 2657822ed..7f6b16737 100644 --- a/deps/acelite/ace/Condition_T.cpp +++ b/deps/acelite/ace/Condition_T.cpp @@ -10,6 +10,9 @@ #if defined (ACE_HAS_THREADS) #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/Condition_T.inl" @@ -18,7 +21,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Condition) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Condition) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Thread_Condition) template void ACE_Condition::dump (void) const diff --git a/deps/acelite/ace/Condition_T.h b/deps/acelite/ace/Condition_T.h index a42b02ade..d87d96b2d 100644 --- a/deps/acelite/ace/Condition_T.h +++ b/deps/acelite/ace/Condition_T.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -103,8 +103,8 @@ public: /// Dump the state of an object. void dump (void) const; - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; protected: /// Condition variable. @@ -140,14 +140,13 @@ template class ACE_Thread_Condition : public ACE_Condition { public: - // = Initialization method. ACE_Thread_Condition (MUTEX &m, const ACE_TCHAR *name = 0, void *arg = 0); /// Dump the state of an object. void dump (void) const; - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Condition_Thread_Mutex.cpp b/deps/acelite/ace/Condition_Thread_Mutex.cpp index d012e1a7d..7e9c505d4 100644 --- a/deps/acelite/ace/Condition_Thread_Mutex.cpp +++ b/deps/acelite/ace/Condition_Thread_Mutex.cpp @@ -4,7 +4,7 @@ * * Originally in Synch.cpp * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ #include "ace/Condition_Thread_Mutex.h" diff --git a/deps/acelite/ace/Condition_Thread_Mutex.h b/deps/acelite/ace/Condition_Thread_Mutex.h index 6ba91871e..898e683fa 100644 --- a/deps/acelite/ace/Condition_Thread_Mutex.h +++ b/deps/acelite/ace/Condition_Thread_Mutex.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -76,9 +76,9 @@ public: /** * Block on condition, or until absolute time-of-day has passed. If - * abstime == 0 use "blocking" semantics. Else, if @a abstime + * abstime == 0 use "blocking" wait semantics. Else, if @a abstime * != 0 and the call times out before the condition is signaled - * returns -1 and sets errno to ETIME. + * wait() returns -1 and sets errno to ETIME. */ int wait (const ACE_Time_Value *abstime); @@ -117,11 +117,11 @@ protected: /// Reference to mutex lock. ACE_Thread_Mutex &mutex_; - /// Keeps track of whether has been called yet to avoid - /// multiple calls, e.g., explicitly and implicitly in the + /// Keeps track of whether remove() has been called yet to avoid + /// multiple remove() calls, e.g., explicitly and implicitly in the /// destructor. This flag isn't protected by a lock, so make sure /// that you don't have multiple threads simultaneously calling - /// on the same object, which is a bad idea anyway... + /// remove() on the same object, which is a bad idea anyway... bool removed_; private: diff --git a/deps/acelite/ace/Configuration.cpp b/deps/acelite/ace/Configuration.cpp index 5050f8a81..10b0ad2b0 100644 --- a/deps/acelite/ace/Configuration.cpp +++ b/deps/acelite/ace/Configuration.cpp @@ -13,6 +13,10 @@ #include "ace/Configuration.inl" #endif /* __ACE_INLINE__ */ +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Section_Key_Internal::ACE_Section_Key_Internal (void) @@ -103,7 +107,7 @@ int ACE_Configuration::expand_path (const ACE_Configuration_Section_Key& key, const ACE_TString& path_in, ACE_Configuration_Section_Key& key_out, - int create) + bool create) { // Make a copy of key ACE_Configuration_Section_Key current_section = key; @@ -333,8 +337,13 @@ ACE_Configuration::operator== (const ACE_Configuration& rhs) const rc = (* (thisCharData + count) == * (rhsCharData + count)); } +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(thisCharData); + ACE_Allocator::instance()->free(rhsCharData); +#else delete [] thisCharData; delete [] rhsCharData; +#endif /* ACE_HAS_ALLOC_HOOKS */ }// end if the length's match } // We should never have valueTypes of INVALID, therefore @@ -449,7 +458,8 @@ ACE_Configuration_Win32Registry::operator!= (const ACE_Configuration_Win32Regist return true; } -ACE_Configuration_Win32Registry::ACE_Configuration_Win32Registry (HKEY hKey) +ACE_Configuration_Win32Registry::ACE_Configuration_Win32Registry (HKEY hKey, u_long security_access) + : security_access_ (security_access) { ACE_Section_Key_Win32 *temp = 0; @@ -466,7 +476,7 @@ ACE_Configuration_Win32Registry::~ACE_Configuration_Win32Registry (void) int ACE_Configuration_Win32Registry::open_section (const ACE_Configuration_Section_Key& base, const ACE_TCHAR* sub_section, - int create, + bool create, ACE_Configuration_Section_Key& result) { if (validate_name (sub_section, 1)) @@ -481,7 +491,7 @@ ACE_Configuration_Win32Registry::open_section (const ACE_Configuration_Section_K if ((errnum = ACE_TEXT_RegOpenKeyEx (base_key, sub_section, 0, - KEY_ALL_ACCESS, + security_access_, &result_key)) != ERROR_SUCCESS) { if (!create) @@ -495,7 +505,7 @@ ACE_Configuration_Win32Registry::open_section (const ACE_Configuration_Section_K 0, 0, REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, + security_access_, 0, &result_key, (PDWORD) 0 @@ -970,7 +980,8 @@ ACE_Configuration_Win32Registry::load_key (const ACE_Configuration_Section_Key& HKEY ACE_Configuration_Win32Registry::resolve_key (HKEY hKey, const ACE_TCHAR* path, - int create) + bool create, + u_long security_access) { HKEY result = 0; // Make a copy of hKey @@ -1021,7 +1032,7 @@ ACE_Configuration_Win32Registry::resolve_key (HKEY hKey, 0, 0, 0, - KEY_ALL_ACCESS, + security_access, 0, &subkey, (PDWORD) 0 @@ -1211,9 +1222,15 @@ ACE_Configuration_Section_Key_Heap::~ACE_Configuration_Section_Key_Heap () { delete value_iter_; delete section_iter_; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (path_); +#else ACE_OS::free (path_); +#endif /* ACE_HAS_ALLOC_HOOKS */ } +ACE_ALLOC_HOOK_DEFINE(ACE_Configuration_Section_Key_Heap) + ////////////////////////////////////////////////////////////////////////////// ACE_Configuration_Heap::ACE_Configuration_Heap (void) @@ -1507,7 +1524,7 @@ ACE_Configuration_Heap::section_open_helper (size_t hash_table_size, int ACE_Configuration_Heap::open_section (const ACE_Configuration_Section_Key& base, const ACE_TCHAR* sub_section, - int create, + bool create, ACE_Configuration_Section_Key& result) { ACE_ASSERT (this->allocator_); @@ -1534,7 +1551,7 @@ ACE_Configuration_Heap::open_section (const ACE_Configuration_Section_Key& base, int ACE_Configuration_Heap::open_simple_section (const ACE_Configuration_Section_Key& base, const ACE_TCHAR* sub_section, - int create, + bool create, ACE_Configuration_Section_Key& result) { ACE_TString section (0, 0, false); @@ -2054,7 +2071,11 @@ ACE_Configuration_Heap::get_binary_value ( } // Make a copy +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (data, static_cast (ACE_Allocator::instance()->malloc(sizeof(char) * VIntId.length_)), -1); +#else ACE_NEW_RETURN (data, char[VIntId.length_], -1); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_OS::memcpy (data, VIntId.data_.ptr_, VIntId.length_); length = VIntId.length_; return 0; diff --git a/deps/acelite/ace/Configuration.h b/deps/acelite/ace/Configuration.h index fc96cacc5..7e89c4de4 100644 --- a/deps/acelite/ace/Configuration.h +++ b/deps/acelite/ace/Configuration.h @@ -158,7 +158,7 @@ public: * * @param base Existing section in which to open the named section. * @param sub_section Name of the section to open. - * @param create If zero, the named section must exist. If non-zero, + * @param create If false, the named section must exist, otherwise * the named section will be created if it does not exist. * @param result Reference; receives the section key for the new * section. @@ -168,7 +168,7 @@ public: */ virtual int open_section (const ACE_Configuration_Section_Key &base, const ACE_TCHAR *sub_section, - int create, + bool create, ACE_Configuration_Section_Key& result) = 0; /// Removes a named section. @@ -355,7 +355,7 @@ public: int expand_path (const ACE_Configuration_Section_Key& key, const ACE_TString& path_in, ACE_Configuration_Section_Key& key_out, - int create = 1); + bool create = true); /** * Determine if the contents of this object is the same as the @@ -447,20 +447,20 @@ protected: class ACE_Export ACE_Configuration_Win32Registry : public ACE_Configuration { public: - /** * Constructor for registry configuration database. hKey is the * base registry key to attach to. This class takes ownership of * hKey, it will invoke on it upon destruction. */ - explicit ACE_Configuration_Win32Registry (HKEY hKey); + explicit ACE_Configuration_Win32Registry (HKEY hKey, + u_long security_access = KEY_ALL_ACCESS); /// Destructor virtual ~ACE_Configuration_Win32Registry (void); virtual int open_section (const ACE_Configuration_Section_Key& base, const ACE_TCHAR* sub_section, - int create, + bool create, ACE_Configuration_Section_Key& result); virtual int remove_section (const ACE_Configuration_Section_Key& key, @@ -520,7 +520,8 @@ public: */ static HKEY resolve_key (HKEY hKey, const ACE_TCHAR* path, - int create = 1); + bool create = true, + u_long security_access = KEY_ALL_ACCESS); virtual bool operator== (const ACE_Configuration_Win32Registry &rhs) const; virtual bool operator!= (const ACE_Configuration_Win32Registry &rhs) const; @@ -533,6 +534,8 @@ protected: ACE_Configuration_Win32Registry (void); ACE_Configuration_Win32Registry (const ACE_Configuration_Win32Registry& rhs); ACE_Configuration_Win32Registry& operator= (const ACE_Configuration_Win32Registry& rhs); + + const u_long security_access_; }; #endif /* ACE_WIN32 && !ACE_LACKS_WIN32_REGISTRY */ @@ -735,6 +738,9 @@ public: /// The sub section iterator SUBSECTION_HASH::ITERATOR* section_iter_; + + ACE_ALLOC_HOOK_DECLARE; + protected: /// Destructor - will delete the iterators virtual ~ACE_Configuration_Section_Key_Heap (void); @@ -763,7 +769,6 @@ protected: class ACE_Export ACE_Configuration_Heap : public ACE_Configuration { public: - /// Default ctor ACE_Configuration_Heap (void); @@ -805,7 +810,7 @@ public: virtual int open_section (const ACE_Configuration_Section_Key& base, const ACE_TCHAR* sub_section, - int create, ACE_Configuration_Section_Key& result); + bool create, ACE_Configuration_Section_Key& result); virtual int remove_section (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* sub_section, @@ -857,8 +862,8 @@ public: private: /// @a sub_section may not contain path separators int open_simple_section (const ACE_Configuration_Section_Key &base, - const ACE_TCHAR *sub_section, - int create, ACE_Configuration_Section_Key &result); + const ACE_TCHAR *sub_section, + bool create, ACE_Configuration_Section_Key &result); /// Adds a new section int add_section (const ACE_Configuration_Section_Key &base, const ACE_TCHAR *sub_section, diff --git a/deps/acelite/ace/Configuration_Import_Export.cpp b/deps/acelite/ace/Configuration_Import_Export.cpp index 74ff1a32b..3b91d3226 100644 --- a/deps/acelite/ace/Configuration_Import_Export.cpp +++ b/deps/acelite/ace/Configuration_Import_Export.cpp @@ -41,7 +41,11 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) u_int buffer_size = 4096; u_int read_pos = 0; ACE_TCHAR *buffer = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_NORETURN (buffer, static_cast (ACE_Allocator::instance()->malloc(sizeof(ACE_TCHAR) * buffer_size))); +#else ACE_NEW_NORETURN (buffer, ACE_TCHAR[buffer_size]); +#endif /* ACE_HAS_ALLOC_HOOKS */ if (!buffer) { ACE_Errno_Guard guard (errno); @@ -60,11 +64,19 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) { // allocate a new buffer - double size the previous one ACE_TCHAR *temp_buffer; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_NORETURN (temp_buffer, static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_TCHAR) * buffer_size * 2))); +#else ACE_NEW_NORETURN (temp_buffer, ACE_TCHAR[buffer_size * 2]); +#endif /* ACE_HAS_ALLOC_HOOKS */ if (!temp_buffer) { ACE_Errno_Guard guard (errno); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(buffer); +#else delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ (void) ACE_OS::fclose (in); return -1; } @@ -73,7 +85,11 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) ACE_OS::memcpy (temp_buffer, buffer, buffer_size); read_pos = buffer_size - 1; buffer_size *= 2; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(buffer); +#else delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ buffer = temp_buffer; continue; } @@ -90,7 +106,11 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) if (!end) { ACE_OS::fclose (in); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(buffer); +#else delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ return -3; } *end = 0; @@ -98,7 +118,11 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) if (config_.expand_path (config_.root_section (), buffer + 1, section, 1)) { ACE_OS::fclose (in); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(buffer); +#else delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ return -3; } continue; @@ -127,7 +151,11 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) if (config_.set_string_value (section, name, end)) { ACE_OS::fclose (in); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(buffer); +#else delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ return -4; } } @@ -140,7 +168,11 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) static_cast (value))) { ACE_OS::fclose (in); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(buffer); +#else delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ return -4; } } @@ -152,9 +184,15 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) size_t length = string_length / 3; size_t remaining = length; u_char* data = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (data, + static_cast (ACE_Allocator::instance()->malloc(sizeof(u_char) * length)), + -1); +#else ACE_NEW_RETURN (data, u_char[length], -1); +#endif /* ACE_HAS_ALLOC_HOOKS */ u_char* out = data; ACE_TCHAR* inb = end + 4; ACE_TCHAR* endptr = 0; @@ -169,12 +207,21 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) if (config_.set_binary_value (section, name, data, length)) { ACE_OS::fclose (in); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(data); + ACE_Allocator::instance()->free(buffer); +#else delete [] data; delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ return -4; } else +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(data); +#else delete [] data; +#endif /* ACE_HAS_ALLOC_HOOKS */ } else { @@ -192,7 +239,11 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) if (rc != 0) { ACE_OS::fclose (in); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(buffer); +#else delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ return rc; } } // end if maybe old format @@ -201,12 +252,20 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) if (ferror (in)) { ACE_OS::fclose (in); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(buffer); +#else delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ return -1; } ACE_OS::fclose (in); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(buffer); +#else delete [] buffer; +#endif /* ACE_HAS_ALLOC_HOOKS */ return 0; } @@ -237,6 +296,21 @@ ACE_Registry_ImpExp::export_config (const ACE_TCHAR* filename) return result; } + +#if !defined ACE_USES_WCHAR && defined ACE_LACKS_FPUTS +# define ACE_WRITE_STRING write_string +namespace +{ + int write_string (const char *string, FILE *stream) + { + const size_t count = ACE_OS::strlen (string); + return (ACE_OS::fwrite (string, 1, count, stream) < count) ? -1 : 0; + } +} +#else +# define ACE_WRITE_STRING ACE_OS::fputs +#endif + // Method provided by derived classes in order to write one section // to the file specified. Called by export_config when exporting // the entire configuration object. @@ -254,7 +328,7 @@ ACE_Registry_ImpExp::export_section (const ACE_Configuration_Section_Key& sectio header += path; header += ACE_TEXT ("]"); header += ACE_TEXT ("\n"); - if (ACE_OS::fputs (header.fast_rep (), out) < 0) + if (ACE_WRITE_STRING (header.fast_rep (), out) < 0) return -1; // Write out each value int index = 0; @@ -276,7 +350,7 @@ ACE_Registry_ImpExp::export_section (const ACE_Configuration_Section_Key& sectio u_int value; if (config_.get_integer_value (section, name.fast_rep (), value)) return -2; - ACE_OS::sprintf (int_value, ACE_TEXT ("%08x"), value); + ACE_OS::snprintf (int_value, 32, ACE_TEXT ("%08x"), value); line += ACE_TEXT ("dword:"); line += int_value; break; @@ -291,11 +365,9 @@ ACE_Registry_ImpExp::export_section (const ACE_Configuration_Section_Key& sectio line += string_value + ACE_TEXT ("\""); break; } -#ifdef _WIN32 +#ifdef ACE_WIN32 case ACE_Configuration::INVALID: - break; // JDO added break. Otherwise INVALID is processed - // like BINARY. If that's correct, please remove the - // break and these comments + break; #endif case ACE_Configuration::BINARY: { @@ -313,19 +385,23 @@ ACE_Registry_ImpExp::export_section (const ACE_Configuration_Section_Key& sectio { line += ACE_TEXT (","); } - ACE_OS::sprintf (bin_value, ACE_TEXT ("%02x"), *ptr); + ACE_OS::snprintf (bin_value, 3, ACE_TEXT ("%02x"), *ptr); line += bin_value; --binary_length; ++ptr; } +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(binary_data); +#else delete [] (char*) binary_data; +#endif /* ACE_HAS_ALLOC_HOOKS */ break; } default: return -3; } line += ACE_TEXT ("\n"); - if (ACE_OS::fputs (line.fast_rep (), out) < 0) + if (ACE_WRITE_STRING (line.fast_rep (), out) < 0) return -4; ++index; } @@ -334,7 +410,6 @@ ACE_Registry_ImpExp::export_section (const ACE_Configuration_Section_Key& sectio int index = 0; ACE_TString name; ACE_Configuration_Section_Key sub_key; - ACE_TString sub_section; while (!config_.enumerate_sections (section, index, name)) { ACE_TString sub_section (path); @@ -538,7 +613,7 @@ ACE_Ini_ImpExp::export_section (const ACE_Configuration_Section_Key& section, ACE_TString header = ACE_TEXT ("["); header += path; header += ACE_TEXT ("]\n"); - if (ACE_OS::fputs (header.fast_rep (), out) < 0) + if (ACE_WRITE_STRING (header.fast_rep (), out) < 0) return -1; // Write out each value int index = 0; @@ -560,7 +635,7 @@ ACE_Ini_ImpExp::export_section (const ACE_Configuration_Section_Key& section, u_int value; if (config_.get_integer_value (section, name.fast_rep (), value)) return -2; - ACE_OS::sprintf (int_value, ACE_TEXT ("%08x"), value); + ACE_OS::snprintf (int_value, 32, ACE_TEXT ("%08x"), value); line += int_value; break; } @@ -595,13 +670,17 @@ ACE_Ini_ImpExp::export_section (const ACE_Configuration_Section_Key& section, { line += ACE_TEXT (","); } - ACE_OS::sprintf (bin_value, ACE_TEXT ("%02x"), *ptr); + ACE_OS::snprintf (bin_value, 3, ACE_TEXT ("%02x"), *ptr); line += bin_value; --binary_length; ++ptr; } line += ACE_TEXT ("\""); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(binary_data); +#else delete [] (char *) binary_data; +#endif /* ACE_HAS_ALLOC_HOOKS */ break; } default: @@ -610,7 +689,7 @@ ACE_Ini_ImpExp::export_section (const ACE_Configuration_Section_Key& section, }// end switch on type line += ACE_TEXT ("\n"); - if (ACE_OS::fputs (line.fast_rep (), out) < 0) + if (ACE_WRITE_STRING (line.fast_rep (), out) < 0) return -4; ++index; }// end while enumerating values @@ -619,7 +698,6 @@ ACE_Ini_ImpExp::export_section (const ACE_Configuration_Section_Key& section, int index = 0; ACE_TString name; ACE_Configuration_Section_Key sub_key; - ACE_TString sub_section; while (!config_.enumerate_sections (section, index, name)) { ACE_TString sub_section (path); diff --git a/deps/acelite/ace/Connection_Recycling_Strategy.h b/deps/acelite/ace/Connection_Recycling_Strategy.h index 368d4b2a3..763c7e548 100644 --- a/deps/acelite/ace/Connection_Recycling_Strategy.h +++ b/deps/acelite/ace/Connection_Recycling_Strategy.h @@ -53,7 +53,6 @@ public: /// Cleanup hint and reset @a act_holder to zero if @a act_holder != 0. virtual int cleanup_hint (const void *recycling_act, void **act_holder = 0) = 0; - }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Connector.cpp b/deps/acelite/ace/Connector.cpp index 43da03321..1303ab9ca 100644 --- a/deps/acelite/ace/Connector.cpp +++ b/deps/acelite/ace/Connector.cpp @@ -13,7 +13,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Connector) +ACE_ALLOC_HOOK_DEFINE_Tc (ACE_NonBlocking_Connect_Handler) +ACE_ALLOC_HOOK_DEFINE_Tco (ACE_Connector) +ACE_ALLOC_HOOK_DEFINE_Tco (ACE_Strategy_Connector) template ACE_NonBlocking_Connect_Handler::ACE_NonBlocking_Connect_Handler (ACE_Connector_Base &connector, @@ -769,10 +771,10 @@ ACE_Connector::info (ACE_TCHAR **strp, size_t lengt ACE_TRACE ("ACE_Connector::info"); ACE_TCHAR buf[BUFSIZ]; - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s"), - ACE_TEXT ("ACE_Connector"), - ACE_TEXT ("# connector factory\n")); + ACE_OS::snprintf (buf, BUFSIZ, + ACE_TEXT ("%s\t %s"), + ACE_TEXT ("ACE_Connector"), + ACE_TEXT ("# connector factory\n")); if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) return -1; diff --git a/deps/acelite/ace/Connector.h b/deps/acelite/ace/Connector.h index a70f03a24..85ee6894f 100644 --- a/deps/acelite/ace/Connector.h +++ b/deps/acelite/ace/Connector.h @@ -4,7 +4,7 @@ /** * @file Connector.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -38,7 +38,6 @@ template class ACE_Connector_Base { public: - virtual ~ACE_Connector_Base (void) {} /// Initialize the Svc_Handler. @@ -59,7 +58,6 @@ template class ACE_NonBlocking_Connect_Handler : public ACE_Event_Handler { public: - /// Constructor. ACE_NonBlocking_Connect_Handler (ACE_Connector_Base &connector, SVC_HANDLER *, @@ -70,7 +68,7 @@ public: /// Close up and return underlying SVC_HANDLER through @c sh. /** - * If the return value is true the close was performed succesfully, + * If the return value is true the close was performed successfully, * implying that this object was removed from the reactor and thereby * (by means of reference counting decremented to 0) deleted. * If the return value is false, the close was not successful. @@ -124,7 +122,6 @@ public: ACE_ALLOC_HOOK_DECLARE; private: - /// Connector base. ACE_Connector_Base &connector_; @@ -167,7 +164,6 @@ template class ACE_Connector : public ACE_Connector_Base, public ACE_Service_Object { public: - // Useful STL-style traits. typedef typename SVC_HANDLER::addr_type addr_type; typedef PEER_CONNECTOR connector_type; @@ -413,7 +409,6 @@ class ACE_Strategy_Connector : public ACE_Connector { public: - // Useful STL-style traits. typedef ACE_Creation_Strategy creation_strategy_type; @@ -479,6 +474,9 @@ public: virtual ACE_Connect_Strategy *connect_strategy (void) const; virtual ACE_Concurrency_Strategy *concurrency_strategy (void) const; + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: // = The following three methods define the 's strategies // for creating, connecting, and activating SVC_HANDLER's, diff --git a/deps/acelite/ace/Containers.cpp b/deps/acelite/ace/Containers.cpp index 40c562962..3e86f3afb 100644 --- a/deps/acelite/ace/Containers.cpp +++ b/deps/acelite/ace/Containers.cpp @@ -4,3 +4,4 @@ #include "ace/Containers.inl" #endif /* __ACE_INLINE__ */ +ACE_ALLOC_HOOK_DEFINE (ACE_DLList_Node) diff --git a/deps/acelite/ace/Containers.h b/deps/acelite/ace/Containers.h index 6288431ae..4d671ca98 100644 --- a/deps/acelite/ace/Containers.h +++ b/deps/acelite/ace/Containers.h @@ -4,7 +4,7 @@ /** * @file Containers.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/Containers_T.cpp b/deps/acelite/ace/Containers_T.cpp index 4a835ebea..4fa39569b 100644 --- a/deps/acelite/ace/Containers_T.cpp +++ b/deps/acelite/ace/Containers_T.cpp @@ -17,7 +17,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Stack) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Bounded_Stack) template void ACE_Bounded_Stack::dump (void) const @@ -81,7 +81,7 @@ ACE_Bounded_Stack::~ACE_Bounded_Stack (void) // ---------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Stack) +ACE_ALLOC_HOOK_DEFINE_Tcs(ACE_Fixed_Stack) template void ACE_Fixed_Stack::dump (void) const @@ -131,7 +131,7 @@ ACE_Fixed_Stack::~ACE_Fixed_Stack (void) //---------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Stack) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Unbounded_Stack) template void ACE_Unbounded_Stack::dump (void) const @@ -337,7 +337,7 @@ ACE_Unbounded_Stack::remove (const T &item) } //-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Iterator_Base) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Double_Linked_List_Iterator_Base) template ACE_Double_Linked_List_Iterator_Base::ACE_Double_Linked_List_Iterator_Base (const ACE_Double_Linked_List &dll) @@ -446,7 +446,7 @@ ACE_Double_Linked_List_Iterator_Base::dump_i (void) const } //-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Double_Linked_List_Iterator) template ACE_Double_Linked_List_Iterator::ACE_Double_Linked_List_Iterator (const ACE_Double_Linked_List &dll) @@ -551,7 +551,7 @@ ACE_Double_Linked_List_Iterator::operator-- (int) //-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Reverse_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Double_Linked_List_Reverse_Iterator) template ACE_Double_Linked_List_Reverse_Iterator::ACE_Double_Linked_List_Reverse_Iterator (ACE_Double_Linked_List &dll) @@ -657,7 +657,7 @@ ACE_Double_Linked_List_Reverse_Iterator::operator-- (int) } -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Double_Linked_List) template ACE_Double_Linked_List:: ACE_Double_Linked_List (ACE_Allocator *alloc) @@ -872,7 +872,7 @@ ACE_Double_Linked_List::remove_element (T *item) } //-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set) +ACE_ALLOC_HOOK_DEFINE_Tcs(ACE_Fixed_Set) template size_t ACE_Fixed_Set::size (void) const @@ -1011,7 +1011,7 @@ ACE_Fixed_Set::remove (const T &item) } //-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set_Iterator_Base) +ACE_ALLOC_HOOK_DEFINE_Tcs(ACE_Fixed_Set_Iterator_Base) template void ACE_Fixed_Set_Iterator_Base::dump_i (void) const @@ -1092,7 +1092,7 @@ ACE_Fixed_Set_Iterator_Base::next_i (T *&item) } //-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tcs(ACE_Fixed_Set_Iterator) template void ACE_Fixed_Set_Iterator::dump (void) const @@ -1146,7 +1146,7 @@ ACE_Fixed_Set_Iterator::operator* (void) } //-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set_Const_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tcs(ACE_Fixed_Set_Const_Iterator) template void ACE_Fixed_Set_Const_Iterator::dump (void) const @@ -1185,7 +1185,7 @@ ACE_Fixed_Set_Const_Iterator::operator* (void) const } //-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Set) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Bounded_Set) template void ACE_Bounded_Set::dump (void) const @@ -1349,7 +1349,7 @@ ACE_Bounded_Set::remove (const T &item) return -1; } -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Set_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Bounded_Set_Iterator) template void ACE_Bounded_Set_Iterator::dump (void) const @@ -1413,7 +1413,7 @@ ACE_Bounded_Set_Iterator::next (T *&item) return 0; } -ACE_ALLOC_HOOK_DEFINE(ACE_DNode) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_DNode) template ACE_DNode::ACE_DNode (const T &i, ACE_DNode *n, ACE_DNode *p) @@ -1482,8 +1482,7 @@ ACE_Unbounded_Stack_Iterator::next (T *&item) } -ACE_ALLOC_HOOK_DEFINE(ACE_Ordered_MultiSet) - +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Ordered_MultiSet) template ACE_Ordered_MultiSet::ACE_Ordered_MultiSet (ACE_Allocator *alloc) @@ -1790,7 +1789,7 @@ ACE_Ordered_MultiSet::delete_nodes (void) this->cur_size_ = 0; } -ACE_ALLOC_HOOK_DEFINE(ACE_Ordered_MultiSet_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Ordered_MultiSet_Iterator) template ACE_Ordered_MultiSet_Iterator::ACE_Ordered_MultiSet_Iterator (ACE_Ordered_MultiSet &s) @@ -1826,8 +1825,6 @@ ACE_Ordered_MultiSet_Iterator::operator* (void) return *retv; } -ACE_ALLOC_HOOK_DEFINE (ACE_DLList_Node) - template T * ACE_DLList::insert_tail (T *new_item) { diff --git a/deps/acelite/ace/Containers_T.h b/deps/acelite/ace/Containers_T.h index bc93b9c1a..90a967b6f 100644 --- a/deps/acelite/ace/Containers_T.h +++ b/deps/acelite/ace/Containers_T.h @@ -4,7 +4,7 @@ /** * @file Containers_T.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -310,13 +310,13 @@ class ACE_DNode friend class ACE_Ordered_MultiSet_Iterator; public: - /// This isn't necessary, but it keeps some compilers happy. ~ACE_DNode (void); -private: + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; - // = Initialization methods +private: ACE_DNode (const T &i, ACE_DNode *n = 0, ACE_DNode *p = 0); /// Pointer to next element in the list of {ACE_DNode}s. @@ -503,7 +503,6 @@ template class ACE_Unbounded_Stack_Iterator { public: - // = Initialization method. /// Move to the first element in the {stack}. ACE_Unbounded_Stack_Iterator (ACE_Unbounded_Stack &stack); @@ -584,8 +583,6 @@ public: ACE_ALLOC_HOOK_DECLARE; protected: - // = Initialization methods. - /// Constructor ACE_Double_Linked_List_Iterator_Base (const ACE_Double_Linked_List &); @@ -649,7 +646,6 @@ template class ACE_Double_Linked_List_Iterator : public ACE_Double_Linked_List_Iterator_Base { public: - // = Initialization method. ACE_Double_Linked_List_Iterator (const ACE_Double_Linked_List &); /** @@ -718,7 +714,6 @@ template class ACE_Double_Linked_List_Reverse_Iterator : public ACE_Double_Linked_List_Iterator_Base { public: - // = Initialization method. ACE_Double_Linked_List_Reverse_Iterator (ACE_Double_Linked_List &); /** @@ -825,7 +820,6 @@ public: typedef ACE_Double_Linked_List_Iterator ITERATOR; typedef ACE_Double_Linked_List_Reverse_Iterator REVERSE_ITERATOR; - // = Initialization and termination methods. /// construction. Use user specified allocation strategy /// if specified. /** @@ -960,7 +954,7 @@ protected: /** * Insert a @a new_item into the list. It will be added before * or after @a old_item. Default is to insert the new item *after* - * {head_}. Return 0 if succeed, -1 if error occured. + * {head_}. Return 0 if succeed, -1 if error occurred. */ int insert_element (T *new_item, int before = 0, @@ -1030,7 +1024,6 @@ class ACE_DLList : public ACE_DLList_Base friend class ACE_DLList_Reverse_Iterator; public: - /// Delegates to ACE_Double_Linked_List. void operator= (const ACE_DLList &l); @@ -1129,13 +1122,10 @@ public: template class ACE_DLList_Iterator : public ACE_Double_Linked_List_Iterator { - friend class ACE_DLList; friend class ACE_DLList_Node; public: - - // = Initialization method. ACE_DLList_Iterator (ACE_DLList &l); /** @@ -1192,13 +1182,10 @@ private: template class ACE_DLList_Reverse_Iterator : public ACE_Double_Linked_List_Reverse_Iterator { - friend class ACE_DLList; friend class ACE_DLList_Node; public: - - // = Initialization method. ACE_DLList_Reverse_Iterator (ACE_DLList &l); /** @@ -1271,7 +1258,6 @@ public: ACE_ALLOC_HOOK_DECLARE; protected: - // = Initialization method. ACE_Fixed_Set_Iterator_Base (ACE_Fixed_Set &s); /// Set we are iterating over. @@ -1303,7 +1289,6 @@ template class ACE_Fixed_Set_Iterator : public ACE_Fixed_Set_Iterator_Base { public: - // = Initialization method. ACE_Fixed_Set_Iterator (ACE_Fixed_Set &s); // = Iteration methods. @@ -1339,7 +1324,6 @@ template class ACE_Fixed_Set_Const_Iterator : public ACE_Fixed_Set_Iterator_Base { public: - // = Initialization method. ACE_Fixed_Set_Const_Iterator (const ACE_Fixed_Set &s); // = Iteration methods. @@ -1403,7 +1387,6 @@ public: typedef ACE_Fixed_Set_Iterator ITERATOR; typedef ACE_Fixed_Set_Const_Iterator CONST_ITERATOR; - // = Initialization and termination methods. /// Default Constructor. /** * Creates an empy set @@ -1512,7 +1495,6 @@ template class ACE_Bounded_Set_Iterator { public: - // = Initialization method. ACE_Bounded_Set_Iterator (ACE_Bounded_Set &s); // = Iteration methods. @@ -1597,7 +1579,6 @@ public: DEFAULT_SIZE = 10 }; - // = Initialization and termination methods. /// Construct a Bounded_Set using the default size. /** * The default constructor initializes the Bounded_Set to a maximum size @@ -1722,7 +1703,6 @@ class ACE_Ordered_MultiSet_Iterator public: friend class ACE_Ordered_MultiSet; - // = Initialization method. ACE_Ordered_MultiSet_Iterator (ACE_Ordered_MultiSet &s); // = Iteration methods. @@ -1760,7 +1740,6 @@ public: ACE_ALLOC_HOOK_DECLARE; private: - /// Pointer to the current node in the iteration. ACE_DNode *current_; @@ -1811,7 +1790,6 @@ public: // Trait definition. typedef ACE_Ordered_MultiSet_Iterator ITERATOR; - // = Initialization and termination methods. /// Constructor. Use user specified allocation strategy /// if specified. /** @@ -1899,7 +1877,6 @@ public: ACE_ALLOC_HOOK_DECLARE; private: - /** * Insert @a item, starting its search at the position given, * and if successful updates the passed pointer to point to diff --git a/deps/acelite/ace/Copy_Disabled.h b/deps/acelite/ace/Copy_Disabled.h index 374227e8a..0617bd874 100644 --- a/deps/acelite/ace/Copy_Disabled.h +++ b/deps/acelite/ace/Copy_Disabled.h @@ -46,7 +46,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Copy_Disabled { public: - /// Default constructor ACE_Copy_Disabled (void); diff --git a/deps/acelite/ace/Countdown_Time.h b/deps/acelite/ace/Countdown_Time.h index 7c9a9e3d2..b6966d68f 100644 --- a/deps/acelite/ace/Countdown_Time.h +++ b/deps/acelite/ace/Countdown_Time.h @@ -4,7 +4,7 @@ /** * @file Countdown_Time.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt * @author Irfan Pyarali */ //============================================================================= diff --git a/deps/acelite/ace/Countdown_Time_T.h b/deps/acelite/ace/Countdown_Time_T.h index 78d46c6d3..12aab657b 100644 --- a/deps/acelite/ace/Countdown_Time_T.h +++ b/deps/acelite/ace/Countdown_Time_T.h @@ -4,7 +4,7 @@ /** * @file Countdown_Time_T.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/DEV.cpp b/deps/acelite/ace/DEV.cpp index 762e9472d..08a7e581f 100644 --- a/deps/acelite/ace/DEV.cpp +++ b/deps/acelite/ace/DEV.cpp @@ -2,6 +2,10 @@ #include "ace/OS_NS_unistd.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/DEV.inl" #endif /* __ACE_INLINE__ */ diff --git a/deps/acelite/ace/DEV_Addr.cpp b/deps/acelite/ace/DEV_Addr.cpp index 6ff76ca94..c5c2cc3bc 100644 --- a/deps/acelite/ace/DEV_Addr.cpp +++ b/deps/acelite/ace/DEV_Addr.cpp @@ -5,6 +5,9 @@ #include "ace/Log_Category.h" #include "ace/OS_NS_string.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/DEV_Addr.h b/deps/acelite/ace/DEV_Addr.h index 3bbbad057..ed17c0bfc 100644 --- a/deps/acelite/ace/DEV_Addr.h +++ b/deps/acelite/ace/DEV_Addr.h @@ -31,7 +31,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_DEV_Addr : public ACE_Addr { public: - // = Initialization methods. /// Default constructor. ACE_DEV_Addr (void); diff --git a/deps/acelite/ace/DEV_Connector.cpp b/deps/acelite/ace/DEV_Connector.cpp index c07e8b266..159e5ecee 100644 --- a/deps/acelite/ace/DEV_Connector.cpp +++ b/deps/acelite/ace/DEV_Connector.cpp @@ -1,6 +1,9 @@ #include "ace/DEV_Connector.h" #include "ace/Handle_Ops.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/DEV_Connector.inl" diff --git a/deps/acelite/ace/DEV_Connector.h b/deps/acelite/ace/DEV_Connector.h index 1dbdf0841..5916ba8f1 100644 --- a/deps/acelite/ace/DEV_Connector.h +++ b/deps/acelite/ace/DEV_Connector.h @@ -4,7 +4,7 @@ /** * @file DEV_Connector.h * - * @author Gerhard Lenzer and Douglas C. Schmidt + * @author Gerhard Lenzer and Douglas C. Schmidt */ //============================================================================= @@ -20,7 +20,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** diff --git a/deps/acelite/ace/DEV_IO.cpp b/deps/acelite/ace/DEV_IO.cpp index bc619e27f..f1dcda429 100644 --- a/deps/acelite/ace/DEV_IO.cpp +++ b/deps/acelite/ace/DEV_IO.cpp @@ -1,5 +1,8 @@ #include "ace/DEV_IO.h" #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/DEV_IO.inl" @@ -62,15 +65,26 @@ ssize_t ACE_DEV_IO::send (size_t n, ...) const { ACE_TRACE ("ACE_DEV_IO::send"); +#ifdef ACE_LACKS_VA_FUNCTIONS + ACE_UNUSED_ARG (n); + ACE_NOTSUP_RETURN (-1); +#else va_list argp; int total_tuples = static_cast (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -83,10 +97,15 @@ ACE_DEV_IO::send (size_t n, ...) const ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; +#endif // ACE_LACKS_VA_FUNCTIONS } // This is basically an interface to ACE_OS::readv, that doesn't use the @@ -99,15 +118,26 @@ ssize_t ACE_DEV_IO::recv (size_t n, ...) const { ACE_TRACE ("ACE_DEV_IO::recv"); +#ifdef ACE_LACKS_VA_FUNCTIONS + ACE_UNUSED_ARG (n); + ACE_NOTSUP_RETURN (-1); +#else va_list argp; int total_tuples = static_cast (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -120,10 +150,15 @@ ACE_DEV_IO::recv (size_t n, ...) const ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; +#endif // ACE_LACKS_VA_FUNCTIONS } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/DLL.cpp b/deps/acelite/ace/DLL.cpp index 24987005c..998a52a88 100644 --- a/deps/acelite/ace/DLL.cpp +++ b/deps/acelite/ace/DLL.cpp @@ -101,7 +101,11 @@ ACE_DLL::~ACE_DLL (void) // occur if full ACE_DLL initialization is interrupted due to errors // (e.g. attempting to open a DSO/DLL that does not exist). Make // sure this->dll_name_ is deallocated. +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->dll_name_); +#else delete [] this->dll_name_; +#endif /* ACE_HAS_ALLOC_HOOKS */ } // This method opens the library based on the mode specified using the @@ -221,7 +225,11 @@ ACE_DLL::close (void) // Even if close_dll() failed, go ahead and cleanup. this->dll_handle_ = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->dll_name_); +#else delete [] this->dll_name_; +#endif /* ACE_HAS_ALLOC_HOOKS */ this->dll_name_ = 0; this->close_handle_on_destruction_ = false; @@ -268,7 +276,7 @@ ACE_DLL::set_handle (ACE_SHLIB_HANDLE handle, { ACE_TRACE ("ACE_DLL::set_handle"); - // Create a unique name. Note that this name is only quaranteed + // Create a unique name. Note that this name is only guaranteed // to be unique for the life of this object. ACE_TCHAR temp[ACE_UNIQUE_NAME_LEN]; ACE_OS::unique_name (this, temp, ACE_UNIQUE_NAME_LEN); diff --git a/deps/acelite/ace/DLL.h b/deps/acelite/ace/DLL.h index 57d0f9254..c64696485 100644 --- a/deps/acelite/ace/DLL.h +++ b/deps/acelite/ace/DLL.h @@ -41,8 +41,6 @@ class ACE_DLL_Handle; class ACE_Export ACE_DLL { public: - // = Initialization and termination methods. - /** * Default constructor. By default, the close() operation on the * object will be invoked before it is destroyed. @@ -154,7 +152,7 @@ public: */ void *symbol (const ACE_TCHAR *symbol_name, int ignore_errors = 0); - /// Returns a pointer to a string explaining that an error occured. You + /// Returns a pointer to a string explaining that an error occurred. You /// will need to consult the error log for the actual error string /// returned by the OS. ACE_TCHAR *error (void) const; @@ -173,16 +171,13 @@ public: bool close_handle_on_destruction = true); private: - int open_i (const ACE_TCHAR *dll_name, int open_mode = ACE_DEFAULT_SHLIB_MODE, bool close_handle_on_destruction = true, ACE_SHLIB_HANDLE handle = 0); - //private: public: - /// Open mode. int open_mode_; diff --git a/deps/acelite/ace/DLL_Manager.cpp b/deps/acelite/ace/DLL_Manager.cpp index 09f3e2f40..815109789 100644 --- a/deps/acelite/ace/DLL_Manager.cpp +++ b/deps/acelite/ace/DLL_Manager.cpp @@ -1,5 +1,6 @@ #include "ace/DLL_Manager.h" +#include "ace/Auto_Ptr.h" #include "ace/Log_Category.h" #include "ace/ACE.h" #include "ace/Framework_Component.h" @@ -28,9 +29,15 @@ ACE_DLL_Handle::~ACE_DLL_Handle (void) { ACE_TRACE ("ACE_DLL_Handle::~ACE_DLL_Handle"); this->close (1); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(this->dll_name_); +#else delete[] this->dll_name_; +#endif /* ACE_HAS_ALLOC_HOOKS */ } +ACE_ALLOC_HOOK_DEFINE(ACE_DLL_Handle) + const ACE_TCHAR * ACE_DLL_Handle::dll_name (void) const { @@ -55,7 +62,7 @@ ACE_DLL_Handle::open (const ACE_TCHAR *dll_name, if (ACE::debug ()) ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("ACE (%P|%t) DLL_Handle::open: error, ") - ACE_TEXT ("tried to reopen %s with name %s\n"), + ACE_TEXT ("tried to reopen <%s> with name <%s>\n"), this->dll_name_, dll_name)); @@ -110,147 +117,64 @@ ACE_DLL_Handle::open (const ACE_TCHAR *dll_name, this->get_dll_names (dll_name, dll_names); #endif - ACE_Array_Iterator name_iter (dll_names); ACE_TString *name = 0; - while (name_iter.next (name)) + for (ACE_Array_Iterator name_iter (dll_names); + name_iter.next (name); name_iter.advance ()) { - // The ACE_SHLIB_HANDLE object is obtained. - this->handle_ = ACE_OS::dlopen (name->c_str (), - open_mode); - - if (ACE::debug ()) - { - ACE_TString err; - ACELIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ") - ACE_TEXT ("(\"%s\", 0x%x) -> %s: %s\n"), - name->c_str (), - open_mode, - ((this->handle_ != ACE_SHLIB_INVALID_HANDLE) - ? ACE_TEXT ("succeeded") - : ACE_TEXT ("failed")), - this->error (err).c_str())); - } - - if (this->handle_ != ACE_SHLIB_INVALID_HANDLE) // Good one? + if (this->open_i (name->c_str (), open_mode, errors)) break; - // If errno is ENOENT we just skip over this one, - // anything else - like an undefined symbol, for - // instance must be flagged here or the next error will - // mask it. - // @TODO: If we've found our DLL _and_ it's - // broken, should we continue at all? - if ((errno != 0) && (errno != ENOENT) && (errors || ACE::debug ())) - { - ACE_TString errtmp; - if (errors) - { - errors->push (this->error (errtmp)); - } - - if (ACE::debug ()) - { - if (!errors) - this->error (errtmp); - ACELIB_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ") - ACE_TEXT ("(\'%s\') failed, errno=") - ACE_TEXT ("%d: <%s>\n"), - name->c_str (), - ACE_ERRNO_GET, - errtmp.c_str ())); - } - } - #if defined (AIX) +# define SHR_O ACE_TEXT("(shr.o)") +# define SHR_O_LEN (sizeof (SHR_O) / sizeof(ACE_TCHAR) - 1) // AIX often puts the shared library file (most often named // shr.o) inside an archive library. If this is an archive // library name, then try appending [shr.o] and retry. if (ACE_TString::npos != name->strstr (ACE_TEXT (".a"))) { ACE_TCHAR aix_pathname[MAXPATHLEN + 1]; - ACE_OS::strncpy (aix_pathname, - name->c_str (), - name->length ()); - aix_pathname[name->length ()] = '\0'; - ACE_OS::strcat (aix_pathname, ACE_TEXT ("(shr.o)")); - open_mode |= RTLD_MEMBER; - - if (ACE::debug ()) + if (name->length () + SHR_O_LEN <= MAXPATHLEN) { - ACE_TString err; - ACELIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ") - ACE_TEXT ("(\"%s\", 0x%x) -> %s: %s\n"), - aix_pathname, - open_mode, - (this->handle_ != ACE_SHLIB_INVALID_HANDLE - ? ACE_TEXT ("succeeded") - : ACE_TEXT ("failed")), - this->error(err).c_str())); + ACE_OS::strcpy (aix_pathname, name->c_str()); + ACE_OS::strcat (aix_pathname, SHR_O); } - - this->handle_ = ACE_OS::dlopen (aix_pathname, open_mode); - if (this->handle_ != ACE_SHLIB_INVALID_HANDLE) - break; - - // If errno is ENOENT we just skip over this one, anything - // else - like an undefined symbol, for instance - // must be flagged here or the next error will mask it. - // - // @TODO: If we've found our DLL _and_ it's broken, - // should we continue at all? - if ((errno != 0) && (errno != ENOENT) && (errors || ACE::debug ())) + else { - ACE_TString errtmp; if (errors) { - errors->push (this->error (errtmp)); + errors->push ("path is too long"); } if (ACE::debug ()) { - if (!errors) - this->error (errtmp); ACELIB_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ") - ACE_TEXT ("(\'%s\') failed, errno=") - ACE_TEXT ("%d: <%s>\n"), - name->c_str (), - ACE_ERRNO_GET, - errtmp.c_str ())); + ACE_TEXT ("ACE (%P|%t) DLL_Handle::open: ") + ACE_TEXT ("('%s(shr.o)') is too long\n"), + name->c_str())); } - } + return -1; + } + open_mode |= RTLD_MEMBER; + + if (this->open_i (aix_pathname, open_mode)) + break; } #endif /* AIX */ - - name_iter.advance (); } if (this->handle_ == ACE_SHLIB_INVALID_HANDLE) { - if (errors || ACE::debug ()) + if (ACE::debug ()) { ACE_TString errtmp; - if (errors) - { - errors->push (this->error (errtmp)); - } - - if (ACE::debug ()) - { - if (!errors) - this->error (errtmp); - ACELIB_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open (\"%s\"): ") - ACE_TEXT ("Invalid handle error: %s\n"), - this->dll_name_, - errtmp.c_str ())); - } + this->error (errtmp); + ACELIB_ERROR ((LM_ERROR, + ACE_TEXT ("ACE (%P|%t) DLL_Handle::open (\"%s\"): ") + ACE_TEXT ("Invalid handle error: %s\n"), + this->dll_name_, + errtmp.c_str ())); } - return -1; } } @@ -260,7 +184,7 @@ ACE_DLL_Handle::open (const ACE_TCHAR *dll_name, if (ACE::debug ()) ACELIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open - %s (%d), refcount=%d\n"), + ACE_TEXT ("ACE (%P|%t) DLL_Handle::open - <%s> (%d), refcount=%d\n"), this->dll_name_, this->handle_, this->refcount_)); @@ -293,7 +217,7 @@ ACE_DLL_Handle::close (int unload) if (ACE::debug ()) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE (%P|%t) DLL_Handle::close - ") - ACE_TEXT ("%s (handle=%d, refcount=%d)\n"), + ACE_TEXT ("<%s> (handle=%d, refcount=%d)\n"), this->dll_name_, this->handle_, this->refcount_)); @@ -305,7 +229,7 @@ ACE_DLL_Handle::close (int unload) if (ACE::debug ()) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE (%P|%t) DLL_Handle::close: ") - ACE_TEXT ("Unloading %s (handle=%d)\n"), + ACE_TEXT ("Unloading <%s> (handle=%d)\n"), this->dll_name_, this->handle_)); @@ -330,7 +254,7 @@ ACE_DLL_Handle::close (int unload) ACE_TString err; ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("ACE (%P|%t) DLL_Handle::close - ") - ACE_TEXT ("Failed with: \"%s\".\n"), + ACE_TEXT ("Failed with: <%s>\n"), this->error (err).c_str ())); } } @@ -378,8 +302,8 @@ ACE_DLL_Handle::symbol (const ACE_TCHAR *sym_name, bool ignore_errors, ACE_TStri if (ACE::debug ()) ACELIB_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::symbol (\"%s\") ") - ACE_TEXT (" failed with \"%s\".\n"), + ACE_TEXT ("ACE (%P|%t) DLL_Handle::symbol <%s>") + ACE_TEXT (" failed with <%s>\n"), auto_name.get (), error.c_str ())); @@ -426,13 +350,15 @@ ACE_DLL_Handle::get_handle (bool become_owner) } // This method is used return the last error of a library operation. - ACE_TString & ACE_DLL_Handle::error (ACE_TString &err) { ACE_TRACE ("ACE_DLL_Handle::error"); const ACE_TCHAR *error = ACE_OS::dlerror (); - err = (error ? error : ACE_TEXT ("no error")); + if (error) + { + err = error; + } return err; } @@ -533,6 +459,37 @@ ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name, return; } +bool +ACE_DLL_Handle::open_i (const ACE_TCHAR *dll_name, int open_mode, ERROR_STACK* errors) +{ + // The ACE_SHLIB_HANDLE object is obtained. + this->handle_ = ACE_OS::dlopen (dll_name, open_mode); + + if (errors || ACE::debug ()) + { + ACE_TString err; + this->error (err); + if (errors && err.length () > 0) + { + errors->push (err); + } + if (ACE::debug ()) + { + ACELIB_DEBUG ((LM_DEBUG, + ACE_TEXT ("ACE (%P|%t) DLL_Handle::open_i ") + ACE_TEXT ("<%s>, 0x%x) -> <%s>: <%s>\n"), + dll_name, + open_mode, + ((this->handle_ != ACE_SHLIB_INVALID_HANDLE) + ? ACE_TEXT ("succeeded") + : ACE_TEXT ("failed")), + err.c_str ())); + } + } + + return this->handle_ != ACE_SHLIB_INVALID_HANDLE; +} + /******************************************************************/ // Pointer to the Singleton instance. @@ -596,6 +553,8 @@ ACE_DLL_Manager::~ACE_DLL_Manager (void) ACE_TEXT ("properly.\n"))); } +ACE_ALLOC_HOOK_DEFINE(ACE_DLL_Manager) + ACE_DLL_Handle * ACE_DLL_Manager::open_dll (const ACE_TCHAR *dll_name, int open_mode, @@ -630,7 +589,7 @@ ACE_DLL_Manager::open_dll (const ACE_TCHAR *dll_name, if (ACE::debug ()) ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("ACE (%P|%t) DLL_Manager::open_dll: Could not ") - ACE_TEXT ("open dll %s.\n"), + ACE_TEXT ("open dll <%s>\n"), dll_name)); delete temp_handle; @@ -711,9 +670,15 @@ ACE_DLL_Manager::open (int size) ACE_DLL_Handle **temp = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (temp, + static_cast (ACE_Allocator::instance()->malloc(sizeof (ACE_DLL_Handle*) * size)), + -1); +#else ACE_NEW_RETURN (temp, ACE_DLL_Handle *[size], -1); +#endif /* ACE_HAS_ALLOC_HOOKS */ this->handle_vector_ = temp; this->total_size_ = size; @@ -742,7 +707,12 @@ ACE_DLL_Manager::close (void) } } +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(this->handle_vector_); +#else delete [] this->handle_vector_; +#endif /* ACE_HAS_ALLOC_HOOKS */ + this->handle_vector_ = 0; this->current_size_ = 0; } diff --git a/deps/acelite/ace/DLL_Manager.h b/deps/acelite/ace/DLL_Manager.h index f803bc0e1..3a98d2200 100644 --- a/deps/acelite/ace/DLL_Manager.h +++ b/deps/acelite/ace/DLL_Manager.h @@ -18,7 +18,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Auto_Ptr.h" #include "ace/Containers_T.h" #include "ace/SString.h" #include "ace/os_include/os_dlfcn.h" @@ -29,7 +28,6 @@ #define ACE_DEFAULT_DLL_MANAGER_SIZE 1024 - ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -54,9 +52,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_DLL_Handle { public: - /// Error stack. Fixed size should suffice. Ignores any errors exceeding the size. - typedef ACE_Fixed_Stack < ACE_TString, 10 > ERROR_STACK; + typedef ACE_Fixed_Stack ERROR_STACK; /// Default construtor. ACE_DLL_Handle (void); @@ -139,8 +136,9 @@ public: */ ACE_SHLIB_HANDLE get_handle (bool become_owner = false); -private: + ACE_ALLOC_HOOK_DECLARE; +private: /// Returns a string explaining why or /// failed in @a err. This is used internal to print out the error to the log, /// but since this object is shared, we can't store or return the error @@ -153,12 +151,30 @@ private: void get_dll_names (const ACE_TCHAR *dll_name, ACE_Array &try_names); + /** + * This method opens and dynamically links a library/DLL. + * @param dll_name The filename or path of the DLL to load. + * @param open_mode Flags to alter the actions taken when loading the DLL. + * The possible values are: + * @li @c RTLD_LAZY (this the default): loads identifier symbols but + * not the symbols for functions, which are loaded dynamically + * on demand. + * @li @c RTLD_NOW: performs all necessary relocations when + * @a dll_name is first loaded + * @li @c RTLD_GLOBAL: makes symbols available for relocation + * processing of any other DLLs. + * @param errors Optional address of an error stack to collect any errors + * encountered. + * @retval false On failure + * @retval true On success + */ + bool open_i (const ACE_TCHAR *dll_name, int open_mode, ERROR_STACK* errors); + /// Disallow copying and assignment since we don't handle them. ACE_DLL_Handle (const ACE_DLL_Handle &); void operator= (const ACE_DLL_Handle &); private: - /// Keep track of how many ACE_DLL objects have a reference to this /// dll. sig_atomic_t refcount_; @@ -247,8 +263,9 @@ public: /// refcounts. void unload_policy (u_long unload_policy); -protected: + ACE_ALLOC_HOOK_DECLARE; +protected: /// Default constructor. ACE_DLL_Manager (int size = ACE_DLL_Manager::DEFAULT_SIZE); @@ -268,7 +285,6 @@ protected: int unload_dll (ACE_DLL_Handle *dll_handle, int force_unload = 0); private: - /// Close the singleton instance. static void close_singleton (void); @@ -277,7 +293,6 @@ private: void operator= (const ACE_DLL_Manager &); private: - /// Vector containing all loaded handle objects. ACE_DLL_Handle **handle_vector_; diff --git a/deps/acelite/ace/Default_Constants.h b/deps/acelite/ace/Default_Constants.h index 8a6c06917..383679a1e 100644 --- a/deps/acelite/ace/Default_Constants.h +++ b/deps/acelite/ace/Default_Constants.h @@ -4,7 +4,7 @@ /** * @file Default_Constants.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt * @author Jesper S. M|ller * @author and a cast of thousands... * @@ -584,5 +584,9 @@ # define ACE_SYSCALL_FAILED -1 # endif /* ACE_WIN32 */ +#if !defined (ACE_DEFAULT_ACCEPTOR_USE_SELECT) +# define ACE_DEFAULT_ACCEPTOR_USE_SELECT 1 +#endif /* ACE_DEFAULT_ACCEPTOR_USE_SELECT */ + #include /**/ "ace/post.h" #endif /*ACE_DEFAULT_CONSTANTS_H*/ diff --git a/deps/acelite/ace/Dev_Poll_Reactor.cpp b/deps/acelite/ace/Dev_Poll_Reactor.cpp index 87d78be71..55cb4d4d5 100644 --- a/deps/acelite/ace/Dev_Poll_Reactor.cpp +++ b/deps/acelite/ace/Dev_Poll_Reactor.cpp @@ -42,6 +42,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE(ACE_Dev_Poll_Reactor) +ACE_ALLOC_HOOK_DEFINE(ACE_Dev_Poll_Reactor::Event_Tuple) +ACE_ALLOC_HOOK_DEFINE(ACE_Dev_Poll_Reactor_Notify) + ACE_Dev_Poll_Reactor_Notify::ACE_Dev_Poll_Reactor_Notify (void) : dp_reactor_ (0) , notification_pipe_ () @@ -72,10 +76,16 @@ ACE_Dev_Poll_Reactor_Notify::open (ACE_Reactor_Impl *r, if (this->notification_pipe_.open () == -1) return -1; -#if defined (F_SETFD) +#if defined (F_SETFD) && !defined (ACE_LACKS_FCNTL) // close-on-exec - ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1); - ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1); + if (ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1) == -1) + { + return -1; + } + if (ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1) == -1) + { + return -1; + } #endif /* F_SETFD */ #if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) @@ -2533,7 +2543,7 @@ ACE_Dev_Poll_Reactor::Token_Guard::acquire_quietly (ACE_Time_Value *max_wait) } // We got the token and so let us mark ourselves as owner - this->owner_ = 1; + this->owner_ = true; return result; } @@ -2568,7 +2578,7 @@ ACE_Dev_Poll_Reactor::Token_Guard::acquire (ACE_Time_Value *max_wait) } // We got the token and so let us mark ourseleves as owner - this->owner_ = 1; + this->owner_ = true; return result; } diff --git a/deps/acelite/ace/Dev_Poll_Reactor.h b/deps/acelite/ace/Dev_Poll_Reactor.h index 31f942e3e..ed8640a30 100644 --- a/deps/acelite/ace/Dev_Poll_Reactor.h +++ b/deps/acelite/ace/Dev_Poll_Reactor.h @@ -51,7 +51,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Sig_Handler; class ACE_Dev_Poll_Reactor; - // --------------------------------------------------------------------- /** @@ -67,7 +66,6 @@ class ACE_Dev_Poll_Reactor; class ACE_Dev_Poll_Reactor_Notify : public ACE_Reactor_Notify { public: - /// Constructor ACE_Dev_Poll_Reactor_Notify (void); @@ -99,7 +97,7 @@ public: /// Unimplemented method required by pure virtual method in abstract /// base class. /** - * This method's interface is not very compatibile with this + * This method's interface is not very compatible with this * Reactor's design. It's not clear why this method is pure virtual * either. */ @@ -166,6 +164,8 @@ public: /// 0 if there were only wake-ups (no handlers to dispatch). int dequeue_one (ACE_Notification_Buffer &nb); + ACE_ALLOC_HOOK_DECLARE; + protected: /** @@ -290,6 +290,8 @@ class ACE_Export ACE_Dev_Poll_Reactor : public ACE_Reactor_Impl /// Flag to say whether or not this handle is registered with epoll. bool controlled; + + ACE_ALLOC_HOOK_DECLARE; }; @@ -313,7 +315,6 @@ class ACE_Export ACE_Dev_Poll_Reactor : public ACE_Reactor_Impl class Handler_Repository { public: - /// Constructor. Handler_Repository (void); @@ -375,7 +376,7 @@ class ACE_Export ACE_Dev_Poll_Reactor : public ACE_Reactor_Impl /// Returns the current table size. size_t size (void) const; - /// Returns the current table size. + /// Returns the maximum table size. size_t max_size (void) const; /// Dump the state of an object. @@ -385,7 +386,6 @@ class ACE_Export ACE_Dev_Poll_Reactor : public ACE_Reactor_Impl ACE_ALLOC_HOOK_DECLARE; private: - /// Current number of handles. int size_; @@ -402,7 +402,6 @@ class ACE_Export ACE_Dev_Poll_Reactor : public ACE_Reactor_Impl }; public: - /// Initialize @c ACE_Dev_Poll_Reactor with the default size. /** * The default size for the @c ACE_Dev_Poll_Reactor is the maximum @@ -752,7 +751,7 @@ public: * Set the maximum number of times that ACE_Reactor_Impl will * iterate and dispatch the ACE_Event_Handlers that are passed in * via the notify queue before breaking out of its - * loop. By default, this is set to + * ACE_Message_Queue::dequeue() loop. By default, this is set to * -1, which means "iterate until the queue is empty." Setting this * to a value like "1 or 2" will increase "fairness" (and thus * prevent starvation) at the expense of slightly higher dispatching @@ -764,7 +763,7 @@ public: * Get the maximum number of times that the ACE_Reactor_Impl will * iterate and dispatch the ACE_Event_Handlers that are passed in * via the notify queue before breaking out of its - * loop. + * ACE_Message_Queue::dequeue() loop. */ virtual int max_notify_iterations (void); @@ -999,7 +998,6 @@ protected: short reactor_mask_to_poll_event (ACE_Reactor_Mask mask); protected: - /// Has the reactor been initialized. bool initialized_; @@ -1102,7 +1100,6 @@ protected: class ACE_Export Token_Guard { public: - /// Constructor that will grab the token for us Token_Guard (ACE_Dev_Poll_Reactor_Token &token); @@ -1115,7 +1112,7 @@ protected: /// Returns whether the thread that created this object owns the /// token or not. - int is_owner (void); + bool is_owner (void); /// A helper method that acquires the token 1) at a low priority, and /// 2) wait quietly for the token, not waking another thread. This @@ -1129,20 +1126,17 @@ protected: int acquire (ACE_Time_Value *max_wait = 0); private: - Token_Guard (void); private: - /// The Reactor token. ACE_Dev_Poll_Reactor_Token &token_; /// Flag that indicate whether the thread that created this object - /// owns the token or not. A value of 0 indicates that this class - /// hasn't got the token (and hence the thread) and a value of 1 + /// owns the token or not. A value of false indicates that this class + /// hasn't got the token (and hence the thread) and a value of true /// vice-versa. - int owner_; - + bool owner_; }; }; @@ -1161,7 +1155,6 @@ protected: class ACE_Dev_Poll_Handler_Guard { public: - /// Constructor /** * The constructor checks to see if @a eh is a reference-counted handler and @@ -1185,13 +1178,11 @@ public: void release (void); private: - /// The event handler being managed. ACE_Event_Handler *eh_; /// true if eh_ is a reference-counted handler. bool refcounted_; - }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Dev_Poll_Reactor.inl b/deps/acelite/ace/Dev_Poll_Reactor.inl index aedd57057..2b69631f2 100644 --- a/deps/acelite/ace/Dev_Poll_Reactor.inl +++ b/deps/acelite/ace/Dev_Poll_Reactor.inl @@ -97,17 +97,17 @@ ACE_INLINE ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard (ACE_Dev_Poll_Reactor_Token &token) : token_ (token), - owner_ (0) + owner_ (false) { } ACE_INLINE ACE_Dev_Poll_Reactor::Token_Guard::~Token_Guard (void) { - if (this->owner_ == 1) + if (this->owner_) { ACE_MT (this->token_.release ()); - this->owner_ = 0; + this->owner_ = false; } } @@ -119,11 +119,11 @@ ACE_Dev_Poll_Reactor::Token_Guard::release_token (void) ACE_MT (this->token_.release ()); // We are not the owner anymore.. - this->owner_ = 0; + this->owner_ = false; } } -ACE_INLINE int +ACE_INLINE bool ACE_Dev_Poll_Reactor::Token_Guard::is_owner (void) { return this->owner_; diff --git a/deps/acelite/ace/Dirent.h b/deps/acelite/ace/Dirent.h index a1acbedd4..1981a3212 100644 --- a/deps/acelite/ace/Dirent.h +++ b/deps/acelite/ace/Dirent.h @@ -7,7 +7,7 @@ * Define a portable C++ interface to ACE_OS_Dirent directory-entry * manipulation. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -33,7 +33,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Dirent { public: - // = Initialization and termination methods. /// Default constructor. ACE_Dirent (void); diff --git a/deps/acelite/ace/Dirent_Selector.cpp b/deps/acelite/ace/Dirent_Selector.cpp index 3e7105997..f16d1da68 100644 --- a/deps/acelite/ace/Dirent_Selector.cpp +++ b/deps/acelite/ace/Dirent_Selector.cpp @@ -7,6 +7,10 @@ #include "ace/OS_NS_dirent.h" #include "ace/OS_NS_stdlib.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Construction/Destruction @@ -40,12 +44,24 @@ ACE_Dirent_Selector::close (void) #if defined (ACE_LACKS_STRUCT_DIR) // Only the lacking-struct-dir emulation allocates this. Native // scandir includes d_name in the dirent struct itself. +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->namelist_[n_]->d_name); +#else ACE_OS::free (this->namelist_[n_]->d_name); +#endif /* ACE_HAS_ALLOC_HOOKS */ #endif +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->namelist_[n_]); +#else ACE_OS::free (this->namelist_[n_]); +#endif /* ACE_HAS_ALLOC_HOOKS */ } +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->namelist_); +#else ACE_OS::free (this->namelist_); +#endif /* ACE_HAS_ALLOC_HOOKS */ this->namelist_ = 0; return 0; } diff --git a/deps/acelite/ace/Dirent_Selector.h b/deps/acelite/ace/Dirent_Selector.h index 0de9dc085..5f3051cf1 100644 --- a/deps/acelite/ace/Dirent_Selector.h +++ b/deps/acelite/ace/Dirent_Selector.h @@ -4,7 +4,7 @@ /** * @file Dirent_Selector.h * - * Define a portable C++ interface to the method. + * Define a portable C++ interface to the method. * * @author Rich Newman */ diff --git a/deps/acelite/ace/Dump.cpp b/deps/acelite/ace/Dump.cpp index 1dbb02175..576417e81 100644 --- a/deps/acelite/ace/Dump.cpp +++ b/deps/acelite/ace/Dump.cpp @@ -4,7 +4,9 @@ #include "ace/Object_Manager.h" #include "ace/Log_Category.h" - +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -52,6 +54,8 @@ ACE_ODB::ACE_ODB (void) ACE_TRACE ("ACE_ODB::ACE_ODB"); } +ACE_ALLOC_HOOK_DEFINE(ACE_ODB) + ACE_ODB * ACE_ODB::instance (void) { diff --git a/deps/acelite/ace/Dump.h b/deps/acelite/ace/Dump.h index 5c32e0525..09eafd1a6 100644 --- a/deps/acelite/ace/Dump.h +++ b/deps/acelite/ace/Dump.h @@ -127,6 +127,8 @@ public: /// Interface to the Singleton instance of the object database. static ACE_ODB *instance (void); + ACE_ALLOC_HOOK_DECLARE; + private: ACE_ODB (void); // Ensure we have a Singleton... diff --git a/deps/acelite/ace/Dump_T.h b/deps/acelite/ace/Dump_T.h index b8859d113..d20fae850 100644 --- a/deps/acelite/ace/Dump_T.h +++ b/deps/acelite/ace/Dump_T.h @@ -38,7 +38,6 @@ template class ACE_Dumpable_Adapter : public ACE_Dumpable { public: - // = Initialization and termination methods. ACE_Dumpable_Adapter (const Concrete *t); ~ACE_Dumpable_Adapter (void); diff --git a/deps/acelite/ace/Dynamic.cpp b/deps/acelite/ace/Dynamic.cpp index f4e9708b9..469d67e40 100644 --- a/deps/acelite/ace/Dynamic.cpp +++ b/deps/acelite/ace/Dynamic.cpp @@ -18,6 +18,8 @@ ACE_Dynamic::ACE_Dynamic (void) ACE_TRACE ("ACE_Dynamic::ACE_Dynamic"); } +ACE_ALLOC_HOOK_DEFINE(ACE_Dynamic) + /* static */ ACE_Dynamic * ACE_Dynamic::instance (void) { diff --git a/deps/acelite/ace/Dynamic.h b/deps/acelite/ace/Dynamic.h index 83bc055f3..202d000dc 100644 --- a/deps/acelite/ace/Dynamic.h +++ b/deps/acelite/ace/Dynamic.h @@ -32,7 +32,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Dynamic { public: - // = Initialization and termination method. /// Constructor. ACE_Dynamic (void); @@ -54,6 +53,8 @@ public: static ACE_Dynamic *instance (void); + ACE_ALLOC_HOOK_DECLARE; + private: /** * Flag that indicates that the object was dynamically created. This diff --git a/deps/acelite/ace/Dynamic_Message_Strategy.h b/deps/acelite/ace/Dynamic_Message_Strategy.h index 94b67d947..5d24157ca 100644 --- a/deps/acelite/ace/Dynamic_Message_Strategy.h +++ b/deps/acelite/ace/Dynamic_Message_Strategy.h @@ -4,7 +4,7 @@ /** * @file Dynamic_Message_Strategy.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -46,7 +46,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Dynamic_Message_Strategy { public: - /// Message priority status /// Values are defined as bit flags so that status combinations may /// be specified easily. diff --git a/deps/acelite/ace/Dynamic_Service.h b/deps/acelite/ace/Dynamic_Service.h index 95456db34..84b45b0bd 100644 --- a/deps/acelite/ace/Dynamic_Service.h +++ b/deps/acelite/ace/Dynamic_Service.h @@ -5,7 +5,7 @@ * @file Dynamic_Service.h * * @author Prashant Jain - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/Dynamic_Service_Base.h b/deps/acelite/ace/Dynamic_Service_Base.h index fe34b50af..3d4649203 100644 --- a/deps/acelite/ace/Dynamic_Service_Base.h +++ b/deps/acelite/ace/Dynamic_Service_Base.h @@ -5,7 +5,7 @@ * @file Dynamic_Service_Base.h * * @author Prashant Jain - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/ETCL/ACE_ETCL.pc.in b/deps/acelite/ace/ETCL/ACE_ETCL.pc.in deleted file mode 100644 index 89e090707..000000000 --- a/deps/acelite/ace/ETCL/ACE_ETCL.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_ETCL -Description: ACE Extended Trading Constraint Language Library -Requires: ACE -Version: @VERSION@ -Libs: -L${libdir} -lACE_ETCL -Cflags: -I${includedir} diff --git a/deps/acelite/ace/ETCL/ACE_ETCL_Parser.pc.in b/deps/acelite/ace/ETCL/ACE_ETCL_Parser.pc.in deleted file mode 100644 index 80ece055d..000000000 --- a/deps/acelite/ace/ETCL/ACE_ETCL_Parser.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_ETCL_Parser -Description: ACE Extended Trading Constraint Language Parser Library -Requires: ACE_ETCL -Version: @VERSION@ -Libs: -L${libdir} -lACE_ETCL_Parser -Cflags: -I${includedir} diff --git a/deps/acelite/ace/ETCL/ETCL.ll b/deps/acelite/ace/ETCL/ETCL.ll deleted file mode 100644 index 7cbc0c478..000000000 --- a/deps/acelite/ace/ETCL/ETCL.ll +++ /dev/null @@ -1,159 +0,0 @@ -%option noyywrap - -%{ -// ETCL.ll,v 1.5 2005/11/16 07:53:24 ossama Exp -// ======================================================================== -// -// = LIBRARY -// orbsvcs/ECTL -// -// = FILENAME -// ETCL.ll -// -// = AUTHOR -// Carlos O'Ryan based on previous work by -// Seth Widoff -// -// ======================================================================== - -#include "ace/ETCL/ETCL_Interpreter.h" -#include "ace/ETCL/ETCL_y.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -static const char * extract_string(char*); - -#define YY_LEX_DEBUG - -#ifdef CONSTRAINT_DEBUG -#define YY_LEX_DEBUG OS::fprintf(stderr, "%s\n", yytext) -#endif /* CONSTRAINT_DEBUG */ - -#define YY_DECL int ETCL_yylex (ETCL_YYSTYPE *lvalp, void* state) - -#define YY_BREAK -#define YY_NO_UNPUT - -%} - -white_space [ \t] -letter [a-zA-Z] -digit [0-9] -alpha_num ({letter}|{digit}) -integer {digit}+ -float ({digit}*\.{digit}+)([eE][-+]?{digit}+)? -string '(([^'\\]*)|([^'\\]*\\')|([^'\\]*\\\\))*' -base {letter}({alpha_num}|[_])* -ident {base}|\\{base} -newline \n - -%% - -min { YY_LEX_DEBUG; return ETCL_MIN; } -max { YY_LEX_DEBUG; return ETCL_MAX; } -first { YY_LEX_DEBUG; return ETCL_FIRST; } -random { YY_LEX_DEBUG; return ETCL_RANDOM; } -with { YY_LEX_DEBUG; return ETCL_WITH; } -exist { YY_LEX_DEBUG; return ETCL_EXIST; } -not { YY_LEX_DEBUG; return ETCL_NOT; } -and { YY_LEX_DEBUG; return ETCL_AND; } -or { YY_LEX_DEBUG; return ETCL_OR; } -in { YY_LEX_DEBUG; return ETCL_IN; } -"~" { YY_LEX_DEBUG; return ETCL_TWIDDLE; } -"+" { YY_LEX_DEBUG; return ETCL_PLUS; } -"-" { YY_LEX_DEBUG; return ETCL_MINUS; } -"*" { YY_LEX_DEBUG; return ETCL_MULT; } -"/" { YY_LEX_DEBUG; return ETCL_DIV; } -"<" { YY_LEX_DEBUG; return ETCL_LT; } -"<=" { YY_LEX_DEBUG; return ETCL_LE; } -">" { YY_LEX_DEBUG; return ETCL_GT; } -">=" { YY_LEX_DEBUG; return ETCL_GE; } -"==" { YY_LEX_DEBUG; return ETCL_EQ; } -"!=" { YY_LEX_DEBUG; return ETCL_NE; } -"(" { YY_LEX_DEBUG; return ETCL_LPAREN; } -")" { YY_LEX_DEBUG; return ETCL_RPAREN; } -"$" { YY_LEX_DEBUG; return ETCL_DOLLAR; } -"." { YY_LEX_DEBUG; return ETCL_DOT; } -"default" { YY_LEX_DEBUG; return ETCL_DEFAULT; } -"_d" { YY_LEX_DEBUG; return ETCL_DISCRIMINANT; } -"_type_id" { YY_LEX_DEBUG; return ETCL_TYPE_ID; } -"_repos_id" { YY_LEX_DEBUG; return ETCL_REPOS_ID; } -"_length" { YY_LEX_DEBUG; return ETCL_LENGTH; } -"[" { YY_LEX_DEBUG; return ETCL_LBRA; } -"]" { YY_LEX_DEBUG; return ETCL_RBRA; } -TRUE { - lvalp->constraint = - new ETCL_Literal_Constraint ((CORBA::Boolean) 1); - YY_LEX_DEBUG; return ETCL_BOOLEAN; - } -FALSE { - lvalp->constraint = - new ETCL_Literal_Constraint ((CORBA::Boolean) 0); - YY_LEX_DEBUG; return ETCL_BOOLEAN; - } -{integer} { - lvalp->constraint = - new ETCL_Literal_Constraint (ACE_OS::atoi (yytext)); - YY_LEX_DEBUG; return ETCL_INTEGER; - } -{float} { - double v; - sscanf (yytext, "%lf", &v); - lvalp->constraint = - new ETCL_Literal_Constraint (v); - YY_LEX_DEBUG; return ETCL_FLOAT; - } -{string} { - lvalp->constraint = - new ETCL_Literal_Constraint (extract_string (yytext)); - YY_LEX_DEBUG; return ETCL_STRING; - } -{ident} { - lvalp->constraint = - new ETCL_Identifier (yytext); - YY_LEX_DEBUG; return ETCL_IDENT; - } -{white_space} { - YY_LEX_DEBUG; break; // Ignore - } -. { - YY_LEX_DEBUG; break; // @@ TODO - } -%% - -const char* -extract_string(char* str) -{ - char *t = str; - for (char * i = str + 1; *i != '\''; ++i, ++t) - { - if (*i == '\\') - { - ++i; - if (*i == 0) - return 0; - else if (*i == 't') - *t = '\t'; - else if (*i == 'n') - *t = '\n'; - else if (*i == '\\') - *t = '\\'; - else - *t = *i; - continue; - } - - *t = *i; - } - - *t = '\0'; - return str; -} - -int -yywrap (void) -{ - return 1; -} - -ACE_END_VERSIONED_NAMESPACE_DECL \ No newline at end of file diff --git a/deps/acelite/ace/ETCL/ETCL.mpc b/deps/acelite/ace/ETCL/ETCL.mpc deleted file mode 100644 index 20d387cbd..000000000 --- a/deps/acelite/ace/ETCL/ETCL.mpc +++ /dev/null @@ -1,62 +0,0 @@ -// -*- MPC -*- -project(ACE_ETCL) : acelib, install, ace_output { - sharedname = ACE_ETCL - dynamicflags += ACE_ETCL_BUILD_DLL - - Source_Files { - ETCL_Constraint.cpp - ETCL_Constraint_Visitor.cpp - } - - Header_Files { - ETCL_Constraint.h - ETCL_Constraint_Visitor.h - ace_etcl_export.h - } - - Inline_Files { - ETCL_Constraint.inl - } - - Template_Files { - } - - Pkgconfig_Files { - ACE_ETCL.pc.in - } - - specific { - install_dir = ace/ETCL - } -} - -project(ACE_ETCL_Parser) : acelib, ace_etcl, install, ace_output { - sharedname = ACE_ETCL_Parser - dynamicflags += ETCL_PARSER_BUILD_DLL - - Source_Files { - ETCL_Interpreter.cpp - ETCL_l.cpp - ETCL_y.cpp - } - - Header_Files { - ETCL_Interpreter.h - ETCL_y.h - etcl_parser_export.h - } - - Inline_Files { - } - - Template_Files { - } - - Pkgconfig_Files { - ACE_ETCL_Parser.pc.in - } - - specific { - install_dir = ace/ETCL - } -} diff --git a/deps/acelite/ace/ETCL/ETCL.yy b/deps/acelite/ace/ETCL/ETCL.yy deleted file mode 100644 index 507b8b974..000000000 --- a/deps/acelite/ace/ETCL/ETCL.yy +++ /dev/null @@ -1,269 +0,0 @@ -%{ -// $Id$ -// ======================================================================== -// -// = LIBRARY -// orbsvcs / Extended Trader Constraint Language parser. -// -// = FILENAME -// ETCL.yy -// -// = AUTHOR -// Carlos O'Ryan based on previous work by -// Seth Widoff -// Jeff Parsons -// -// ======================================================================== - -#include "ace/ETCL/ETCL_y.h" -#include "ace/ETCL/ETCL_constraint.h" -#include "ace/ETCL/ETCL_Interpreter.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -extern int yylex (void); -extern void yyflush_current_buffer (void); - -static void yyerror (const char *) -{ - // @@ TODO - // Ignore error messages -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -%} - -%token ETCL_GT -%token ETCL_GE -%token ETCL_LT -%token ETCL_LE -%token ETCL_EQ -%token ETCL_NE -%token ETCL_EXIST -%token ETCL_DEFAULT -%token ETCL_AND -%token ETCL_OR -%token ETCL_NOT -%token ETCL_IN -%token ETCL_TWIDDLE -%token ETCL_BOOLEAN -%token ETCL_PLUS -%token ETCL_MINUS -%token ETCL_MULT -%token ETCL_DIV -%token ETCL_UMINUS -%token ETCL_INTEGER -%token ETCL_FLOAT -%token ETCL_STRING -%token ETCL_RPAREN -%token ETCL_LPAREN -%token ETCL_RBRA -%token ETCL_LBRA -%token ETCL_IDENT -%token ETCL_UNSIGNED -%token ETCL_SIGNED -%token ETCL_DOUBLE -%token ETCL_CONSTRAINT -%token ETCL_COMPONENT -%token ETCL_WITH -%token ETCL_MAX -%token ETCL_MIN -%token ETCL_FIRST -%token ETCL_RANDOM -%token ETCL_DOLLAR -%token ETCL_DOT -%token ETCL_DISCRIMINANT -%token ETCL_LENGTH -%token ETCL_TYPE_ID -%token ETCL_REPOS_ID - - -%type ETCL_IDENT -%type ETCL_BOOLEAN -%type ETCL_STRING -%type ETCL_FLOAT -%type ETCL_INTEGER -%type expr_in -%type constraint preference bool_or bool_and bool_compare -%type expr_in expr_twiddle expr term factor_not factor -%type union_pos union_val component_array -%type component_array component_assoc component_pos -%type component_dot component_ext component - -%start constraint - -%% - -constraint: bool_or - | preference - ; - -preference: ETCL_MIN bool_or - { $$ = new ETCL_PREFERENCE_CLASS (ETCL_MIN, $2); } - | ETCL_MAX bool_or - { $$ = new ETCL_PREFERENCE_CLASS (ETCL_MAX, $2); } - | ETCL_WITH bool_or - { $$ = new ETCL_PREFERENCE_CLASS (ETCL_WITH, $2); } - | ETCL_FIRST - { $$ = new ETCL_PREFERENCE_CLASS (ETCL_FIRST); } - | ETCL_RANDOM - { $$ = new ETCL_PREFERENCE_CLASS (ETCL_RANDOM); } - ; - -bool_or: bool_or ETCL_OR bool_and - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_OR, $1, $3); } - | bool_and - ; - -bool_and: bool_and ETCL_AND bool_compare - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_AND, $1, $3); } - | bool_compare - ; - -bool_compare: expr_in ETCL_EQ expr_in - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_EQ, $1, $3); } - | expr_in ETCL_NE expr_in - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_NE, $1, $3); } - | expr_in ETCL_GT expr_in - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_GT, $1, $3); } - | expr_in ETCL_GE expr_in - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_GE, $1, $3); } - | expr_in ETCL_LT expr_in - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_LT, $1, $3); } - | expr_in ETCL_LE expr_in - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_LE, $1, $3); } - | expr_in - ; - -expr_in: expr_twiddle ETCL_IN component - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_IN, $1, $3); } - | expr_twiddle ETCL_IN ETCL_DOLLAR component - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_IN, $1, $4); } - | expr_twiddle - ; - -expr_twiddle: expr ETCL_TWIDDLE expr - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_TWIDDLE, $1, $3); } - | expr - ; - -expr: expr ETCL_PLUS term - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_PLUS, $1, $3); } - | expr ETCL_MINUS term - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_MINUS, $1, $3); } - | term - ; - -term: term ETCL_MULT factor_not - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_MULT, $1, $3); } - | term ETCL_DIV factor_not - { $$ = new ETCL_BINARY_EXPR_CLASS (ETCL_DIV, $1, $3); } - | factor_not - ; - -factor_not: ETCL_NOT factor - { $$ = new ETCL_UNARY_EXPR_CLASS (ETCL_NOT, $2); } - | factor - ; - -factor: ETCL_LPAREN bool_or ETCL_RPAREN - { $$ = $2; } - | ETCL_INTEGER - { $$ = $1; } - | ETCL_PLUS ETCL_INTEGER - { $$ = new ETCL_UNARY_EXPR_CLASS (ETCL_PLUS, $2); } - | ETCL_MINUS ETCL_INTEGER - { $$ = new ETCL_UNARY_EXPR_CLASS (ETCL_MINUS, $2); } - | ETCL_FLOAT - { $$ = $1; } - | ETCL_PLUS ETCL_FLOAT - { $$ = new ETCL_UNARY_EXPR_CLASS (ETCL_PLUS, $2); } - | ETCL_MINUS ETCL_FLOAT - { $$ = new ETCL_UNARY_EXPR_CLASS (ETCL_MINUS, $2); } - | ETCL_STRING - { $$ = $1; } - | ETCL_BOOLEAN - { $$ = $1; } - | ETCL_EXIST ETCL_IDENT - { $$ = new ETCL_EXIST_CLASS ($2); } - | ETCL_EXIST ETCL_DOLLAR component - { $$ = new ETCL_EXIST_CLASS ($3); } - | ETCL_DEFAULT ETCL_DOLLAR component - { $$ = new ETCL_DEFAULT_CLASS ($3); } - | ETCL_DOLLAR component - { $$ = new ETCL_EVAL_CLASS ($2); } - | ETCL_IDENT - { $$ = $1; } - ; - -component: /* empty */ - { $$ = 0; } - | ETCL_DOT component_dot - { $$ = new ETCL_DOT_CLASS ($2); } - - | ETCL_IDENT component_ext - { $$ = new ETCL_COMPONENT_CLASS ($1, $2); } - - | component_array - | component_assoc - ; - -component_ext: /* empty */ - { $$ = 0; } - | ETCL_DOT component_dot - { $$ = new ETCL_Dot ($2); } - - | component_array - | component_assoc - ; - -component_dot: ETCL_IDENT component_ext - { $$ = new ETCL_COMPONENT_CLASS ($1, $2); } - | ETCL_LENGTH - { $$ = new ETCL_SPECIAL_CLASS (ETCL_LENGTH); } - | ETCL_DISCRIMINANT - { $$ = new ETCL_SPECIAL_CLASS (ETCL_DISCRIMINANT); } - | ETCL_TYPE_ID - { $$ = new ETCL_SPECIAL_CLASS (ETCL_TYPE_ID); } - | ETCL_REPOS_ID - { $$ = new ETCL_SPECIAL_CLASS (ETCL_REPOS_ID); } - | component_pos - | union_pos - ; - -component_array: ETCL_LBRA ETCL_INTEGER ETCL_RBRA component_ext - { $$ = new ETCL_COMPONENT_ARRAY_CLASS ($2, $4); } - ; - -component_assoc: ETCL_LPAREN ETCL_IDENT ETCL_RPAREN component_ext - { $$ = new ETCL_COMPONENT_ASSOC_CLASS ($2, $4); } - ; - -component_pos: ETCL_INTEGER component_ext - { $$ = new ETCL_COMPONENT_POS_CLASS ($1, $2); } - ; - -union_pos: ETCL_LPAREN union_val ETCL_RPAREN component_ext - { $$ = new ETCL_UNION_POS_CLASS ($2, $4); } - ; - -union_val: /* empty */ - { $$ = 0; } - | ETCL_INTEGER - { $$ = new ETCL_UNION_VALUE_CLASS (+1, $1); } - | ETCL_PLUS ETCL_INTEGER - { $$ = new ETCL_UNION_VALUE_CLASS (+1, $2); } - | ETCL_MINUS ETCL_INTEGER - { $$ = new ETCL_UNION_VALUE_CLASS (-1, $2); } - | ETCL_STRING - { $$ = new ETCL_UNION_VALUE_CLASS ($1); } - ; - -%% - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/ETCL/ETCL_Constraint.cpp b/deps/acelite/ace/ETCL/ETCL_Constraint.cpp deleted file mode 100644 index 9d38af32b..000000000 --- a/deps/acelite/ace/ETCL/ETCL_Constraint.cpp +++ /dev/null @@ -1,653 +0,0 @@ -// -*- C++ -*- -#include "ace/ACE.h" - -#include "ace/ETCL/ETCL_Constraint.h" -#include "ace/ETCL/ETCL_Constraint_Visitor.h" - -#if ! defined (__ACE_INLINE__) -#include "ace/ETCL/ETCL_Constraint.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ETCL_Constraint::ETCL_Constraint (void) -{ -} - -ETCL_Constraint::~ETCL_Constraint (void) -{ -} - -int -ETCL_Constraint::accept (ETCL_Constraint_Visitor * /* visitor */) -{ - return 0; -} - -// **************************************************************** - -ETCL_Literal_Constraint::ETCL_Literal_Constraint ( - const ETCL_Literal_Constraint & lit - ) - : ETCL_Constraint(), - type_ (ACE_ETCL_UNKNOWN) -{ - this->copy (lit); -} - -ETCL_Literal_Constraint::ETCL_Literal_Constraint ( - ACE_CDR::ULong uinteger) : type_ (ACE_ETCL_UNSIGNED) -{ - this->op_.uinteger_ = uinteger; -} - -ETCL_Literal_Constraint::ETCL_Literal_Constraint ( - ACE_CDR::Long integer) : type_ (ACE_ETCL_SIGNED) -{ - this->op_.integer_ = integer; -} - -ETCL_Literal_Constraint::ETCL_Literal_Constraint ( - ACE_CDR::Boolean boolean - ) - : type_ (ACE_ETCL_BOOLEAN) -{ - this->op_.bool_ = boolean; -} - -ETCL_Literal_Constraint::ETCL_Literal_Constraint ( - ACE_CDR::Double doub) : type_ (ACE_ETCL_DOUBLE) -{ - this->op_.double_ = doub; -} - -ETCL_Literal_Constraint::ETCL_Literal_Constraint ( - const char* str) : type_ (ACE_ETCL_STRING) -{ - this->op_.str_ = ACE::strnew (str); -} - -ETCL_Literal_Constraint::~ETCL_Literal_Constraint (void) -{ - if (this->type_ == ACE_ETCL_STRING) - { - ACE::strdelete (this->op_.str_); - } -} - -int -ETCL_Literal_Constraint::accept (ETCL_Constraint_Visitor* visitor) -{ - return visitor->visit_literal (this); -} - -Literal_Type -ETCL_Literal_Constraint::expr_type (void) const -{ - return this->type_; -} - -void -ETCL_Literal_Constraint::operator= (const ETCL_Literal_Constraint& co) -{ - this->copy (co); -} - -ETCL_Literal_Constraint::operator ACE_CDR::Boolean (void) const -{ - return (this->type_ == ACE_ETCL_BOOLEAN) ? this->op_.bool_ : false; -} - -ETCL_Literal_Constraint::operator ACE_CDR::ULong (void) const -{ - switch (this->type_) - { - case ACE_ETCL_UNSIGNED: - return this->op_.uinteger_; - case ACE_ETCL_SIGNED: - case ACE_ETCL_INTEGER: - return - (this->op_.integer_ > 0) ? (ACE_CDR::ULong) this->op_.integer_ : 0; - case ACE_ETCL_DOUBLE: - return - (this->op_.double_ > 0) ? - ((this->op_.double_ > ACE_UINT32_MAX) ? - ACE_UINT32_MAX : - (ACE_CDR::ULong) this->op_.double_) - : 0; - default: - return 0; - } -} - -ETCL_Literal_Constraint::operator ACE_CDR::Long (void) const -{ - switch (this->type_) - { - case ACE_ETCL_SIGNED: - case ACE_ETCL_INTEGER: - return this->op_.integer_; - case ACE_ETCL_UNSIGNED: - return - (this->op_.uinteger_ > (ACE_CDR::ULong) ACE_INT32_MAX) ? - ACE_INT32_MAX : (ACE_CDR::Long) this->op_.uinteger_; - case ACE_ETCL_DOUBLE: - return - (this->op_.double_ > 0) ? - ((this->op_.double_ > ACE_INT32_MAX) ? - ACE_INT32_MAX : - (ACE_CDR::Long) this->op_.double_) : - ((this->op_.double_ < ACE_INT32_MIN) ? - ACE_INT32_MIN : - (ACE_CDR::Long) this->op_.double_); - default: - return 0; - } -} - -ETCL_Literal_Constraint::operator ACE_CDR::Double (void) const -{ - switch (this->type_) - { - case ACE_ETCL_DOUBLE: - return this->op_.double_; - case ACE_ETCL_SIGNED: - case ACE_ETCL_INTEGER: - return (ACE_CDR::Double) this->op_.integer_; - case ACE_ETCL_UNSIGNED: - return (ACE_CDR::Double) this->op_.uinteger_; - default: - return 0.0; - } -} - -ETCL_Literal_Constraint::operator const char* (void) const -{ - switch (this->type_) - { - case ACE_ETCL_STRING: - return this->op_.str_; - default: - return 0; - } -} - -bool -ETCL_Literal_Constraint::operator== (const ETCL_Literal_Constraint & rhs) -{ - bool return_value = false; - Literal_Type widest_type = this->widest_type (rhs); - - switch (widest_type) - { - case ACE_ETCL_STRING: - return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) == 0); - break; - case ACE_ETCL_DOUBLE: - return_value = ACE::is_equal ((ACE_CDR::Double) *this, (ACE_CDR::Double) rhs); - break; - case ACE_ETCL_INTEGER: - case ACE_ETCL_SIGNED: - return_value = (ACE_CDR::Long) *this == (ACE_CDR::Long) rhs; - break; - case ACE_ETCL_UNSIGNED: - return_value = (ACE_CDR::ULong) *this == (ACE_CDR::ULong) rhs; - break; - case ACE_ETCL_BOOLEAN: - return_value = (ACE_CDR::Boolean) *this == (ACE_CDR::Boolean) rhs; - break; - default: - break; - } - - return return_value; -} - -bool -ETCL_Literal_Constraint::operator< (const ETCL_Literal_Constraint & rhs) -{ - bool return_value = false; - Literal_Type widest_type = this->widest_type (rhs); - - switch (widest_type) - { - case ACE_ETCL_STRING: - return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) < 0); - break; - case ACE_ETCL_DOUBLE: - return_value = (ACE_CDR::Double) *this < (ACE_CDR::Double) rhs; - break; - case ACE_ETCL_INTEGER: - case ACE_ETCL_SIGNED: - return_value = (ACE_CDR::Long) *this < (ACE_CDR::Long) rhs; - break; - case ACE_ETCL_UNSIGNED: - return_value = (ACE_CDR::ULong) *this < (ACE_CDR::ULong) rhs; - break; - case ACE_ETCL_BOOLEAN: - return_value = (ACE_CDR::Boolean) *this < (ACE_CDR::Boolean) rhs; - break; - default: - break; - } - - return return_value; -} - -bool -ETCL_Literal_Constraint::operator> (const ETCL_Literal_Constraint & rhs) -{ - bool return_value = false; - Literal_Type widest_type = this->widest_type (rhs); - - switch (widest_type) - { - case ACE_ETCL_STRING: - return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) > 0); - break; - case ACE_ETCL_DOUBLE: - return_value = (ACE_CDR::Double) *this > (ACE_CDR::Double) rhs; - break; - case ACE_ETCL_INTEGER: - case ACE_ETCL_SIGNED: - return_value = (ACE_CDR::Long) *this > (ACE_CDR::Long) rhs; - break; - case ACE_ETCL_UNSIGNED: - return_value = (ACE_CDR::ULong) *this > (ACE_CDR::ULong) rhs; - break; - default: - break; - } - - return return_value; -} - -ETCL_Literal_Constraint -ETCL_Literal_Constraint::operator+ (const ETCL_Literal_Constraint & rhs) -{ - Literal_Type widest_type = this->widest_type (rhs); - - switch (widest_type) - { - case ACE_ETCL_DOUBLE: - { - ACE_CDR::Double result = (ACE_CDR::Double) *this + (ACE_CDR::Double) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::Double) result); - } - case ACE_ETCL_INTEGER: - case ACE_ETCL_SIGNED: - { - ACE_CDR::Long result = (ACE_CDR::Long) *this + (ACE_CDR::Long) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::Long) result); - } - case ACE_ETCL_UNSIGNED: - { - ACE_CDR::ULong result = (ACE_CDR::ULong) *this + (ACE_CDR::ULong) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::ULong) result); - } - default: - return ETCL_Literal_Constraint ((ACE_CDR::Long) 0); - } -} - -ETCL_Literal_Constraint -ETCL_Literal_Constraint::operator- (const ETCL_Literal_Constraint & rhs) -{ - Literal_Type widest_type = this->widest_type (rhs); - - switch (widest_type) - { - case ACE_ETCL_DOUBLE: - { - ACE_CDR::Double result = (ACE_CDR::Double) *this - (ACE_CDR::Double) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::Double) result); - } - case ACE_ETCL_INTEGER: - case ACE_ETCL_SIGNED: - { - ACE_CDR::Long result = (ACE_CDR::Long) *this - (ACE_CDR::Long) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::Long) result); - } - case ACE_ETCL_UNSIGNED: - { - ACE_CDR::ULong result = (ACE_CDR::ULong) *this - (ACE_CDR::ULong) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::ULong) result); - } - default: - return ETCL_Literal_Constraint ((ACE_CDR::Long) 0); - } -} - -ETCL_Literal_Constraint -ETCL_Literal_Constraint::operator* (const ETCL_Literal_Constraint & rhs) -{ - Literal_Type widest_type = this->widest_type (rhs); - - switch (widest_type) - { - case ACE_ETCL_DOUBLE: - { - ACE_CDR::Double result = (ACE_CDR::Double) *this * (ACE_CDR::Double) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::Double) result); - } - case ACE_ETCL_INTEGER: - case ACE_ETCL_SIGNED: - { - ACE_CDR::Long result = (ACE_CDR::Long) *this * (ACE_CDR::Long) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::Long) result); - } - case ACE_ETCL_UNSIGNED: - { - ACE_CDR::ULong result = (ACE_CDR::ULong) *this * (ACE_CDR::ULong) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::ULong) result); - } - default: - return ETCL_Literal_Constraint ((ACE_CDR::Long) 0); - } -} - -ETCL_Literal_Constraint -ETCL_Literal_Constraint::operator/ (const ETCL_Literal_Constraint & rhs) -{ - Literal_Type widest_type = this->widest_type (rhs); - - switch (widest_type) - { - case ACE_ETCL_DOUBLE: - { - if (ACE::is_equal ((ACE_CDR::Double) rhs, 0.0)) - return ETCL_Literal_Constraint ((ACE_CDR::Double) 0.0); - - ACE_CDR::Double result = (ACE_CDR::Double) *this / (ACE_CDR::Double) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::Double) result); - } - case ACE_ETCL_INTEGER: - case ACE_ETCL_SIGNED: - { - if ((ACE_CDR::Long) rhs == 0) - return ETCL_Literal_Constraint ((ACE_CDR::Long) 0); - - ACE_CDR::Long result = (ACE_CDR::Long) *this / (ACE_CDR::Long) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::Long) result); - } - case ACE_ETCL_UNSIGNED: - { - if ((ACE_CDR::ULong) rhs == 0) - return ETCL_Literal_Constraint ((ACE_CDR::ULong) 0); - - ACE_CDR::ULong result = (ACE_CDR::ULong) *this / (ACE_CDR::ULong) rhs; - return ETCL_Literal_Constraint ((ACE_CDR::ULong) result); - } - default: - return ETCL_Literal_Constraint ((ACE_CDR::Long) 0); - } -} - -ETCL_Literal_Constraint -ETCL_Literal_Constraint::operator- (void) -{ - switch (this->type_) - { - case ACE_ETCL_DOUBLE: - return ETCL_Literal_Constraint (- this->op_.double_); - case ACE_ETCL_INTEGER: - case ACE_ETCL_SIGNED: - return ETCL_Literal_Constraint (- this->op_.integer_); - case ACE_ETCL_UNSIGNED: - return ETCL_Literal_Constraint (- (ACE_CDR::Long) this->op_.uinteger_); - default: - return ETCL_Literal_Constraint ((ACE_CDR::Long) 0); - } -} - -Literal_Type -ETCL_Literal_Constraint::widest_type (const ETCL_Literal_Constraint & rhs) -{ - Literal_Type rhs_type = rhs.expr_type (); - Literal_Type return_value = rhs_type; - - if (rhs_type != this->type_) - { - if (rhs_type > this->type_) - { - return_value = rhs_type; - } - else - { - return_value = this->type_; - } - } - - return return_value; -} - -void -ETCL_Literal_Constraint::copy (const ETCL_Literal_Constraint &lit) -{ - if (this->type_ == ACE_ETCL_STRING) - { - ACE::strdelete (this->op_.str_); - } - - this->type_ = lit.type_; - - switch (this->type_) - { - case ACE_ETCL_STRING: - this->op_.str_ = ACE::strnew (lit.op_.str_); - break; - case ACE_ETCL_DOUBLE: - this->op_.double_ = lit.op_.double_; - break; - case ACE_ETCL_UNSIGNED: - this->op_.uinteger_ = lit.op_.uinteger_; - break; - case ACE_ETCL_INTEGER: - case ACE_ETCL_SIGNED: - this->op_.integer_ = lit.op_.integer_; - break; - case ACE_ETCL_BOOLEAN: - this->op_.bool_ = lit.op_.bool_; - break; - default: - this->type_ = ACE_ETCL_UNKNOWN; - break; - } -} - -// **************************************************************** - -int -ETCL_Identifier::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_identifier (this); -} - -// **************************************************************** - -ETCL_Union_Value::~ETCL_Union_Value (void) -{ - delete this->string_; - delete this->integer_; -} - -int -ETCL_Union_Value::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_union_value (this); -} - -// **************************************************************** - -ETCL_Union_Pos::~ETCL_Union_Pos (void) -{ - delete this->component_; - delete this->union_value_; -} - -int -ETCL_Union_Pos::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_union_pos (this); -} - -// **************************************************************** - -ETCL_Component_Pos::~ETCL_Component_Pos (void) -{ - delete this->component_; - delete this->integer_; -} - -int -ETCL_Component_Pos::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_component_pos (this); -} - -// **************************************************************** - -ETCL_Component_Assoc::~ETCL_Component_Assoc (void) -{ - delete this->component_; - delete this->identifier_; -} - -int -ETCL_Component_Assoc::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_component_assoc (this); -} - -// **************************************************************** - -ETCL_Component_Array::~ETCL_Component_Array (void) -{ - delete this->component_; - delete this->integer_; -} - -int -ETCL_Component_Array::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_component_array (this); -} - -// **************************************************************** - -ETCL_Special::~ETCL_Special (void) -{} - -int -ETCL_Special::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_special (this); -} - -// **************************************************************** - -ETCL_Component::~ETCL_Component (void) -{ - delete this->component_; - delete this->identifier_; -} - -int -ETCL_Component::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_component (this); -} - -// **************************************************************** - -ETCL_Dot::~ETCL_Dot (void) -{ - delete this->component_; -} - -int -ETCL_Dot::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_dot (this); -} - -// **************************************************************** - -ETCL_Eval::~ETCL_Eval (void) -{ - delete this->component_; -} - -int -ETCL_Eval::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_eval (this); -} - -// **************************************************************** - -ETCL_Default::~ETCL_Default (void) -{ - delete this->component_; -} - -int -ETCL_Default::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_default (this); -} - -// **************************************************************** - -ETCL_Exist::~ETCL_Exist (void) -{ - delete this->component_; -} - -int -ETCL_Exist::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_exist (this); -} - -// **************************************************************** - -ETCL_Unary_Expr::~ETCL_Unary_Expr (void) -{ - delete this->subexpr_; -} - -int -ETCL_Unary_Expr::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_unary_expr (this); -} - -// **************************************************************** - -ETCL_Binary_Expr::~ETCL_Binary_Expr (void) -{ - delete this->lhs_; - delete this->rhs_; -} - -int -ETCL_Binary_Expr::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_binary_expr (this); -} - -// **************************************************************** - -ETCL_Preference::~ETCL_Preference (void) -{ - delete this->subexpr_; -} - -int -ETCL_Preference::accept (ETCL_Constraint_Visitor *visitor) -{ - return visitor->visit_preference (this); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/ETCL/ETCL_Constraint.h b/deps/acelite/ace/ETCL/ETCL_Constraint.h deleted file mode 100644 index bb1e9eec9..000000000 --- a/deps/acelite/ace/ETCL/ETCL_Constraint.h +++ /dev/null @@ -1,414 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ETCL_Constraint.h - * - * @author Carlos O'Ryan (coryan@cs.wustl.edu) - * @author Jeff Parsons (j.parsons@vanderbilt.edu) - */ -//============================================================================= - -#ifndef ACE_ETCL_CONSTRAINT_H -#define ACE_ETCL_CONSTRAINT_H - -#include /**/ "ace/pre.h" - -#include "ace/SString.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/CDR_Base.h" - -#include "ace/ETCL/ace_etcl_export.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -typedef unsigned long Literal_Type; - -class ETCL_Constraint_Visitor; - -class ACE_ETCL_Export ETCL_Constraint -{ -public: - /// Constructor and destructor - ETCL_Constraint (void); - virtual ~ETCL_Constraint (void); - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -protected: - enum - { - ACE_ETCL_STRING, - ACE_ETCL_DOUBLE, - ACE_ETCL_UNSIGNED, - ACE_ETCL_SIGNED, - ACE_ETCL_INTEGER, - ACE_ETCL_BOOLEAN, - ACE_ETCL_COMPONENT, - ACE_ETCL_UNKNOWN - }; -}; - -// **************************************************************** - -class ACE_ETCL_Export ETCL_Literal_Constraint - : public ETCL_Constraint -{ -public: - ETCL_Literal_Constraint (void); - - // = Constructors for each of the various types of literals. - - explicit ETCL_Literal_Constraint (ACE_CDR::ULong uinteger); - explicit ETCL_Literal_Constraint (ACE_CDR::Long integer); - explicit ETCL_Literal_Constraint (ACE_CDR::Boolean boolean); - explicit ETCL_Literal_Constraint (ACE_CDR::Double doub); - explicit ETCL_Literal_Constraint (const char* str); - - /// Copy constructor - ETCL_Literal_Constraint (const ETCL_Literal_Constraint& lit); - - /// Destructor. - virtual ~ETCL_Literal_Constraint(void); - - /// Visitor accept method. - virtual int accept (ETCL_Constraint_Visitor* visitor); - - Literal_Type expr_type (void) const; - - /// Assignment operator. - void operator= (const ETCL_Literal_Constraint& co); - - // Conversion routines. - operator ACE_CDR::Boolean (void) const; - operator ACE_CDR::ULong (void) const; - operator ACE_CDR::Long (void) const; - operator ACE_CDR::Double (void) const; - operator const char* (void) const; - - // Return the type represented by this MysteryOperand. - - // = Boolean operators. - - bool - operator< (const ETCL_Literal_Constraint& rhs); - - bool - operator<= (const ETCL_Literal_Constraint& rhs); - - bool - operator> (const ETCL_Literal_Constraint& rhs); - - bool - operator>= (const ETCL_Literal_Constraint& rhs); - - bool - operator== (const ETCL_Literal_Constraint& rhs); - - bool - operator!= (const ETCL_Literal_Constraint& rhs); - - // = Arithmetic operators. - - ETCL_Literal_Constraint - operator+ (const ETCL_Literal_Constraint& rhs); - - ETCL_Literal_Constraint - operator- (const ETCL_Literal_Constraint& rhs); - - ETCL_Literal_Constraint - operator* (const ETCL_Literal_Constraint& rhs); - - ETCL_Literal_Constraint - operator/ (const ETCL_Literal_Constraint& rhs); - - // Unary minus. - ETCL_Literal_Constraint - operator- (void); - - /// Ensure both operands are of the same simple numeric type. - virtual Literal_Type - widest_type (const ETCL_Literal_Constraint& rhs); - -protected: - /// Private copy method. - void copy (const ETCL_Literal_Constraint& co); - - /// Union of the possible literal types. - union - { - char* str_; - ACE_CDR::ULong uinteger_; - ACE_CDR::Long integer_; - ACE_CDR::Boolean bool_; - ACE_CDR::Double double_; - } op_; - - /// The actual types of the ETCL_Literal_Constraint. - Literal_Type type_; -}; - -// **************************************************************** - -class ACE_ETCL_Export ETCL_Identifier : public ETCL_Constraint -{ -public: - ETCL_Identifier (const char *value); - - /// Get the value - const char *value (void) const; - - // = The Constraint methods. - int accept (ETCL_Constraint_Visitor *visitor); - -private: - /// The value - ACE_CString string_; -}; - -// **************************************************************** - -class ACE_ETCL_Export ETCL_Union_Value : public ETCL_Constraint -{ -public: - ETCL_Union_Value (int sign, - ETCL_Constraint *integer); - explicit ETCL_Union_Value (ETCL_Constraint *string = 0); - virtual ~ETCL_Union_Value (void); - - int sign (void) const; - ETCL_Literal_Constraint *integer (void) const; - ETCL_Literal_Constraint *string (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - int sign_; - ETCL_Literal_Constraint *integer_; - ETCL_Literal_Constraint *string_; -}; - -class ACE_ETCL_Export ETCL_Union_Pos : public ETCL_Constraint -{ -public: - ETCL_Union_Pos (ETCL_Constraint *union_value = 0, - ETCL_Constraint *component = 0); - virtual ~ETCL_Union_Pos (void); - - ETCL_Union_Value *union_value (void) const; - ETCL_Constraint *component (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - ETCL_Union_Value *union_value_; - ETCL_Constraint *component_; -}; - -class ACE_ETCL_Export ETCL_Component_Pos : public ETCL_Constraint -{ -public: - ETCL_Component_Pos (ETCL_Constraint *integer = 0, - ETCL_Constraint *component = 0); - virtual ~ETCL_Component_Pos (void); - - ETCL_Literal_Constraint *integer (void) const; - ETCL_Constraint *component (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - ETCL_Literal_Constraint *integer_; - ETCL_Constraint *component_; -}; - -class ACE_ETCL_Export ETCL_Component_Assoc : public ETCL_Constraint -{ -public: - ETCL_Component_Assoc (ETCL_Constraint *identifier = 0, - ETCL_Constraint *component = 0); - virtual ~ETCL_Component_Assoc (void); - - ETCL_Identifier *identifier (void) const; - ETCL_Constraint *component (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - ETCL_Identifier *identifier_; - ETCL_Constraint *component_; -}; - -class ACE_ETCL_Export ETCL_Component_Array : public ETCL_Constraint -{ -public: - ETCL_Component_Array (ETCL_Constraint *integer = 0, - ETCL_Constraint *component = 0); - virtual ~ETCL_Component_Array (void); - - ETCL_Literal_Constraint *integer (void) const; - ETCL_Constraint *component (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - ETCL_Literal_Constraint *integer_; - ETCL_Constraint *component_; -}; - -class ACE_ETCL_Export ETCL_Special : public ETCL_Constraint -{ -public: - ETCL_Special (void); - ETCL_Special (int type); - virtual ~ETCL_Special (void); - - int type (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - int type_; -}; - -class ACE_ETCL_Export ETCL_Component : public ETCL_Constraint -{ -public: - ETCL_Component (ETCL_Constraint *identifier = 0, - ETCL_Constraint *component = 0); - virtual ~ETCL_Component (void); - - ETCL_Identifier *identifier (void) const; - ETCL_Constraint *component (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - ETCL_Identifier *identifier_; - ETCL_Constraint *component_; -}; - -class ACE_ETCL_Export ETCL_Dot : public ETCL_Constraint -{ -public: - explicit ETCL_Dot (ETCL_Constraint *component = 0); - virtual ~ETCL_Dot (void); - - ETCL_Constraint *component (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - ETCL_Constraint *component_; -}; - -class ACE_ETCL_Export ETCL_Eval : public ETCL_Constraint -{ -public: - explicit ETCL_Eval (ETCL_Constraint *component = 0); - virtual ~ETCL_Eval (void); - - ETCL_Constraint *component (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - ETCL_Constraint *component_; -}; - -class ACE_ETCL_Export ETCL_Default : public ETCL_Constraint -{ -public: - explicit ETCL_Default (ETCL_Constraint *component = 0); - virtual ~ETCL_Default (void); - - ETCL_Constraint *component (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - ETCL_Constraint *component_; -}; - -class ACE_ETCL_Export ETCL_Exist : public ETCL_Constraint -{ -public: - explicit ETCL_Exist (ETCL_Constraint *component = 0); - virtual ~ETCL_Exist (void); - - ETCL_Constraint *component (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - ETCL_Constraint *component_; -}; - -class ACE_ETCL_Export ETCL_Unary_Expr : public ETCL_Constraint -{ -public: - ETCL_Unary_Expr (int type, - ETCL_Constraint *subexpr); - virtual ~ETCL_Unary_Expr (void); - - int type (void) const; - ETCL_Constraint *subexpr (void) const; - - int accept (ETCL_Constraint_Visitor *visitor); - -private: - int type_; - ETCL_Constraint *subexpr_; -}; - -class ACE_ETCL_Export ETCL_Binary_Expr : public ETCL_Constraint -{ -public: - ETCL_Binary_Expr (int type, - ETCL_Constraint *lhs, - ETCL_Constraint *rhs); - virtual ~ETCL_Binary_Expr (void); - - int type (void) const; - ETCL_Constraint *rhs (void) const; - ETCL_Constraint *lhs (void) const; - - int accept (ETCL_Constraint_Visitor *visitor); - -private: - int type_; - ETCL_Constraint *lhs_; - ETCL_Constraint *rhs_; -}; - -class ACE_ETCL_Export ETCL_Preference : public ETCL_Constraint -{ -public: - ETCL_Preference (void); - ETCL_Preference (int type, - ETCL_Constraint *subexpr = 0); - virtual ~ETCL_Preference (void); - - int type (void) const; - ETCL_Constraint *subexpr (void) const; - - virtual int accept (ETCL_Constraint_Visitor *visitor); - -private: - int type_; - ETCL_Constraint *subexpr_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/ETCL/ETCL_Constraint.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif // ACE_ETCL_CONSTRAINT_H diff --git a/deps/acelite/ace/ETCL/ETCL_Constraint.inl b/deps/acelite/ace/ETCL/ETCL_Constraint.inl deleted file mode 100644 index 2ee32f420..000000000 --- a/deps/acelite/ace/ETCL/ETCL_Constraint.inl +++ /dev/null @@ -1,349 +0,0 @@ -// -*- C++ -*- -// **************************************************************** - -ACE_INLINE -ETCL_Literal_Constraint::ETCL_Literal_Constraint (void) - : type_ (ACE_ETCL_UNKNOWN) -{ -} - -// **************************************************************** - -ACE_INLINE -ETCL_Identifier::ETCL_Identifier (const char *value) - : string_ (value) -{ -} - -ACE_INLINE const char * -ETCL_Identifier::value (void) const -{ - return this->string_.c_str (); -} - - -// **************************************************************** - -ACE_INLINE -ETCL_Union_Value::ETCL_Union_Value (int sign, - ETCL_Constraint *integer) - : sign_ (sign), - string_ (0) -{ - this->integer_ = - dynamic_cast (integer); -} - -ACE_INLINE -ETCL_Union_Value::ETCL_Union_Value (ETCL_Constraint *string) - : sign_ (0), - integer_ (0) -{ - this->string_ = - dynamic_cast (string); -} - -ACE_INLINE int -ETCL_Union_Value::sign (void) const -{ - return this->sign_; -} - -ACE_INLINE ETCL_Literal_Constraint * -ETCL_Union_Value::integer (void) const -{ - return this->integer_; -} - -ACE_INLINE ETCL_Literal_Constraint * -ETCL_Union_Value::string (void) const -{ - return this->string_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Union_Pos::ETCL_Union_Pos (ETCL_Constraint *union_value, - ETCL_Constraint *component) - : component_ (component) -{ - this->union_value_ = - dynamic_cast (union_value); -} - -ACE_INLINE ETCL_Union_Value * -ETCL_Union_Pos::union_value (void) const -{ - return this->union_value_; -} - -ACE_INLINE ETCL_Constraint * -ETCL_Union_Pos::component (void) const -{ - return this->component_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Component_Pos::ETCL_Component_Pos ( - ETCL_Constraint *integer, - ETCL_Constraint *component) - : component_ (component) -{ - this->integer_ = - dynamic_cast (integer); -} - -ACE_INLINE ETCL_Literal_Constraint * -ETCL_Component_Pos::integer (void) const -{ - return this->integer_; -} - -ACE_INLINE ETCL_Constraint * -ETCL_Component_Pos::component (void) const -{ - return this->component_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Component_Assoc::ETCL_Component_Assoc ( - ETCL_Constraint *identifier, - ETCL_Constraint *component) - : component_ (component) -{ - this->identifier_ = - dynamic_cast (identifier); -} - -ACE_INLINE ETCL_Identifier * -ETCL_Component_Assoc::identifier (void) const -{ - return this->identifier_; -} - -ACE_INLINE ETCL_Constraint * -ETCL_Component_Assoc::component (void) const -{ - return this->component_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Component_Array::ETCL_Component_Array ( - ETCL_Constraint *integer, - ETCL_Constraint *component) - : component_ (component) -{ - this->integer_ = - dynamic_cast (integer); -} - -ACE_INLINE ETCL_Literal_Constraint * -ETCL_Component_Array::integer (void) const -{ - return this->integer_; -} - -ACE_INLINE ETCL_Constraint * -ETCL_Component_Array::component (void) const -{ - return this->component_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Special::ETCL_Special (void) - : type_ (0) -{} - -ACE_INLINE -ETCL_Special::ETCL_Special (int type) - : type_ (type) -{} - -ACE_INLINE int -ETCL_Special::type (void) const -{ - return this->type_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Component::ETCL_Component (ETCL_Constraint *identifier, - ETCL_Constraint *component) - : component_ (component) -{ - this->identifier_ = - dynamic_cast (identifier); -} - -ACE_INLINE ETCL_Identifier * -ETCL_Component::identifier (void) const -{ - return this->identifier_; -} - -ACE_INLINE ETCL_Constraint * -ETCL_Component::component (void) const -{ - return this->component_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Dot::ETCL_Dot (ETCL_Constraint *component) - : component_ (component) -{ -} - -ACE_INLINE ETCL_Constraint * -ETCL_Dot::component (void) const -{ - return this->component_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Eval::ETCL_Eval (ETCL_Constraint *component) - : component_ (component) -{ -} - -ACE_INLINE ETCL_Constraint * -ETCL_Eval::component (void) const -{ - return this->component_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Default::ETCL_Default (ETCL_Constraint *component) - : component_ (component) -{ -} - -ACE_INLINE ETCL_Constraint * -ETCL_Default::component (void) const -{ - return this->component_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Exist::ETCL_Exist (ETCL_Constraint *component) - : component_ (component) -{ -} - -ACE_INLINE ETCL_Constraint * -ETCL_Exist::component (void) const -{ - return this->component_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Unary_Expr::ETCL_Unary_Expr (int type, - ETCL_Constraint *subexpr) - : type_ (type), - subexpr_ (subexpr) -{} - -ACE_INLINE int -ETCL_Unary_Expr::type (void) const -{ - return this->type_; -} - -ACE_INLINE ETCL_Constraint * -ETCL_Unary_Expr::subexpr (void) const -{ - return this->subexpr_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Binary_Expr::ETCL_Binary_Expr (int type, - ETCL_Constraint *lhs, - ETCL_Constraint *rhs) - : type_ (type), - lhs_ (lhs), - rhs_ (rhs) -{} - -ACE_INLINE int -ETCL_Binary_Expr::type (void) const -{ - return this->type_; -} - -ACE_INLINE ETCL_Constraint * -ETCL_Binary_Expr::rhs (void) const -{ - return this->rhs_; -} - -ACE_INLINE ETCL_Constraint * -ETCL_Binary_Expr::lhs (void) const -{ - return this->lhs_; -} - -// **************************************************************** - -ACE_INLINE -ETCL_Preference::ETCL_Preference (void) - : type_ (0), - subexpr_ (0) -{} - -ACE_INLINE -ETCL_Preference::ETCL_Preference (int type, - ETCL_Constraint *subexpr) - : type_ (type), - subexpr_ (subexpr) -{} - -ACE_INLINE int -ETCL_Preference::type (void) const -{ - return this->type_; -} - -ACE_INLINE ETCL_Constraint * -ETCL_Preference::subexpr (void) const -{ - return this->subexpr_; -} - -ACE_INLINE bool -ETCL_Literal_Constraint::operator!= (const ETCL_Literal_Constraint & rhs) -{ - return !(*this == rhs); -} - -ACE_INLINE bool -ETCL_Literal_Constraint::operator<= (const ETCL_Literal_Constraint & rhs) -{ - return !(*this > rhs); -} - -ACE_INLINE bool -ETCL_Literal_Constraint::operator>= (const ETCL_Literal_Constraint & rhs) -{ - return !(*this < rhs); -} diff --git a/deps/acelite/ace/ETCL/ETCL_Constraint_Visitor.cpp b/deps/acelite/ace/ETCL/ETCL_Constraint_Visitor.cpp deleted file mode 100644 index 50d666025..000000000 --- a/deps/acelite/ace/ETCL/ETCL_Constraint_Visitor.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file ETCL_Constraint_Visitor.cpp - * - * @author Jeff Parsons - */ -//============================================================================= - -#include "ace/ETCL/ETCL_Constraint_Visitor.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ETCL_Constraint_Visitor::ETCL_Constraint_Visitor (void) -{ -} - -ETCL_Constraint_Visitor::~ETCL_Constraint_Visitor (void) -{ -} - -int -ETCL_Constraint_Visitor::visit_literal (ETCL_Literal_Constraint *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_identifier (ETCL_Identifier *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_union_value (ETCL_Union_Value *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_union_pos (ETCL_Union_Pos *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_component_pos (ETCL_Component_Pos *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_component_assoc (ETCL_Component_Assoc *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_component_array (ETCL_Component_Array *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_special (ETCL_Special *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_component (ETCL_Component *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_dot (ETCL_Dot *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_eval (ETCL_Eval *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_default (ETCL_Default *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_exist (ETCL_Exist *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_unary_expr (ETCL_Unary_Expr *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_binary_expr (ETCL_Binary_Expr *) -{ - return 0; -} - -int -ETCL_Constraint_Visitor::visit_preference (ETCL_Preference *) -{ - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/deps/acelite/ace/ETCL/ETCL_Constraint_Visitor.h b/deps/acelite/ace/ETCL/ETCL_Constraint_Visitor.h deleted file mode 100644 index ea790676c..000000000 --- a/deps/acelite/ace/ETCL/ETCL_Constraint_Visitor.h +++ /dev/null @@ -1,69 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file ETCL_Constraint_Visitor.h - * - * @author Carlos O'Ryan - * @author Jeff Parsons - */ -//============================================================================= - -#ifndef ACE_ETCL_CONSTRAINT_VISITOR_H -#define ACE_ETCL_CONSTRAINT_VISITOR_H - -#include /**/ "ace/pre.h" - -#include "ace/ETCL/ace_etcl_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ETCL_Literal_Constraint; -class ETCL_Identifier; -class ETCL_Union_Value; -class ETCL_Union_Pos; -class ETCL_Component_Pos; -class ETCL_Component_Assoc; -class ETCL_Component_Array; -class ETCL_Special; -class ETCL_Component; -class ETCL_Dot; -class ETCL_Eval; -class ETCL_Default; -class ETCL_Exist; -class ETCL_Unary_Expr; -class ETCL_Binary_Expr; -class ETCL_Preference; - -class ACE_ETCL_Export ETCL_Constraint_Visitor -{ -public: - ETCL_Constraint_Visitor (void); - virtual ~ETCL_Constraint_Visitor (void); - - virtual int visit_literal (ETCL_Literal_Constraint *); - virtual int visit_identifier (ETCL_Identifier *); - virtual int visit_union_value (ETCL_Union_Value *); - virtual int visit_union_pos (ETCL_Union_Pos *); - virtual int visit_component_pos (ETCL_Component_Pos *); - virtual int visit_component_assoc (ETCL_Component_Assoc *); - virtual int visit_component_array (ETCL_Component_Array *); - virtual int visit_special (ETCL_Special *); - virtual int visit_component (ETCL_Component *); - virtual int visit_dot (ETCL_Dot *); - virtual int visit_eval (ETCL_Eval *); - virtual int visit_default (ETCL_Default *); - virtual int visit_exist (ETCL_Exist *); - virtual int visit_unary_expr (ETCL_Unary_Expr *); - virtual int visit_binary_expr (ETCL_Binary_Expr *); - virtual int visit_preference (ETCL_Preference *); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif // ACE_ETCL_CONSTRAINT_VISITOR_H diff --git a/deps/acelite/ace/ETCL/ETCL_Interpreter.cpp b/deps/acelite/ace/ETCL/ETCL_Interpreter.cpp deleted file mode 100644 index cc37c48b8..000000000 --- a/deps/acelite/ace/ETCL/ETCL_Interpreter.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// -*- C++ -*- -#include "ace/Guard_T.h" -#include "ace/Truncate.h" - -#include "ace/ETCL/ETCL_Interpreter.h" -#include "ace/ETCL/ETCL_Constraint.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ETCL_Parser_Export ACE_SYNCH_MUTEX ETCL_Interpreter::parserMutex__; - -ETCL_Interpreter::ETCL_Interpreter (void) - : root_ (0) -{ -} - -ETCL_Interpreter::~ETCL_Interpreter (void) -{ - delete this->root_; -} - -int -ETCL_Interpreter::build_tree (const char* constraints) -{ - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, - guard, - ETCL_Interpreter::parserMutex__, - -1); - - Lex_String_Input::reset ((char*)constraints); - - yyval.constraint = 0; - int return_value = ::yyparse (); - - if (return_value == 0 && yyval.constraint != 0) - { - this->root_ = yyval.constraint; - } - else - { - this->root_ = 0; - } - - return return_value; -} - -int -ETCL_Interpreter::is_empty_string (const char* str) -{ - int return_value = 0; - - if (str != 0) - { - int i = 0; - - while (str[i] != '\0') - { - if (str[i] != ' ') - { - break; - } - - ++i; - } - - if (str[i] == '\0') - { - return_value = 1; - } - } - - return return_value; -} - -char* Lex_String_Input::string_ = 0; -char* Lex_String_Input::current_ = 0; -char* Lex_String_Input::end_ = 0; - -// Routine to have Lex read its input from the constraint string. - -int -Lex_String_Input::copy_into (char* buf, - int max_size) -{ - int const chars_left = - ACE_Utils::truncate_cast ( - Lex_String_Input::end_ - Lex_String_Input::current_); - - int const n = max_size > chars_left ? chars_left : max_size; - - if (n > 0) - { - ACE_OS::memcpy (buf, - Lex_String_Input::current_, - n); - Lex_String_Input::current_ += n; - } - - return n; -} - -void -Lex_String_Input::reset (char* input_string) -{ - Lex_String_Input::string_ = input_string; - Lex_String_Input::current_ = input_string; - Lex_String_Input::end_ = - input_string + ACE_OS::strlen (Lex_String_Input::string_); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/ETCL/ETCL_Interpreter.h b/deps/acelite/ace/ETCL/ETCL_Interpreter.h deleted file mode 100644 index 06fe138dd..000000000 --- a/deps/acelite/ace/ETCL/ETCL_Interpreter.h +++ /dev/null @@ -1,115 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ETCL_Interpreter.h - * - * @author Jeff Parsons based on previous work by - * @author Seth Widoff - */ -//============================================================================= - - -#ifndef ETCL_INTERPRETER_H -#define ETCL_INTERPRETER_H - -#include /**/ "ace/pre.h" - -#include "ace/Thread_Mutex.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Synch_Traits.h" - -#include "etcl_parser_export.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ETCL_Constraint; - -ACE_END_VERSIONED_NAMESPACE_DECL - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ETCL_Interpreter - * - * @brief ETCL_Interpreter is the superclass for all ETCL interpreters. - * Its build tree method invokes the yacc parser to parse a constraint - * or preference string. - */ -class ETCL_Parser_Export ETCL_Interpreter -{ -protected: - // = Initialization and termination methods. - /// Constructor. - ETCL_Interpreter (void); - - /// Destructor. - virtual ~ETCL_Interpreter (void); - - /// Using the Yacc generated parser, construct an expression tree - /// representing @a constraints from the tokens returned by it. - int build_tree (const char* constraints); - - static int is_empty_string (const char* str); - - /// The root of the expression tree, not equal to null if build_tree - /// successfully builds a tree from the constraints. - ETCL_Constraint* root_; -private: - /// This mutex protects the method from reentrance. - static ACE_SYNCH_MUTEX parserMutex__; -}; - - -// Functions we need for parsing. -extern int yyparse (void); -extern void yyrestart (FILE*); -extern int yylex (void); - -// Have yylex read from the constraint string, not from stdin. -#undef YY_INPUT -#define YY_INPUT(b, r, ms) (r = Lex_String_Input::copy_into(b, ms)) - -/** - * @class Lex_String_Input - * - * @brief Have Lex read from a string and not from stdin. Essentially, - * the interpreter needs to call yylex() until EOF, and call - * TAO_Lex_String_Input::reset() with the new string, prior to - * calling yyparse. - */ -class Lex_String_Input -{ -public: - /// Reset the lex input. - static void reset (char* input_string); - - /// Method lex will call to read from the input string. - static int copy_into (char* buf, int max_size); - -private: - - /// Pointers to keep track of the input string. - static char* string_; - static char* current_; - static char* end_; -}; - -/// The union used by lex and bison to build the Abstract Syntax Tree. -typedef union -{ - ACE_VERSIONED_NAMESPACE_NAME::ETCL_Constraint* constraint; -} YYSTYPE; - -extern YYSTYPE yylval; -extern YYSTYPE yyval; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif // ETCL_INTERPRETER_H diff --git a/deps/acelite/ace/ETCL/ETCL_l.cpp b/deps/acelite/ace/ETCL/ETCL_l.cpp deleted file mode 100644 index 4b78f5b06..000000000 --- a/deps/acelite/ace/ETCL/ETCL_l.cpp +++ /dev/null @@ -1,1875 +0,0 @@ - -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - -#include "ace/ETCL/ETCL_Constraint.h" - -#ifdef __cplusplus - -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_stdio.h" - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state -{ - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 -}; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 41 -#define YY_END_OF_BUFFER 42 -static yyconst short int yy_accept[118] = - { 0, - 0, 0, 42, 40, 39, 41, 40, 24, 40, 22, - 23, 14, 12, 13, 25, 15, 35, 16, 40, 18, - 38, 38, 38, 31, 40, 32, 40, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 11, 21, 0, - 37, 0, 36, 0, 35, 17, 20, 19, 38, 38, - 38, 38, 27, 0, 0, 0, 38, 38, 38, 38, - 10, 38, 38, 38, 9, 38, 38, 0, 0, 38, - 38, 38, 0, 0, 0, 8, 38, 38, 38, 2, - 1, 7, 38, 38, 0, 36, 38, 33, 0, 0, - 0, 38, 38, 38, 38, 5, 34, 0, 0, 0, - - 38, 6, 3, 38, 0, 0, 0, 38, 4, 30, - 0, 0, 26, 0, 28, 29, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 1, 1, 5, 1, 1, 6, 7, - 8, 9, 10, 1, 11, 12, 13, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 1, 1, 15, - 16, 17, 1, 1, 18, 19, 19, 19, 20, 21, - 19, 19, 19, 19, 19, 22, 19, 19, 19, 19, - 19, 23, 24, 25, 26, 19, 19, 19, 19, 19, - 27, 28, 29, 1, 30, 1, 31, 19, 19, 32, - - 33, 34, 35, 36, 37, 19, 19, 38, 39, 40, - 41, 42, 19, 43, 44, 45, 46, 19, 47, 48, - 49, 19, 1, 1, 1, 50, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[51] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 1, 1, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 1, 1, 1, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 1 - } ; - -static yyconst short int yy_base[122] = - { 0, - 0, 0, 146, 147, 147, 147, 129, 147, 45, 147, - 147, 147, 147, 147, 130, 147, 40, 127, 126, 125, - 0, 122, 116, 147, 0, 147, 21, 98, 104, 88, - 98, 94, 24, 92, 89, 100, 93, 147, 147, 50, - 147, 51, 48, 115, 46, 147, 147, 147, 0, 106, - 101, 0, 147, 93, 92, 75, 91, 88, 84, 77, - 0, 71, 78, 72, 0, 76, 70, 57, 60, 90, - 93, 0, 72, 69, 68, 0, 78, 64, 63, 0, - 0, 0, 74, 69, 90, 89, 82, 0, 66, 59, - 66, 52, 52, 51, 54, 0, 0, 49, 49, 54, - - 45, 0, 0, 43, 44, 47, 39, 30, 0, 147, - 35, 37, 0, 35, 147, 147, 147, 85, 87, 62, - 89 - } ; - -static yyconst short int yy_def[122] = - { 0, - 117, 1, 117, 117, 117, 117, 117, 117, 118, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 119, 119, 119, 117, 120, 117, 117, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 117, 117, 118, - 117, 117, 117, 117, 117, 117, 117, 117, 119, 119, - 119, 121, 117, 117, 117, 117, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 118, 117, 119, - 119, 121, 117, 117, 117, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 117, 117, 119, 119, 117, 117, - 117, 119, 119, 119, 119, 119, 119, 117, 117, 117, - - 119, 119, 119, 119, 117, 117, 117, 119, 119, 117, - 117, 117, 119, 117, 117, 117, 0, 117, 117, 117, - 117 - } ; - -static yyconst short int yy_nxt[198] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 21, 21, - 22, 21, 21, 21, 23, 21, 24, 25, 26, 27, - 28, 29, 30, 31, 21, 21, 32, 21, 33, 34, - 35, 21, 36, 21, 21, 21, 37, 21, 21, 38, - 41, 44, 53, 45, 62, 41, 68, 44, 54, 45, - 63, 43, 41, 55, 52, 56, 116, 69, 115, 85, - 85, 114, 42, 86, 113, 112, 111, 42, 68, 110, - 69, 109, 108, 107, 42, 40, 40, 40, 49, 49, - 72, 72, 106, 105, 104, 103, 102, 101, 100, 99, - - 98, 97, 86, 86, 96, 95, 94, 93, 92, 91, - 90, 89, 88, 87, 84, 83, 82, 81, 80, 79, - 78, 77, 76, 75, 74, 73, 71, 70, 43, 67, - 66, 65, 64, 61, 60, 59, 58, 57, 51, 50, - 48, 47, 46, 43, 39, 117, 3, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117 - - } ; - -static yyconst short int yy_chk[198] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 9, 17, 27, 17, 33, 40, 42, 45, 27, 45, - 33, 43, 68, 27, 120, 27, 114, 43, 112, 69, - 69, 111, 9, 69, 108, 107, 106, 40, 42, 105, - 43, 104, 101, 100, 68, 118, 118, 118, 119, 119, - 121, 121, 99, 98, 95, 94, 93, 92, 91, 90, - - 89, 87, 86, 85, 84, 83, 79, 78, 77, 75, - 74, 73, 71, 70, 67, 66, 64, 63, 62, 60, - 59, 58, 57, 56, 55, 54, 51, 50, 44, 37, - 36, 35, 34, 32, 31, 30, 29, 28, 23, 22, - 20, 19, 18, 15, 7, 3, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117 - - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#define INITIAL 0 - -ACE_END_VERSIONED_NAMESPACE_DECL - -//============================================================================= -/** - * @file ETCL_l.cpp - * - * @author Carlos O'Ryan based on previous work by Seth Widoff - */ -//============================================================================= - - -#include "ace/ETCL/ETCL_Interpreter.h" -#include "ace/ETCL/ETCL_y.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -static const char* extract_string(char*); -//static const char * extract_string(char*); - -#define YY_LEX_DEBUG - -#ifdef CONSTRAINT_DEBUG -#define YY_LEX_DEBUG ACE_OS::fprintf(stderr, "%s\n", yytext) -#endif /* CONSTRAINT_DEBUG */ - -//#define YY_DECL int ETCL_yylex (ETCL_YYSTYPE *lvalp, void* state) - -#define YY_BREAK -#define YY_NO_UNPUT -#define YY_NO_INPUT - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -ACE_END_VERSIONED_NAMESPACE_DECL - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -//FUZZ: disable check_for_lack_ACE_OS -#ifndef ETCL_ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ETCL_ECHO { size_t __dum_ret = fwrite( yytext, yyleng, 1, yyout ); (void) __dum_ret; } -#endif - //FUZZ: enable check_for_lack_ACE_OS - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = ACE_OS::getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = ACE_OS::fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp = 0; - register char *yy_bp = 0; - register int yy_act; - -//#line 50 "ETCL/ETCL.ll" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 118 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 147 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -//#line 52 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_MIN; } - YY_BREAK -case 2: -YY_RULE_SETUP -//#line 53 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_MAX; } - YY_BREAK -case 3: -YY_RULE_SETUP -//#line 54 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_FIRST; } - YY_BREAK -case 4: -YY_RULE_SETUP -//#line 55 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_RANDOM; } - YY_BREAK -case 5: -YY_RULE_SETUP -//#line 56 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_WITH; } - YY_BREAK -case 6: -YY_RULE_SETUP -//#line 57 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_EXIST; } - YY_BREAK -case 7: -YY_RULE_SETUP -//#line 58 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_NOT; } - YY_BREAK -case 8: -YY_RULE_SETUP -//#line 59 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_AND; } - YY_BREAK -case 9: -YY_RULE_SETUP -//#line 60 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_OR; } - YY_BREAK -case 10: -YY_RULE_SETUP -//#line 61 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_IN; } - YY_BREAK -case 11: -YY_RULE_SETUP -//#line 62 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_TWIDDLE; } - YY_BREAK -case 12: -YY_RULE_SETUP -//#line 63 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_PLUS; } - YY_BREAK -case 13: -YY_RULE_SETUP -//#line 64 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_MINUS; } - YY_BREAK -case 14: -YY_RULE_SETUP -//#line 65 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_MULT; } - YY_BREAK -case 15: -YY_RULE_SETUP -//#line 66 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_DIV; } - YY_BREAK -case 16: -YY_RULE_SETUP -//#line 67 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_LT; } - YY_BREAK -case 17: -YY_RULE_SETUP -//#line 68 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_LE; } - YY_BREAK -case 18: -YY_RULE_SETUP -//#line 69 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_GT; } - YY_BREAK -case 19: -YY_RULE_SETUP -//#line 70 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_GE; } - YY_BREAK -case 20: -YY_RULE_SETUP -//#line 71 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_EQ; } - YY_BREAK -case 21: -YY_RULE_SETUP -//#line 72 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_NE; } - YY_BREAK -case 22: -YY_RULE_SETUP -//#line 73 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_LPAREN; } - YY_BREAK -case 23: -YY_RULE_SETUP -//#line 74 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_RPAREN; } - YY_BREAK -case 24: -YY_RULE_SETUP -//#line 75 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_DOLLAR; } - YY_BREAK -case 25: -YY_RULE_SETUP -//#line 76 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_DOT; } - YY_BREAK -case 26: -YY_RULE_SETUP -//#line 77 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_DEFAULT; } - YY_BREAK -case 27: -YY_RULE_SETUP -//#line 78 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_DISCRIMINANT; } - YY_BREAK -case 28: -YY_RULE_SETUP -//#line 79 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_TYPE_ID; } - YY_BREAK -case 29: -YY_RULE_SETUP -//#line 80 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_REPOS_ID; } - YY_BREAK -case 30: -YY_RULE_SETUP -//#line 81 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_LENGTH; } - YY_BREAK -case 31: -YY_RULE_SETUP -//#line 82 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_LBRA; } - YY_BREAK -case 32: -YY_RULE_SETUP -//#line 83 "ETCL/ETCL.ll" -{ YY_LEX_DEBUG; return ETCL_RBRA; } - YY_BREAK -case 33: -YY_RULE_SETUP -//#line 84 "ETCL/ETCL.ll" -{ - yylval.constraint = - new ETCL_Literal_Constraint ((ACE_CDR::Boolean) 1); - YY_LEX_DEBUG; return ETCL_BOOLEAN; - } - YY_BREAK -case 34: -YY_RULE_SETUP -//#line 89 "ETCL/ETCL.ll" -{ - yylval.constraint = - new ETCL_Literal_Constraint ((ACE_CDR::Boolean) 0); - YY_LEX_DEBUG; return ETCL_BOOLEAN; - } - YY_BREAK -case 35: -YY_RULE_SETUP -//#line 94 "ETCL/ETCL.ll" -{ - yylval.constraint = - new ETCL_Literal_Constraint (ACE_OS::atoi (yytext)); - YY_LEX_DEBUG; return ETCL_INTEGER; - } - YY_BREAK -case 36: -YY_RULE_SETUP -//#line 99 "ETCL/ETCL.ll" -{ - double v; - sscanf (yytext, "%lf", &v); - yylval.constraint = - new ETCL_Literal_Constraint (v); - YY_LEX_DEBUG; return ETCL_FLOAT; - } - YY_BREAK -case 37: -YY_RULE_SETUP -//#line 106 "ETCL/ETCL.ll" -{ - yylval.constraint = - new ETCL_Literal_Constraint (extract_string(yytext)); - YY_LEX_DEBUG; return ETCL_STRING; - } - YY_BREAK -case 38: -YY_RULE_SETUP -//#line 111 "ETCL/ETCL.ll" -{ - yylval.constraint = - new ETCL_Identifier (yytext); - YY_LEX_DEBUG; return ETCL_IDENT; - } - YY_BREAK -case 39: -YY_RULE_SETUP -//#line 116 "ETCL/ETCL.ll" -{ - YY_LEX_DEBUG; break; // Ignore - } - YY_BREAK -case 40: -YY_RULE_SETUP -//#line 119 "ETCL/ETCL.ll" -{ - YY_LEX_DEBUG; break; // @@ TODO - } - YY_BREAK -case 41: -YY_RULE_SETUP -//#line 122 "ETCL/ETCL.ll" -ETCL_ECHO; - YY_BREAK -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 118 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 118 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 117); - - return yy_is_jam ? 0 : yy_current_state; - } - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } -#endif /* YY_NO_INPUT */ - -void yyflush_current_buffer (void) -{ - YY_FLUSH_BUFFER; -} - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if defined (ACE_HAS_WINCE) - // Mimic the behavior as WinCE does not have isatty(). - if ((file != 0) && (file == ACE_OS::fileno(file))) { - b->yy_is_interactive = 1; - } - else { - b->yy_is_interactive = 0; - } -#else - b->yy_is_interactive = file ? (ACE_OS::isatty( ACE_OS::fileno(file) ) > 0) : 0; -#endif // ACE_HAS_WINCE - - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) ACE_OS::fprintf( stderr, "%s\n", msg ); - ACE_OS::exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) ACE_OS::malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) ACE_OS::realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - ACE_OS::free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -//#line 122 "ETCL/ETCL.ll" - - -const char* -extract_string(char* str) -{ - char *t = str; - for (char * i = str + 1; *i != '\''; ++i, ++t) - { - if (*i == '\\') - { - ++i; - if (*i == 0) - return 0; - else if (*i == 't') - *t = '\t'; - else if (*i == 'n') - *t = '\n'; - else if (*i == '\\') - *t = '\\'; - else - *t = *i; - continue; - } - - *t = *i; - } - - *t = '\0'; - return str; -} - -int -yywrap (void) -{ - return 1; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/ETCL/ETCL_y.cpp b/deps/acelite/ace/ETCL/ETCL_y.cpp deleted file mode 100644 index 9fe453f62..000000000 --- a/deps/acelite/ace/ETCL/ETCL_y.cpp +++ /dev/null @@ -1,1286 +0,0 @@ - -/* A Bison parser, made from ETCL/ETCL.yy - by GNU Bison version 1.28 */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define ETCL_GT 257 -#define ETCL_GE 258 -#define ETCL_LT 259 -#define ETCL_LE 260 -#define ETCL_EQ 261 -#define ETCL_NE 262 -#define ETCL_EXIST 263 -#define ETCL_DEFAULT 264 -#define ETCL_AND 265 -#define ETCL_OR 266 -#define ETCL_NOT 267 -#define ETCL_IN 268 -#define ETCL_TWIDDLE 269 -#define ETCL_BOOLEAN 270 -#define ETCL_PLUS 271 -#define ETCL_MINUS 272 -#define ETCL_MULT 273 -#define ETCL_DIV 274 -#define ETCL_UMINUS 275 -#define ETCL_INTEGER 276 -#define ETCL_FLOAT 277 -#define ETCL_STRING 278 -#define ETCL_RPAREN 279 -#define ETCL_LPAREN 280 -#define ETCL_RBRA 281 -#define ETCL_LBRA 282 -#define ETCL_IDENT 283 -#define ETCL_UNSIGNED 284 -#define ETCL_SIGNED 285 -#define ETCL_DOUBLE 286 -#define ETCL_CONSTRAINT 287 -#define ETCL_COMPONENT 288 -#define ETCL_WITH 289 -#define ETCL_MAX 290 -#define ETCL_MIN 291 -#define ETCL_FIRST 292 -#define ETCL_RANDOM 293 -#define ETCL_DOLLAR 294 -#define ETCL_DOT 295 -#define ETCL_DISCRIMINANT 296 -#define ETCL_LENGTH 297 -#define ETCL_TYPE_ID 298 -#define ETCL_REPOS_ID 299 - - -//============================================================================= -/** - * @file ETCL_y.cpp - * - * @author Carlos O'Ryan based on previous work by Seth Widoff - */ -//============================================================================= - - -#include "ace/ETCL/ETCL_y.h" -#include "ace/ETCL/ETCL_Constraint.h" -#include "ace/ETCL/ETCL_Interpreter.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -extern int yylex (void); -extern void yyflush_current_buffer (void); - -static void yyerror (const char *) -{ - // @@ TODO - // Ignore error messages -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 114 -#define YYFLAG -32768 -#define YYNTBASE 46 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 299 ? yytranslate[x] : 65) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 7, 10, 13, 15, 17, 21, 23, - 27, 29, 33, 37, 41, 45, 49, 53, 55, 59, - 64, 66, 70, 72, 76, 80, 82, 86, 90, 92, - 95, 97, 101, 103, 106, 109, 111, 114, 117, 119, - 121, 124, 128, 132, 135, 137, 138, 141, 144, 146, - 148, 149, 152, 154, 156, 159, 161, 163, 165, 167, - 169, 171, 176, 181, 184, 189, 190, 192, 195, 198 -}; - -static const short yyrhs[] = { 48, - 0, 47, 0, 37, 48, 0, 36, 48, 0, 35, - 48, 0, 38, 0, 39, 0, 48, 12, 49, 0, - 49, 0, 49, 11, 50, 0, 50, 0, 51, 7, - 51, 0, 51, 8, 51, 0, 51, 3, 51, 0, - 51, 4, 51, 0, 51, 5, 51, 0, 51, 6, - 51, 0, 51, 0, 52, 14, 57, 0, 52, 14, - 40, 57, 0, 52, 0, 53, 15, 53, 0, 53, - 0, 53, 17, 54, 0, 53, 18, 54, 0, 54, - 0, 54, 19, 55, 0, 54, 20, 55, 0, 55, - 0, 13, 56, 0, 56, 0, 26, 48, 25, 0, - 22, 0, 17, 22, 0, 18, 22, 0, 23, 0, - 17, 23, 0, 18, 23, 0, 24, 0, 16, 0, - 9, 29, 0, 9, 40, 57, 0, 10, 40, 57, - 0, 40, 57, 0, 29, 0, 0, 41, 59, 0, - 29, 58, 0, 60, 0, 61, 0, 0, 41, 59, - 0, 60, 0, 61, 0, 29, 58, 0, 43, 0, - 42, 0, 44, 0, 45, 0, 62, 0, 63, 0, - 28, 22, 27, 58, 0, 26, 29, 25, 58, 0, - 22, 58, 0, 26, 64, 25, 58, 0, 0, 22, - 0, 17, 22, 0, 18, 22, 0, 24, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 92, 93, 96, 98, 100, 102, 104, 108, 110, 113, - 115, 118, 120, 122, 124, 126, 128, 130, 133, 135, - 137, 140, 142, 145, 147, 149, 152, 154, 156, 159, - 161, 164, 166, 168, 170, 172, 174, 176, 178, 180, - 182, 184, 186, 188, 190, 194, 196, 199, 202, 203, - 206, 208, 211, 212, 215, 217, 219, 221, 223, 225, - 226, 229, 233, 237, 241, 245, 247, 249, 251, 253 -}; -#endif - - -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) - -static const char * const yytname[] = { "$","error","$undefined.","ETCL_GT", -"ETCL_GE","ETCL_LT","ETCL_LE","ETCL_EQ","ETCL_NE","ETCL_EXIST", -"ETCL_DEFAULT","ETCL_AND","ETCL_OR","ETCL_NOT","ETCL_IN", -"ETCL_TWIDDLE","ETCL_BOOLEAN","ETCL_PLUS","ETCL_MINUS","ETCL_MULT", -"ETCL_DIV","ETCL_UMINUS","ETCL_INTEGER","ETCL_FLOAT","ETCL_STRING", -"ETCL_RPAREN","ETCL_LPAREN","ETCL_RBRA","ETCL_LBRA","ETCL_IDENT", -"ETCL_UNSIGNED","ETCL_SIGNED","ETCL_DOUBLE","ETCL_CONSTRAINT", -"ETCL_COMPONENT","ETCL_WITH","ETCL_MAX","ETCL_MIN","ETCL_FIRST", -"ETCL_RANDOM","ETCL_DOLLAR","ETCL_DOT","ETCL_DISCRIMINANT","ETCL_LENGTH", -"ETCL_TYPE_ID","ETCL_REPOS_ID","constraint","preference","bool_or","bool_and", -"bool_compare","expr_in","expr_twiddle","expr","term","factor_not","factor", -"component","component_ext","component_dot","component_array","component_assoc", -"component_pos","union_pos","union_val", 0 -}; -#endif - -static const short yyr1[] = { 0, - 46, 46, 47, 47, 47, 47, 47, 48, 48, 49, - 49, 50, 50, 50, 50, 50, 50, 50, 51, 51, - 51, 52, 52, 53, 53, 53, 54, 54, 54, 55, - 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, - 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, - 59, 60, 61, 62, 63, 64, 64, 64, 64, 64 -}; - -static const short yyr2[] = { 0, - 1, 1, 2, 2, 2, 1, 1, 3, 1, 3, - 1, 3, 3, 3, 3, 3, 3, 1, 3, 4, - 1, 3, 1, 3, 3, 1, 3, 3, 1, 2, - 1, 3, 1, 2, 2, 1, 2, 2, 1, 1, - 2, 3, 3, 2, 1, 0, 2, 2, 1, 1, - 0, 2, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 4, 4, 2, 4, 0, 1, 2, 2, 1 -}; - -static const short yydefact[] = { 0, - 0, 0, 0, 40, 0, 0, 33, 36, 39, 0, - 45, 0, 0, 0, 6, 7, 46, 2, 1, 9, - 11, 18, 21, 23, 26, 29, 31, 41, 46, 46, - 30, 34, 37, 35, 38, 0, 5, 4, 3, 0, - 0, 51, 0, 44, 49, 50, 0, 0, 0, 0, - 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, - 42, 43, 32, 0, 0, 0, 48, 53, 54, 51, - 66, 51, 57, 56, 58, 59, 47, 60, 61, 8, - 10, 14, 15, 16, 17, 12, 13, 46, 19, 22, - 24, 25, 27, 28, 51, 51, 52, 64, 0, 0, - 67, 70, 0, 55, 20, 63, 62, 68, 69, 51, - 65, 0, 0, 0 -}; - -static const short yydefgoto[] = { 112, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 44, 67, 77, 68, 69, 78, 79, 103 -}; - -static const short yypact[] = { 41, - -13, -39, 94,-32768, 38, 46,-32768,-32768,-32768, 73, --32768, 73, 73, 73,-32768,-32768, -9,-32768, -6, 7, --32768, 121, -5, 19, 55,-32768,-32768,-32768, -9, -9, --32768,-32768,-32768,-32768,-32768, 21, -6, -6, -6, 6, - 25, -2, -1,-32768,-32768,-32768, 73, 73, 73, 73, - 73, 73, 73, 73, -18, 73, 73, 73, 73, 73, --32768,-32768,-32768, 27, 29, -1,-32768,-32768,-32768, -2, - 31, -2,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 7, --32768,-32768,-32768,-32768,-32768,-32768,-32768, -9,-32768, 67, - 55, 55,-32768,-32768, -2, -2,-32768,-32768, 44, 50, --32768,-32768, 69,-32768,-32768,-32768,-32768,-32768,-32768, -2, --32768, 98, 100,-32768 -}; - -static const short yypgoto[] = {-32768, --32768, 95, 54, 58, 86,-32768, 59, 30, 33, 111, - -26, -65, 53, -17, -15,-32768,-32768,-32768 -}; - - -#define YYLAST 140 - - -static const short yytable[] = { 45, - 30, 46, 61, 62, 98, 47, 104, 40, 55, 41, - 42, 45, 45, 46, 46, 28, 40, 48, 41, 42, - 70, 88, 43, 40, 71, 41, 29, 72, 89, 106, - 107, 43, 47, 56, 64, 57, 58, 45, 66, 46, - 73, 74, 75, 76, 111, 63, 65, 99, 100, 1, - 2, 95, 101, 3, 102, 96, 4, 5, 6, 32, - 33, 105, 7, 8, 9, 108, 10, 34, 35, 11, - 45, 109, 46, 59, 60, 12, 13, 14, 15, 16, - 17, 1, 2, 57, 58, 3, 91, 92, 4, 5, - 6, 93, 94, 110, 7, 8, 9, 113, 10, 114, - 80, 11, 1, 2, 36, 81, 37, 38, 39, 4, - 5, 6, 17, 31, 90, 7, 8, 9, 97, 10, - 0, 0, 11, 49, 50, 51, 52, 53, 54, 0, - 0, 0, 0, 17, 82, 83, 84, 85, 86, 87 -}; - -static const short yycheck[] = { 17, - 40, 17, 29, 30, 70, 12, 72, 26, 14, 28, - 29, 29, 30, 29, 30, 29, 26, 11, 28, 29, - 22, 40, 41, 26, 26, 28, 40, 29, 55, 95, - 96, 41, 12, 15, 29, 17, 18, 55, 41, 55, - 42, 43, 44, 45, 110, 25, 22, 17, 18, 9, - 10, 25, 22, 13, 24, 27, 16, 17, 18, 22, - 23, 88, 22, 23, 24, 22, 26, 22, 23, 29, - 88, 22, 88, 19, 20, 35, 36, 37, 38, 39, - 40, 9, 10, 17, 18, 13, 57, 58, 16, 17, - 18, 59, 60, 25, 22, 23, 24, 0, 26, 0, - 47, 29, 9, 10, 10, 48, 12, 13, 14, 16, - 17, 18, 40, 3, 56, 22, 23, 24, 66, 26, - -1, -1, 29, 3, 4, 5, 6, 7, 8, -1, - -1, -1, -1, 40, 49, 50, 51, 52, 53, 54 -}; -/* -*-C-*- Note some compilers choke on comments on `//#line' lines. */ -//#line 3 "/pkg/gnu/share/bison.simple" -/* This file comes from bison-1.28. */ - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - 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 2, 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, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ - -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX yylex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ -YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; -{ - ACE_REGISTER char *f = from; - ACE_REGISTER char *t = to; - ACE_REGISTER int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) -{ - ACE_REGISTER char *t = to; - ACE_REGISTER char *f = from; - ACE_REGISTER int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -//#line 217 "/pkg/gnu/share/bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -#ifdef YYPARSE_PARAM -int yyparse (void *); -#else -int yyparse (void); -#endif -#endif - -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - ACE_REGISTER int yystate; - ACE_REGISTER int yyn; - ACE_REGISTER short *yyssp; - ACE_REGISTER YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -#define YYPOPSTACK (yyvsp--, yyssp--) -#endif - - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - int yylen; - -#if YYDEBUG != 0 - if (yydebug) - ACE_OS::fprintf(stderr, "Starting parse\n"); -#endif - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss - 1; - yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif - -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif - - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { - ACE_OS::free (yyss); - ACE_OS::free (yyvs); -#ifdef YYLSP_NEEDED - ACE_OS::free (yyls); -#endif - } - return 2; - } - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (yydebug) - ACE_OS::fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (yydebug) - ACE_OS::fprintf(stderr, "Entering state %d\n", yystate); -#endif - - goto yybackup; - yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { -#if YYDEBUG != 0 - if (yydebug) - ACE_OS::fprintf(stderr, "Reading a token: "); -#endif - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - ACE_OS::fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - ACE_OS::fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - ACE_OS::fprintf (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - ACE_OS::fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -yydefault: - - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (yydebug) - { - int i; - - ACE_OS::fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - ACE_OS::fprintf (stderr, "%s ", yytname[yyrhs[i]]); - ACE_OS::fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 3: -//#line 97 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Preference (ETCL_MIN, yyvsp[0].constraint); ; - break;} -case 4: -//#line 99 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Preference (ETCL_MAX, yyvsp[0].constraint); ; - break;} -case 5: -//#line 101 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Preference (ETCL_WITH, yyvsp[0].constraint); ; - break;} -case 6: -//#line 103 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Preference (ETCL_FIRST); ; - break;} -case 7: -//#line 105 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Preference (ETCL_RANDOM); ; - break;} -case 8: -//#line 109 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_OR, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 10: -//#line 114 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_AND, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 12: -//#line 119 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_EQ, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 13: -//#line 121 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_NE, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 14: -//#line 123 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_GT, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 15: -//#line 125 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_GE, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 16: -//#line 127 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_LT, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 17: -//#line 129 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_LE, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 19: -//#line 134 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_IN, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 20: -//#line 136 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_IN, yyvsp[-3].constraint, yyvsp[0].constraint); ; - break;} -case 22: -//#line 141 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_TWIDDLE, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 24: -//#line 146 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_PLUS, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 25: -//#line 148 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_MINUS, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 27: -//#line 153 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_MULT, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 28: -//#line 155 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Binary_Expr (ETCL_DIV, yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 30: -//#line 160 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Unary_Expr (ETCL_NOT, yyvsp[0].constraint); ; - break;} -case 32: -//#line 165 "ETCL/ETCL.yy" -{ yyval.constraint = yyvsp[-1].constraint; ; - break;} -case 33: -//#line 167 "ETCL/ETCL.yy" -{ yyval.constraint = yyvsp[0].constraint; ; - break;} -case 34: -//#line 169 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Unary_Expr (ETCL_PLUS, yyvsp[0].constraint); ; - break;} -case 35: -//#line 171 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Unary_Expr (ETCL_MINUS, yyvsp[0].constraint); ; - break;} -case 36: -//#line 173 "ETCL/ETCL.yy" -{ yyval.constraint = yyvsp[0].constraint; ; - break;} -case 37: -//#line 175 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Unary_Expr (ETCL_PLUS, yyvsp[0].constraint); ; - break;} -case 38: -//#line 177 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Unary_Expr (ETCL_MINUS, yyvsp[0].constraint); ; - break;} -case 39: -//#line 179 "ETCL/ETCL.yy" -{ yyval.constraint = yyvsp[0].constraint; ; - break;} -case 40: -//#line 181 "ETCL/ETCL.yy" -{ yyval.constraint = yyvsp[0].constraint; ; - break;} -case 41: -//#line 183 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Exist (yyvsp[0].constraint); ; - break;} -case 42: -//#line 185 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Exist (yyvsp[0].constraint); ; - break;} -case 43: -//#line 187 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Default (yyvsp[0].constraint); ; - break;} -case 44: -//#line 189 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Eval (yyvsp[0].constraint); ; - break;} -case 45: -//#line 191 "ETCL/ETCL.yy" -{ yyval.constraint = yyvsp[0].constraint; ; - break;} -case 46: -//#line 195 "ETCL/ETCL.yy" -{ yyval.constraint = 0; ; - break;} -case 47: -//#line 197 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Dot (yyvsp[0].constraint); ; - break;} -case 48: -//#line 200 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Component (yyvsp[-1].constraint, yyvsp[0].constraint); ; - break;} -case 51: -//#line 207 "ETCL/ETCL.yy" -{ yyval.constraint = 0; ; - break;} -case 52: -//#line 209 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Dot (yyvsp[0].constraint); ; - break;} -case 55: -//#line 216 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Component (yyvsp[-1].constraint, yyvsp[0].constraint); ; - break;} -case 56: -//#line 218 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Special (ETCL_LENGTH); ; - break;} -case 57: -//#line 220 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Special (ETCL_DISCRIMINANT); ; - break;} -case 58: -//#line 222 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Special (ETCL_TYPE_ID); ; - break;} -case 59: -//#line 224 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Special (ETCL_REPOS_ID); ; - break;} -case 62: -//#line 230 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Component_Array (yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 63: -//#line 234 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Component_Assoc (yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 64: -//#line 238 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Component_Pos (yyvsp[-1].constraint, yyvsp[0].constraint); ; - break;} -case 65: -//#line 242 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Union_Pos (yyvsp[-2].constraint, yyvsp[0].constraint); ; - break;} -case 66: -//#line 246 "ETCL/ETCL.yy" -{ yyval.constraint = 0; ; - break;} -case 67: -//#line 248 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Union_Value (+1, yyvsp[0].constraint); ; - break;} -case 68: -//#line 250 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Union_Value (+1, yyvsp[0].constraint); ; - break;} -case 69: -//#line 252 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Union_Value (-1, yyvsp[0].constraint); ; - break;} -case 70: -//#line 254 "ETCL/ETCL.yy" -{ yyval.constraint = new ETCL_Union_Value (yyvsp[0].constraint); ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -//#line 543 "/pkg/gnu/share/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - ACE_OS::fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - ACE_OS::fprintf (stderr, " %d", *++ssp1); - ACE_OS::fprintf (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; - -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -yyerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += ACE_OS::strlen(yytname[x]) + 15, count++; - msg = (char *) ACE_OS::malloc(size + 15); - if (msg != 0) - { - ACE_OS::strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - ACE_OS::strcat(msg, count == 0 ? ", expecting `" : " or `"); - ACE_OS::strcat(msg, yytname[x]); - ACE_OS::strcat(msg, "'"); - count++; - } - } - yyerror(msg); - ACE_OS::free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); - } - - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - ACE_OS::fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - ACE_OS::fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - ACE_OS::fprintf (stderr, " %d", *++ssp1); - ACE_OS::fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (yydebug) - ACE_OS::fprintf(stderr, "Shifting error token, "); -#endif - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - yystate = yyn; - goto yynewstate; - - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - ACE_OS::free (yyss); - ACE_OS::free (yyvs); -#ifdef YYLSP_NEEDED - ACE_OS::free (yyls); -#endif - } - return 0; - - yyabortlab: - /* YYABORT comes here. */ - - /* Flush out yy_current_buffer before next parse. Since there is - no error recovery, the buffer could still contain tokens from this - parse. */ - yyflush_current_buffer(); - - if (yyfree_stacks) - { - ACE_OS::free (yyss); - ACE_OS::free (yyvs); -#ifdef YYLSP_NEEDED - ACE_OS::free (yyls); -#endif - } - return 1; -} -//#line 257 "ETCL/ETCL.yy" - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/ETCL/ETCL_y.h b/deps/acelite/ace/ETCL/ETCL_y.h deleted file mode 100644 index ee66290c4..000000000 --- a/deps/acelite/ace/ETCL/ETCL_y.h +++ /dev/null @@ -1,44 +0,0 @@ -#define ETCL_GT 257 -#define ETCL_GE 258 -#define ETCL_LT 259 -#define ETCL_LE 260 -#define ETCL_EQ 261 -#define ETCL_NE 262 -#define ETCL_EXIST 263 -#define ETCL_DEFAULT 264 -#define ETCL_AND 265 -#define ETCL_OR 266 -#define ETCL_NOT 267 -#define ETCL_IN 268 -#define ETCL_TWIDDLE 269 -#define ETCL_BOOLEAN 270 -#define ETCL_PLUS 271 -#define ETCL_MINUS 272 -#define ETCL_MULT 273 -#define ETCL_DIV 274 -#define ETCL_UMINUS 275 -#define ETCL_INTEGER 276 -#define ETCL_FLOAT 277 -#define ETCL_STRING 278 -#define ETCL_RPAREN 279 -#define ETCL_LPAREN 280 -#define ETCL_RBRA 281 -#define ETCL_LBRA 282 -#define ETCL_IDENT 283 -#define ETCL_UNSIGNED 284 -#define ETCL_SIGNED 285 -#define ETCL_DOUBLE 286 -#define ETCL_CONSTRAINT 287 -#define ETCL_COMPONENT 288 -#define ETCL_WITH 289 -#define ETCL_MAX 290 -#define ETCL_MIN 291 -#define ETCL_FIRST 292 -#define ETCL_RANDOM 293 -#define ETCL_DOLLAR 294 -#define ETCL_DOT 295 -#define ETCL_DISCRIMINANT 296 -#define ETCL_LENGTH 297 -#define ETCL_TYPE_ID 298 -#define ETCL_REPOS_ID 299 - diff --git a/deps/acelite/ace/ETCL/ace_etcl_export.h b/deps/acelite/ace/ETCL/ace_etcl_export.h deleted file mode 100644 index 3470a5b2b..000000000 --- a/deps/acelite/ace/ETCL/ace_etcl_export.h +++ /dev/null @@ -1,39 +0,0 @@ - -// -*- C++ -*- -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -// ------------------------------ -#ifndef ACE_ETCL_EXPORT_H -#define ACE_ETCL_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) -# if !defined (ACE_ETCL_HAS_DLL) -# define ACE_ETCL_HAS_DLL 0 -# endif /* ! ACE_ETCL_HAS_DLL */ -#else -# if !defined (ACE_ETCL_HAS_DLL) -# define ACE_ETCL_HAS_DLL 1 -# endif /* ! ACE_ETCL_HAS_DLL */ -#endif - -#if defined (ACE_ETCL_HAS_DLL) && (ACE_ETCL_HAS_DLL == 1) -# if defined (ACE_ETCL_BUILD_DLL) -# define ACE_ETCL_Export ACE_Proper_Export_Flag -# define ACE_ETCL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_ETCL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* ACE_ETCL_BUILD_DLL */ -# define ACE_ETCL_Export ACE_Proper_Import_Flag -# define ACE_ETCL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_ETCL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_ETCL_BUILD_DLL */ -#else /* ACE_ETCL_HAS_DLL == 1 */ -# define ACE_ETCL_Export -# define ACE_ETCL_SINGLETON_DECLARATION(T) -# define ACE_ETCL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_ETCL_HAS_DLL == 1 */ - -#endif /* ACE_ETCL_EXPORT_H */ - -// End of auto generated file. diff --git a/deps/acelite/ace/ETCL/etcl_parser_export.h b/deps/acelite/ace/ETCL/etcl_parser_export.h deleted file mode 100644 index e0e62b8f7..000000000 --- a/deps/acelite/ace/ETCL/etcl_parser_export.h +++ /dev/null @@ -1,39 +0,0 @@ - -// -*- C++ -*- -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -// ------------------------------ -#ifndef ETCL_PARSER_EXPORT_H -#define ETCL_PARSER_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) -# if !defined (ETCL_PARSER_HAS_DLL) -# define ETCL_PARSER_HAS_DLL 0 -# endif /* ! ETCL_PARSER_HAS_DLL */ -#else -# if !defined (ETCL_PARSER_HAS_DLL) -# define ETCL_PARSER_HAS_DLL 1 -# endif /* ! ETCL_PARSER_HAS_DLL */ -#endif - -#if defined (ETCL_PARSER_HAS_DLL) && (ETCL_PARSER_HAS_DLL == 1) -# if defined (ETCL_PARSER_BUILD_DLL) -# define ETCL_Parser_Export ACE_Proper_Export_Flag -# define ETCL_PARSER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ETCL_PARSER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* ETCL_PARSER_BUILD_DLL */ -# define ETCL_Parser_Export ACE_Proper_Import_Flag -# define ETCL_PARSER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ETCL_PARSER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ETCL_PARSER_BUILD_DLL */ -#else /* ETCL_PARSER_HAS_DLL == 1 */ -# define ETCL_Parser_Export -# define ETCL_PARSER_SINGLETON_DECLARATION(T) -# define ETCL_PARSER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ETCL_PARSER_HAS_DLL == 1 */ - -#endif /* ETCL_PARSER_EXPORT_H */ - -// End of auto generated file. diff --git a/deps/acelite/ace/Event.cpp b/deps/acelite/ace/Event.cpp index 72a15d3ba..20fe07306 100644 --- a/deps/acelite/ace/Event.cpp +++ b/deps/acelite/ace/Event.cpp @@ -1,14 +1,45 @@ #include "ace/Event.h" #if !defined (__ACE_INLINE__) -//#include "ace/Event.inl" +#include "ace/Event.inl" #endif /* __ACE_INLINE__ */ #include "ace/Log_Category.h" #include "ace/Condition_Attributes.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Event_T) +template +ACE_Event_T::ACE_Event_T (int manual_reset, + int initial_state, + int type, + const ACE_TCHAR *name, + void *arg, + LPSECURITY_ATTRIBUTES sa) + : ACE_Event_Base () +{ + ACE_Condition_Attributes_T cond_attr (type); + if (ACE_OS::event_init (&this->handle_, + type, + &const_cast (cond_attr.attributes ()), + manual_reset, + initial_state, + name, + arg, + sa) != 0) + ACELIB_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("ACE_Event_T::ACE_Event_T"))); +} + +template +ACE_Event_T::~ACE_Event_T (void) +{ +} ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Event.h b/deps/acelite/ace/Event.h index 717aadc0c..a30420631 100644 --- a/deps/acelite/ace/Event.h +++ b/deps/acelite/ace/Event.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -47,40 +47,18 @@ public: int type = USYNC_THREAD, const ACE_TCHAR *name = 0, void *arg = 0, - LPSECURITY_ATTRIBUTES sa = 0) : ACE_Event_Base () - { - ACE_Condition_Attributes_T cond_attr (type); - if (ACE_OS::event_init (&this->handle_, - type, - &const_cast (cond_attr.attributes ()), - manual_reset, - initial_state, - name, - arg, - sa) != 0) - ACELIB_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Event_T::ACE_Event_T"))); - } + LPSECURITY_ATTRIBUTES sa = 0); /// Implicitly destroy the event variable. - virtual ~ACE_Event_T (void) - { - } + virtual ~ACE_Event_T (void); /// Get the current time of day according to the queue's TIME_POLICY. /// Allows users to initialize timeout values using correct time policy. - ACE_Time_Value_T gettimeofday (void) const - { - return this->time_policy_ (); - } + ACE_Time_Value_T gettimeofday (void) const; /// Allows applications to control how the event gets the time /// of day. - void set_time_policy (TIME_POLICY const & time_policy) - { - this->time_policy_ = rhs; - } + void set_time_policy (TIME_POLICY const & time_policy); /// Declare the dynamic allocation hooks ACE_ALLOC_HOOK_DECLARE; diff --git a/deps/acelite/ace/Event.inl b/deps/acelite/ace/Event.inl index e1facac51..b8a688be7 100644 --- a/deps/acelite/ace/Event.inl +++ b/deps/acelite/ace/Event.inl @@ -1,4 +1,18 @@ // -*- C++ -*- ACE_BEGIN_VERSIONED_NAMESPACE_DECL +template +ACE_Time_Value_T +ACE_Event_T::gettimeofday (void) const +{ + return this->time_policy_ (); +} + +template +void +ACE_Event_T::set_time_policy (TIME_POLICY const & rhs) +{ + this->time_policy_ = rhs; +} + ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Event_Base.cpp b/deps/acelite/ace/Event_Base.cpp index ac191b084..3ec4ea02b 100644 --- a/deps/acelite/ace/Event_Base.cpp +++ b/deps/acelite/ace/Event_Base.cpp @@ -5,9 +5,14 @@ #endif /* __ACE_INLINE__ */ #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE(ACE_Event_Base) + ACE_Event_Base::ACE_Event_Base () : removed_ (false) { diff --git a/deps/acelite/ace/Event_Handler.cpp b/deps/acelite/ace/Event_Handler.cpp index 82e6879be..6a44bf58e 100644 --- a/deps/acelite/ace/Event_Handler.cpp +++ b/deps/acelite/ace/Event_Handler.cpp @@ -16,7 +16,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Implement conceptually abstract virtual functions in the base class // so derived classes don't have to implement unused ones. - ACE_Event_Handler::ACE_Event_Handler (ACE_Reactor *r, int p) : reference_count_ (1), @@ -33,7 +32,6 @@ ACE_Event_Handler::~ACE_Event_Handler (void) } // Gets the file descriptor associated with this I/O device. - ACE_HANDLE ACE_Event_Handler::get_handle (void) const { @@ -42,7 +40,6 @@ ACE_Event_Handler::get_handle (void) const } // Sets the file descriptor associated with this I/O device. - void ACE_Event_Handler::set_handle (ACE_HANDLE) { @@ -50,7 +47,6 @@ ACE_Event_Handler::set_handle (ACE_HANDLE) } // Gets the priority of this handler. - int ACE_Event_Handler::priority (void) const { @@ -59,7 +55,6 @@ ACE_Event_Handler::priority (void) const } // Sets the priority - void ACE_Event_Handler::priority (int priority) { @@ -69,7 +64,6 @@ ACE_Event_Handler::priority (int priority) // Called when the object is about to be removed from the Dispatcher // tables. - int ACE_Event_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask) { @@ -78,7 +72,6 @@ ACE_Event_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask) } // Called when input becomes available on fd. - int ACE_Event_Handler::handle_input (ACE_HANDLE) { @@ -87,7 +80,6 @@ ACE_Event_Handler::handle_input (ACE_HANDLE) } // Called when output is possible on fd. - int ACE_Event_Handler::handle_output (ACE_HANDLE) { @@ -96,7 +88,6 @@ ACE_Event_Handler::handle_output (ACE_HANDLE) } // Called when urgent data is available on fd. - int ACE_Event_Handler::handle_exception (ACE_HANDLE) { @@ -105,7 +96,6 @@ ACE_Event_Handler::handle_exception (ACE_HANDLE) } // Called when timer expires, TV stores the current time. - int ACE_Event_Handler::handle_timeout (const ACE_Time_Value &, const void *) { @@ -114,7 +104,6 @@ ACE_Event_Handler::handle_timeout (const ACE_Time_Value &, const void *) } // Called when a monitored Process exits - int ACE_Event_Handler::handle_exit (ACE_Process *) { @@ -123,7 +112,6 @@ ACE_Event_Handler::handle_exit (ACE_Process *) } // Called when a registered signal occurs. - int ACE_Event_Handler::handle_signal (int, siginfo_t *, ucontext_t *) { @@ -141,7 +129,6 @@ ACE_Event_Handler::resume_handler (void) return ACE_Event_Handler::ACE_REACTOR_RESUMES_HANDLER; } - int ACE_Event_Handler::handle_qos (ACE_HANDLE) { diff --git a/deps/acelite/ace/Event_Handler.h b/deps/acelite/ace/Event_Handler.h index 3b4f9bb94..caf5068a0 100644 --- a/deps/acelite/ace/Event_Handler.h +++ b/deps/acelite/ace/Event_Handler.h @@ -4,7 +4,7 @@ /** * @file Event_Handler.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -20,6 +20,7 @@ #include "ace/os_include/os_signal.h" #include "ace/Atomic_Op.h" +#include "ace/OS_NS_Thread.h" #include "ace/Synch_Traits.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Event_Handler_Handle_Timeout_Upcall.cpp b/deps/acelite/ace/Event_Handler_Handle_Timeout_Upcall.cpp index c2edf3d2d..f361e5aae 100644 --- a/deps/acelite/ace/Event_Handler_Handle_Timeout_Upcall.cpp +++ b/deps/acelite/ace/Event_Handler_Handle_Timeout_Upcall.cpp @@ -8,6 +8,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE(ACE_Event_Handler_Handle_Timeout_Upcall) + ACE_Event_Handler_Handle_Timeout_Upcall:: ACE_Event_Handler_Handle_Timeout_Upcall (void) : requires_reference_counting_ (0) diff --git a/deps/acelite/ace/Event_Handler_Handle_Timeout_Upcall.h b/deps/acelite/ace/Event_Handler_Handle_Timeout_Upcall.h index 200e2e472..da0d57c7e 100644 --- a/deps/acelite/ace/Event_Handler_Handle_Timeout_Upcall.h +++ b/deps/acelite/ace/Event_Handler_Handle_Timeout_Upcall.h @@ -31,7 +31,6 @@ class ACE_Export ACE_Event_Handler_Handle_Timeout_Upcall : private ACE_Copy_Disabled { public: - // = Initialization and termination methods. /// Constructor. ACE_Event_Handler_Handle_Timeout_Upcall (void); @@ -84,6 +83,9 @@ public: ACE_Event_Handler *handler, const void *arg); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + private: /// Flag indicating that reference counting is required for this diff --git a/deps/acelite/ace/Event_Handler_T.h b/deps/acelite/ace/Event_Handler_T.h index 5f596e727..979480947 100644 --- a/deps/acelite/ace/Event_Handler_T.h +++ b/deps/acelite/ace/Event_Handler_T.h @@ -4,7 +4,7 @@ /** * @file Event_Handler_T.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -75,7 +75,6 @@ public: /// Handle close events. typedef int (T::*CL_HANDLER) (ACE_HANDLE, ACE_Reactor_Mask); - /// = Initialization and termination methods. typedef int (T::*SIG_HANDLER) (int, siginfo_t*, ucontext_t*); /// Initialize the op_handler. diff --git a/deps/acelite/ace/FIFO.cpp b/deps/acelite/ace/FIFO.cpp index 95bfd6ef9..e598bb636 100644 --- a/deps/acelite/ace/FIFO.cpp +++ b/deps/acelite/ace/FIFO.cpp @@ -9,6 +9,9 @@ #include "ace/OS_NS_errno.h" #include "ace/OS_NS_sys_stat.h" #include "ace/OS_NS_fcntl.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/FIFO_Recv.cpp b/deps/acelite/ace/FIFO_Recv.cpp index 37c9f31a4..bb5568d56 100644 --- a/deps/acelite/ace/FIFO_Recv.cpp +++ b/deps/acelite/ace/FIFO_Recv.cpp @@ -1,6 +1,9 @@ #include "ace/FIFO_Recv.h" #include "ace/Log_Category.h" #include "ace/OS_NS_fcntl.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/FIFO_Recv.inl" diff --git a/deps/acelite/ace/FIFO_Recv_Msg.cpp b/deps/acelite/ace/FIFO_Recv_Msg.cpp index bb14e733c..494f098ac 100644 --- a/deps/acelite/ace/FIFO_Recv_Msg.cpp +++ b/deps/acelite/ace/FIFO_Recv_Msg.cpp @@ -1,6 +1,9 @@ #include "ace/FIFO_Recv_Msg.h" #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/FIFO_Recv_Msg.inl" diff --git a/deps/acelite/ace/FIFO_Recv_Msg.h b/deps/acelite/ace/FIFO_Recv_Msg.h index 566f26fdf..803702ebc 100644 --- a/deps/acelite/ace/FIFO_Recv_Msg.h +++ b/deps/acelite/ace/FIFO_Recv_Msg.h @@ -43,7 +43,6 @@ class ACE_Str_Buf; class ACE_Export ACE_FIFO_Recv_Msg : public ACE_FIFO_Recv { public: - // = Initialization methods. /// Default constructor. ACE_FIFO_Recv_Msg (void); diff --git a/deps/acelite/ace/FIFO_Send.cpp b/deps/acelite/ace/FIFO_Send.cpp index 32a502ae3..0c37b917e 100644 --- a/deps/acelite/ace/FIFO_Send.cpp +++ b/deps/acelite/ace/FIFO_Send.cpp @@ -1,5 +1,8 @@ #include "ace/FIFO_Send.h" #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/FIFO_Send.inl" diff --git a/deps/acelite/ace/FIFO_Send.h b/deps/acelite/ace/FIFO_Send.h index 37580662b..4c885df4b 100644 --- a/deps/acelite/ace/FIFO_Send.h +++ b/deps/acelite/ace/FIFO_Send.h @@ -8,7 +8,6 @@ */ //========================================================================== - #ifndef ACE_FIFO_SEND_H #define ACE_FIFO_SEND_H diff --git a/deps/acelite/ace/FIFO_Send_Msg.cpp b/deps/acelite/ace/FIFO_Send_Msg.cpp index cd9294d3b..756a570f2 100644 --- a/deps/acelite/ace/FIFO_Send_Msg.cpp +++ b/deps/acelite/ace/FIFO_Send_Msg.cpp @@ -2,6 +2,9 @@ #include "ace/Log_Category.h" #include "ace/OS_NS_sys_uio.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/FIFO_Send_Msg.inl" diff --git a/deps/acelite/ace/FIFO_Send_Msg.h b/deps/acelite/ace/FIFO_Send_Msg.h index 226f53da0..0e15c0e2e 100644 --- a/deps/acelite/ace/FIFO_Send_Msg.h +++ b/deps/acelite/ace/FIFO_Send_Msg.h @@ -37,7 +37,6 @@ class ACE_Str_Buf; class ACE_Export ACE_FIFO_Send_Msg : public ACE_FIFO_Send { public: - // = Initialization methods. /// Default constructor. ACE_FIFO_Send_Msg (void); diff --git a/deps/acelite/ace/FILE.cpp b/deps/acelite/ace/FILE.cpp index 770428538..f7be0af71 100644 --- a/deps/acelite/ace/FILE.cpp +++ b/deps/acelite/ace/FILE.cpp @@ -6,6 +6,10 @@ #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_sys_stat.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/FILE.inl" #endif /* __ACE_INLINE__ */ diff --git a/deps/acelite/ace/FILE_Addr.h b/deps/acelite/ace/FILE_Addr.h index 52466e780..79c14d4cb 100644 --- a/deps/acelite/ace/FILE_Addr.h +++ b/deps/acelite/ace/FILE_Addr.h @@ -4,7 +4,7 @@ /** * @file FILE_Addr.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -31,7 +31,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_FILE_Addr : public ACE_Addr { public: - // = Initialization methods. /// Default constructor. ACE_FILE_Addr (void); diff --git a/deps/acelite/ace/FILE_Connector.cpp b/deps/acelite/ace/FILE_Connector.cpp index 1dfc9adf4..5ff46dec5 100644 --- a/deps/acelite/ace/FILE_Connector.cpp +++ b/deps/acelite/ace/FILE_Connector.cpp @@ -1,6 +1,9 @@ #include "ace/FILE_Connector.h" #include "ace/Handle_Ops.h" #include "ace/OS_NS_stdlib.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/FILE_Connector.inl" diff --git a/deps/acelite/ace/FILE_Connector.h b/deps/acelite/ace/FILE_Connector.h index abec0acc0..76e781560 100644 --- a/deps/acelite/ace/FILE_Connector.h +++ b/deps/acelite/ace/FILE_Connector.h @@ -4,7 +4,7 @@ /** * @file FILE_Connector.h * - * @author Doug Schmidt + * @author Doug Schmidt */ //============================================================================= @@ -37,7 +37,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_FILE_Connector { public: - // = Initialization methods. /// Default constructor. ACE_FILE_Connector (void); diff --git a/deps/acelite/ace/FILE_IO.cpp b/deps/acelite/ace/FILE_IO.cpp index f79b6827a..1a999c83e 100644 --- a/deps/acelite/ace/FILE_IO.cpp +++ b/deps/acelite/ace/FILE_IO.cpp @@ -4,6 +4,9 @@ #include "ace/OS_NS_sys_stat.h" #include "ace/OS_Memory.h" #include "ace/Truncate.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/FILE_IO.inl" @@ -43,15 +46,26 @@ ssize_t ACE_FILE_IO::send (size_t n, ...) const { ACE_TRACE ("ACE_FILE_IO::send"); +#ifdef ACE_LACKS_VA_FUNCTIONS + ACE_UNUSED_ARG (n); + ACE_NOTSUP_RETURN (-1); +#else va_list argp; int total_tuples = ACE_Utils::truncate_cast (n / 2); iovec *iovp = 0; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -66,10 +80,15 @@ ACE_FILE_IO::send (size_t n, ...) const iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; +#endif // ACE_LACKS_VA_FUNCTIONS } // This is basically an interface to ACE_OS::readv, that doesn't use @@ -82,15 +101,26 @@ ssize_t ACE_FILE_IO::recv (size_t n, ...) const { ACE_TRACE ("ACE_FILE_IO::recv"); +#ifdef ACE_LACKS_VA_FUNCTIONS + ACE_UNUSED_ARG (n); + ACE_NOTSUP_RETURN (-1); +#else va_list argp; int total_tuples = ACE_Utils::truncate_cast (n / 2); iovec *iovp = 0; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -105,10 +135,15 @@ ACE_FILE_IO::recv (size_t n, ...) const iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; +#endif // ACE_LACKS_VA_FUNCTIONS } // Allows a client to read from a file without having to provide a @@ -128,9 +163,15 @@ ACE_FILE_IO::recvv (iovec *io_vec) { // Restrict to max size we can record in iov_len. size_t len = ACE_Utils::truncate_cast (length); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (io_vec->iov_base, + static_cast(ACE_Allocator::instance()->malloc(sizeof(char) * len)), + -1); +#else ACE_NEW_RETURN (io_vec->iov_base, char[len], -1); +#endif /* ACE_HAS_ALLOC_HOOKS */ io_vec->iov_len = static_cast (this->recv_n (io_vec->iov_base, len)); return io_vec->iov_len; diff --git a/deps/acelite/ace/FILE_IO.h b/deps/acelite/ace/FILE_IO.h index 96cfb9863..bc0bfc712 100644 --- a/deps/acelite/ace/FILE_IO.h +++ b/deps/acelite/ace/FILE_IO.h @@ -4,7 +4,7 @@ /** * @file FILE_IO.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -44,7 +44,6 @@ class ACE_Export ACE_FILE_IO : public ACE_FILE public: friend class ACE_FILE_Connector; - // = Initialization method. /// Default constructor. ACE_FILE_IO (void); diff --git a/deps/acelite/ace/File_Lock.cpp b/deps/acelite/ace/File_Lock.cpp index 5255ca460..f5e421acb 100644 --- a/deps/acelite/ace/File_Lock.cpp +++ b/deps/acelite/ace/File_Lock.cpp @@ -1,5 +1,8 @@ #include "ace/File_Lock.h" #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/File_Lock.inl" diff --git a/deps/acelite/ace/File_Lock.h b/deps/acelite/ace/File_Lock.h index 060aeebe0..d71e42c00 100644 --- a/deps/acelite/ace/File_Lock.h +++ b/deps/acelite/ace/File_Lock.h @@ -4,7 +4,7 @@ /** * @file File_Lock.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/Filecache.cpp b/deps/acelite/ace/Filecache.cpp index d6da73864..6916367bc 100644 --- a/deps/acelite/ace/Filecache.cpp +++ b/deps/acelite/ace/Filecache.cpp @@ -171,7 +171,11 @@ ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (ACE_Filecache_Hash_Entry *next, template <> ACE_Filecache_Hash_Entry::~ACE_Hash_Map_Entry (void) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free ((void *) ext_id_); +#else ACE_OS::free ((void *) ext_id_); +#endif /* ACE_HAS_ALLOC_HOOKS */ } // We need these template specializations since KEY is defined as a @@ -232,6 +236,8 @@ ACE_Filecache::~ACE_Filecache (void) { } +ACE_ALLOC_HOOK_DEFINE(ACE_Filecache) + ACE_Filecache_Object * ACE_Filecache::insert_i (const ACE_TCHAR *filename, ACE_SYNCH_RW_MUTEX &filelock, @@ -618,6 +624,8 @@ ACE_Filecache_Object::~ACE_Filecache_Object (void) this->lock_.release (); } +ACE_ALLOC_HOOK_DEFINE(ACE_Filecache_Object) + int ACE_Filecache_Object::acquire (void) { diff --git a/deps/acelite/ace/Filecache.h b/deps/acelite/ace/Filecache.h index 995ae49cf..4596edab2 100644 --- a/deps/acelite/ace/Filecache.h +++ b/deps/acelite/ace/Filecache.h @@ -186,6 +186,8 @@ public: /// was deleted. ACE_Filecache_Object *finish (ACE_Filecache_Object *&new_file); + ACE_ALLOC_HOOK_DECLARE; + protected: ACE_Filecache_Object *insert_i (const ACE_TCHAR *filename, ACE_SYNCH_RW_MUTEX &filelock, @@ -281,6 +283,8 @@ public: /// True if file on disk is newer than cached file. int update (void) const; + ACE_ALLOC_HOOK_DECLARE; + protected: /// Prevent from being called. ACE_Filecache_Object (void); @@ -294,7 +298,6 @@ private: const ACE_TCHAR *s = ACE_TEXT ("ACE_Filecache_Object")); public: - enum Creation_States { ACE_READING = 1, diff --git a/deps/acelite/ace/FlReactor/ACE_FlReactor.pc.in b/deps/acelite/ace/FlReactor/ACE_FlReactor.pc.in deleted file mode 100644 index c28448158..000000000 --- a/deps/acelite/ace/FlReactor/ACE_FlReactor.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_FlReactor -Description: ACE FlReactor Library -Requires: ACE -Version: @VERSION@ -Libs: -L${libdir} -lACE_FlReactor -Cflags: -I${includedir} diff --git a/deps/acelite/ace/FlReactor/ACE_FlReactor_export.h b/deps/acelite/ace/FlReactor/ACE_FlReactor_export.h deleted file mode 100644 index cb704d279..000000000 --- a/deps/acelite/ace/FlReactor/ACE_FlReactor_export.h +++ /dev/null @@ -1,57 +0,0 @@ - -// -*- C++ -*- -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s ACE_FlReactor -// ------------------------------ -#ifndef ACE_FLREACTOR_EXPORT_H -#define ACE_FLREACTOR_EXPORT_H - -#include /**/ "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_FLREACTOR_HAS_DLL) -# define ACE_FLREACTOR_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && ACE_FLREACTOR_HAS_DLL */ - -#if !defined (ACE_FLREACTOR_HAS_DLL) -# define ACE_FLREACTOR_HAS_DLL 1 -#endif /* ! ACE_FLREACTOR_HAS_DLL */ - -#if defined (ACE_FLREACTOR_HAS_DLL) && (ACE_FLREACTOR_HAS_DLL == 1) -# if defined (ACE_FLREACTOR_BUILD_DLL) -# define ACE_FlReactor_Export ACE_Proper_Export_Flag -# define ACE_FLREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_FLREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* ACE_FLREACTOR_BUILD_DLL */ -# define ACE_FlReactor_Export ACE_Proper_Import_Flag -# define ACE_FLREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_FLREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_FLREACTOR_BUILD_DLL */ -#else /* ACE_FLREACTOR_HAS_DLL == 1 */ -# define ACE_FlReactor_Export -# define ACE_FLREACTOR_SINGLETON_DECLARATION(T) -# define ACE_FLREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_FLREACTOR_HAS_DLL == 1 */ - -// Set ACE_FLREACTOR_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (ACE_FLREACTOR_NTRACE) -# if (ACE_NTRACE == 1) -# define ACE_FLREACTOR_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define ACE_FLREACTOR_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !ACE_FLREACTOR_NTRACE */ - -#if (ACE_FLREACTOR_NTRACE == 1) -# define ACE_FLREACTOR_TRACE(X) -#else /* (ACE_FLREACTOR_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define ACE_FLREACTOR_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (ACE_FLREACTOR_NTRACE == 1) */ - -#endif /* ACE_FLREACTOR_EXPORT_H */ - -// End of auto generated file. diff --git a/deps/acelite/ace/FlReactor/FlReactor.cpp b/deps/acelite/ace/FlReactor/FlReactor.cpp deleted file mode 100644 index edbac9be3..000000000 --- a/deps/acelite/ace/FlReactor/FlReactor.cpp +++ /dev/null @@ -1,326 +0,0 @@ -#include "ace/FlReactor/FlReactor.h" - -#include /**/ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE (ACE_FlReactor) - -// Must be called with lock held -ACE_FlReactor::ACE_FlReactor (size_t size, - bool restart, - ACE_Sig_Handler *h) - : ACE_Select_Reactor (size, restart, h) -{ - // When the ACE_Select_Reactor is constructed it creates the notify - // pipe and registers it with the register_handler_i() method. The - // FlReactor overloads this method BUT because the - // register_handler_i occurs when constructing the base class - // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i() - // is called not the FlReactor register_handler_i(). This means - // that the notify pipe is registered with the ACE_Select_Reactor - // event handling code not the FlReactor and so notfications don't - // work. To get around this we simply close and re-opened the - // notification handler in the constructor of the FlReactor. - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - this->notify_handler_->close (); - this->notify_handler_->open (this, 0); -#endif /* ACE_MT_SAFE */ -} - -ACE_FlReactor::~ACE_FlReactor (void) -{ -} - -// This is just the from ace/Reactor.cpp -// but we use the Fl functions to wait for an event, not , just use the Fl mechanism - // to wait for one or more events... - - // Wait for something to happen. - double t = 0; - if (max_wait_time != 0) - t = max_wait_time->sec () + max_wait_time->usec () / 1000000.0F; - - while (t > 0) { - t = Fl::wait (t); - } - - // Reset the width, in case it changed during the upcalls. - width = this->handler_rep_.max_handlep1 (); - - // Now actually read the result needed by the - // using - -int -ACE_FoxReactor::wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_set, - ACE_Time_Value *max_wait_time) -{ - ACE_TRACE( "ACE_FoxReactor::wait_for_multiple_events" ); - - int nfound = 0; - do - { - max_wait_time = this->timer_queue_->calculate_timeout (max_wait_time); - size_t width = this->handler_rep_.max_handlep1 (); - handle_set.rd_mask_ = this->wait_set_.rd_mask_; - handle_set.wr_mask_ = this->wait_set_.wr_mask_; - handle_set.ex_mask_ = this->wait_set_.ex_mask_; - - nfound = FoxWaitForMultipleEvents (width, - handle_set, - max_wait_time); - - } while( nfound == -1 && this->handle_error () > 0 ); - - if (nfound > 0) - { -#if !defined (ACE_WIN32) - handle_set.rd_mask_.sync (this->handler_rep_.max_handlep1 ()); - handle_set.wr_mask_.sync (this->handler_rep_.max_handlep1 ()); - handle_set.ex_mask_.sync (this->handler_rep_.max_handlep1 ()); -#endif /* ACE_WIN32 */ - } - - return nfound; - // Timed out or input available -} - -int -ACE_FoxReactor::FoxWaitForMultipleEvents (int width, - ACE_Select_Reactor_Handle_Set &wait_set, - ACE_Time_Value */*max_wait_time*/) -{ - // Check to make sure our handle's are all usable. - ACE_Select_Reactor_Handle_Set temp_set = wait_set; - - if (ACE_OS::select (width, - temp_set.rd_mask_, - temp_set.wr_mask_, - temp_set.ex_mask_, - (ACE_Time_Value *) &ACE_Time_Value::zero ) == -1) - return -1; // Bad file arguments... - - // Qt processing. - this->fxapp->runOneEvent () ; - - // Reset the width, in case it changed during the upcalls. - width = handler_rep_.max_handlep1 (); - - // Now actually read the result needed by the using - // . - return ACE_OS::select(width, - orig_wait_set.rd_mask_, - orig_wait_set.wr_mask_, - orig_wait_set.ex_mask_, - (ACE_Time_Value *) &ACE_Time_Value::zero); -} - -// mbrudka: who needs wait_for_multiple_events? It seems it's cargo load now! -int -ACE_QtReactor::wait_for_multiple_events ( - ACE_Select_Reactor_Handle_Set &handle_set, - ACE_Time_Value *max_wait_time) -{ - ACE_TRACE ("ACE_QtReactor::wait_for_multiple_events"); - - int nfound = 0; - do - { - max_wait_time = this->timer_queue_->calculate_timeout (max_wait_time); - size_t width = this->handler_rep_.max_handlep1 (); - handle_set.rd_mask_ = this->wait_set_.rd_mask_; - handle_set.wr_mask_ = this->wait_set_.wr_mask_; - handle_set.ex_mask_ = this->wait_set_.ex_mask_; - - nfound = QtWaitForMultipleEvents (width, - handle_set, - max_wait_time); - - } while( nfound == -1 && this->handle_error () > 0 ); - - if (nfound > 0) - { -#if !defined (ACE_WIN32) - handle_set.rd_mask_.sync (this->handler_rep_.max_handlep1 ()); - handle_set.wr_mask_.sync (this->handler_rep_.max_handlep1 ()); - handle_set.ex_mask_.sync (this->handler_rep_.max_handlep1 ()); -#endif /* ACE_WIN32 */ - } - - return nfound; - // Timed out or input available -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/QtReactor/QtReactor.h b/deps/acelite/ace/QtReactor/QtReactor.h deleted file mode 100644 index 4a1279694..000000000 --- a/deps/acelite/ace/QtReactor/QtReactor.h +++ /dev/null @@ -1,224 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file QtReactor.h - * - * @author Hamish Friedlander - * @author Balachandran Natarajan - */ -//============================================================================= - -#ifndef ACE_QTREACTOR_H -#define ACE_QTREACTOR_H - -#include /**/ "ace/pre.h" - -#include "ace/QtReactor/ACE_QtReactor_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Select_Reactor.h" -#include "ace/Map_Manager.h" - -#if defined (ACE_HAS_QT4) -# include "QtCore/qglobal.h" -#endif - -// QT toolkit specific includes. -#include /**/ -#include /**/ -#include /**/ -#include /**/ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_QtReactor - * - * @brief An object-oriented event demultiplexor and event handler - * dispatcher that uses the Qt Library. This class declaration - * also uses the extension facilities provided by the Qt. So, - * readers of the class declaration should not be upset with - * the appearence of the Keywords like Q_OBJECT, private slots - * etc. They are specific to Qt which uses these as a call back - * methods implementation mechanism. - * - * \note Marek Brudka : ACE_QtReactor was - * quickly bugfixed to meet ACE 5.4.2 (6.0.0?) deadline. - * While it passes QtReactor_Test now, there is a great - * room for improvements as the implementation is rather inefficient - * and obfuscated - * To be more specific: - * - reset_timeout always creates and removes qtimer after each - * timeout event! Obviously, for fast triggering timers this may - * lead to excessive memory management. - * - create/destroy_notifiers_for_handle may also be reworked to - * establish more clean relations between handles and QSocketNotifiers. - * - read/write_exception_event disable now SocketNotifier for a while - * to clear pending events. The cost of this operation is high: two hash - * acces in ACE and at least two next ones in Qt. This makes QtReator slow, - * but how clear pending events another way ? - * - there is qapplication() mutator, which sets new qapplication for - * QtReactor. This mutator violates implicit assumption about the - * relations between QTimer and QSocketNotifiers and QApplication for - * this reactor, namely one may expect that after qapplication(), none - * of QtReactor artifacts is bound to old qapplication. That's not true - * now, as QTimer and QSocketNotifiers are not reparent to new - * QApplication. As a result, the sequence: - * QApplication *old_qapp = new QApplication(..); - * QtReactor qreactor( old_qapp); - * // .. register handlers, schedule_timers etc - * QApplication *new_qapp = new QApplication(..); - * qreactor.qpplication( new_qapp ); - * delete old_qapp; - * almost always leads to problems and memory violation, because - * QSocketNotifiers are released by old_qapp. Therefore QtReactor - * should not be reparent now by setting new qapplication. - * - the lifecycle of Qt objects in ACE contects is rather mysterious - * and should be made more explicit. - * - valgrind reports a small memory leak in QtReactor_Test, though as for now - * it is not clear if the leak is introduced by QtReactor, or rather incorrect - * memory management in QtReactor_Test. - */ -class ACE_QtReactor_Export ACE_QtReactor - : public QObject, - public ACE_Select_Reactor -{ - - Q_OBJECT - -public: - /** \brief Constructor follows @ACE_Select_Reactor - \param QApplication *qapp, qapplication which runs events loop - */ - ACE_QtReactor (QApplication *qapp = 0, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify *notify = 0, - bool mask_signals = true, - int s_queue = ACE_SELECT_TOKEN::FIFO); - - /** \brief Constructor follows @ACE_Select_Reactor - \param QApplication *qapp, qapplication which runs events loop - */ - ACE_QtReactor (size_t size, - QApplication *qapp = 0, - bool restart = false, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify *notify = 0, - bool mask_signals = true, - int s_queue = ACE_SELECT_TOKEN::FIFO); - - virtual ~ACE_QtReactor (void); - - void qapplication (QApplication *qapp); - - // = Timer operations. - virtual long schedule_timer (ACE_Event_Handler *handler, - const void *arg, - const ACE_Time_Value &delay_time, - const ACE_Time_Value &interval); - - virtual int cancel_timer (ACE_Event_Handler *handler, - int dont_call_handle_close = 1); - - virtual int cancel_timer (long timer_id, - const void **arg = 0, - int dont_call_handle_close = 1); - -protected: - - // = Register timers/handles with Qt - - /// Register a single @a handler. - virtual int register_handler_i (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - - /// Register a set of with Qt. - virtual int register_handler_i (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - - - /// Remove the associated with this @a handle. - virtual int remove_handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - - /// Remove a set of . - virtual int remove_handler_i (const ACE_Handle_Set &handles, - ACE_Reactor_Mask mask); - - /// Wait for events to occur. - virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_set, - ACE_Time_Value *max_wait_time); - - virtual int QtWaitForMultipleEvents (int width, - ACE_Select_Reactor_Handle_Set &wait_set, - ACE_Time_Value *max_wait_time); - - virtual int bit_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Select_Reactor_Handle_Set &handle_set, - int ops); - - int set_enable_flag_by_mask (int flag_value, ACE_HANDLE handle, ACE_Reactor_Mask mask); - void create_notifiers_for_handle (ACE_HANDLE handle); - void destroy_notifiers_for_handle (ACE_HANDLE handle); - - // Wait for Qt events to occur - - /// Some Qt stuff that we need to have - QApplication *qapp_ ; - - /// Typedef of a map. - typedef ACE_Map_Manager MAP; - - /// A notifier for a read - MAP read_notifier_; - - /// A write notifier - MAP write_notifier_; - - /// An exception notifier - MAP exception_notifier_; - - /// The timer class that would provide timer-sgnals & single-shot timers - QTimer *qtime_ ; - -private: - /// This method ensures there's an Qt timeout for the first timeout - /// in the Reactor's Timer_Queue. - void reset_timeout (void); - /// reopens notification pipe to create SocketNotifier for it - void reopen_notification_pipe(void); - /// Deny access since member-wise won't work... - ACE_QtReactor (const ACE_QtReactor &); - ACE_QtReactor &operator= (const ACE_QtReactor &); - -private slots: - - // These are all part of the communication mechanism adopted in Qt. - /// Dispatch a Read Event - void read_event (int FD); - - /// Dispatch a Write Event - void write_event (int FD); - - /// Dispatch an exception event - void exception_event (int FD); - - /// Dispatch a timeout event - void timeout_event (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_QTREACTOR_H */ diff --git a/deps/acelite/ace/QtReactor/ace_qt4reactor.mpc b/deps/acelite/ace/QtReactor/ace_qt4reactor.mpc deleted file mode 100644 index 107c1ef2d..000000000 --- a/deps/acelite/ace/QtReactor/ace_qt4reactor.mpc +++ /dev/null @@ -1,29 +0,0 @@ -// -*- MPC -*- now wouldn't this be cool... -project(ACE_Qt4Reactor_moc) : acedefaults, ace_qt4 { - custom_only = 1 - MOC_Files { - QtReactor.h - } -} - -project(ACE_Qt4Reactor) : acedefaults, install, acelib, ace_output, ace_qt4 { - after += ACE_Qt4Reactor_moc - sharedname = ACE_QtReactor - dynamicflags += ACE_QTREACTOR_BUILD_DLL - - MOC_Files { - } - - Source_Files { - QtReactor_moc.cpp - QtReactor.cpp - } - - Header_Files { - ACE_QtReactor_export.h - } - - specific { - install_dir = ace/QtReactor - } -} diff --git a/deps/acelite/ace/RB_Tree.cpp b/deps/acelite/ace/RB_Tree.cpp index 8ca11831b..0c8c2a713 100644 --- a/deps/acelite/ace/RB_Tree.cpp +++ b/deps/acelite/ace/RB_Tree.cpp @@ -17,6 +17,11 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tc4(ACE_RB_Tree) +ACE_ALLOC_HOOK_DEFINE_Tc4(ACE_RB_Tree_Iterator_Base) +ACE_ALLOC_HOOK_DEFINE_Tc4(ACE_RB_Tree_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tc4(ACE_RB_Tree_Reverse_Iterator) + // Constructor. template @@ -1094,8 +1099,6 @@ ACE_RB_Tree::remove_i (ACE_RB_Tree_Node< return 0; } -ACE_ALLOC_HOOK_DEFINE(ACE_RB_Tree_Iterator_Base) - // Constructor. template @@ -1174,8 +1177,6 @@ ACE_RB_Tree_Iterator_Base::dump_i (void) } -ACE_ALLOC_HOOK_DEFINE(ACE_RB_Tree_Iterator) - // Constructor. template @@ -1209,7 +1210,6 @@ ACE_RB_Tree_Iterator::~ACE_RB_Tree_Itera ACE_TRACE ("ACE_RB_Tree_Iterator::~ACE_RB_Tree_Iterator"); } -ACE_ALLOC_HOOK_DEFINE(ACE_RB_Tree_Reverse_Iterator) // Constructor. diff --git a/deps/acelite/ace/RB_Tree.h b/deps/acelite/ace/RB_Tree.h index 2f35d6b53..b3b08f19a 100644 --- a/deps/acelite/ace/RB_Tree.h +++ b/deps/acelite/ace/RB_Tree.h @@ -52,8 +52,6 @@ template class ACE_RB_Tree_Node : public ACE_RB_Tree_Node_Base { public: - // = Initialization and termination methods. - /// Constructor. ACE_RB_Tree_Node (const EXT_ID &k, const INT_ID &t); @@ -124,7 +122,7 @@ public: * inlining is disabled and on platforms where * @c ACE_TEMPLATES_REQUIRE_SOURCE is defined. In those * platform/configuration combinations, multiple definitions - * of this method occured. Placing the definition inline in + * of this method occurred. Placing the definition inline in * the header avoids such errors. */ ACE_Allocator * allocator (void) const { return this->allocator_; } @@ -201,12 +199,9 @@ public: typedef ACE_RB_Tree_Iterator iterator; typedef ACE_RB_Tree_Reverse_Iterator reverse_iterator; - // = Initialization and termination methods. - /// Constructor. ACE_RB_Tree (ACE_Allocator *alloc = 0); - /// Copy constructor. ACE_RB_Tree (const ACE_RB_Tree &rbt); @@ -438,6 +433,9 @@ public: /// Destroys all nodes and sets the root pointer null. void clear (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /// Reinitialize constructor. /** @@ -624,9 +622,6 @@ public: ACE_ALLOC_HOOK_DECLARE; protected: - - // = Initialization and termination methods. - /// Create the singular iterator. No valid iterator can be equal to /// it, it is illegal to dereference a singular iterator, etc. etc. ACE_RB_Tree_Iterator_Base (void); @@ -688,10 +683,7 @@ protected: template class ACE_RB_Tree_Iterator : public ACE_RB_Tree_Iterator_Base { - public: - - // = Initialization and termination methods. /** * Create the singular iterator. * It is illegal to deference the iterator, no valid iterator is @@ -806,10 +798,7 @@ public: template class ACE_RB_Tree_Reverse_Iterator : public ACE_RB_Tree_Iterator_Base { - public: - - // = Initialization and termination methods. /** * Create the singular iterator. * It is illegal to deference the iterator, no valid iterator is diff --git a/deps/acelite/ace/README b/deps/acelite/ace/README index 39e05ddb0..c5d8f3679 100644 --- a/deps/acelite/ace/README +++ b/deps/acelite/ace/README @@ -707,28 +707,36 @@ ACE_HAS_UINT64_T Platform provides the uint64_t type. ACE_INT8_TYPE Specific type to use for ACE_INT8. If not defined, ACE will attempt to - determine the correct type. + determine the correct type + unless ACE_HAS_INT8_T has been defined ACE_INT16_TYPE Specific type to use for ACE_INT16. If not defined, ACE will attempt to - determine the correct type. + determine the correct type + unless ACE_HAS_INT16_T has been defined ACE_INT32_TYPE Specific type to use for ACE_INT32. If not defined, ACE will attempt to - determine the correct type. + determine the correct type + unless ACE_HAS_INT32_T has been defined ACE_INT64_TYPE Specific type to use for ACE_INT64. If not defined, ACE will attempt to - determine the correct type. + determine the correct type + unless ACE_HAS_INT64_T has been defined ACE_UINT8_TYPE Specific type to use for ACE_UINT8. If not defined, ACE will attempt to - determine the correct type. + determine the correct type + unless ACE_HAS_UINT8_T has been defined ACE_UINT16_TYPE Specific type to use for ACE_UINT16. If not defined, ACE will attempt to - determine the correct type. + determine the correct type + unless ACE_HAS_UINT16_T has been defined ACE_UINT32_TYPE Specific type to use for ACE_UINT32. If not defined, ACE will attempt to - determine the correct type. + determine the correct type + unless ACE_HAS_UINT32_T has been defined ACE_UINT64_TYPE Specific type to use for ACE_UINT64. If not defined, ACE will attempt to - determine the correct type. + determine the correct type + unless ACE_HAS_UINT64_T has been defined ACE_INT8_FORMAT_SPECIFIER String literal containing *printf format specifier (including the '%') @@ -953,6 +961,7 @@ ACE_LACKS_QSORT Compiler/platform lacks the ACE_LACKS_READLINK Platform lacks the readlink() function. ACE_LACKS_READV Platform doesn't define readv, so use our own +ACE_LACKS_RENAME Platform lacks rename(). ACE_LACKS_RLIMIT Platform/compiler lacks {get,set}rlimit() function (e.g., VxWorks, Chorus, and @@ -1065,9 +1074,6 @@ ACE_LACKS_TIMESPEC_T Platform does not define struct timespec. ACE_LACKS_TRUNCATE Platform doesn't have truncate() (e.g., vxworks) -ACE_LACKS_U_LONGLONG_T Platform does not have - u_longlong_t typedef, and - "sun" is defined. ACE_LACKS_UALARM_PROTOTYPE Platform/compiler lacks the ualarm() prototype (e.g., Solaris) diff --git a/deps/acelite/ace/RW_Mutex.cpp b/deps/acelite/ace/RW_Mutex.cpp index 15775f042..3711ca5ce 100644 --- a/deps/acelite/ace/RW_Mutex.cpp +++ b/deps/acelite/ace/RW_Mutex.cpp @@ -3,7 +3,7 @@ * * Originally in Synch.cpp * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ #include "ace/RW_Mutex.h" diff --git a/deps/acelite/ace/RW_Mutex.h b/deps/acelite/ace/RW_Mutex.h index 8a223c639..46f7458ed 100644 --- a/deps/acelite/ace/RW_Mutex.h +++ b/deps/acelite/ace/RW_Mutex.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/RW_Process_Mutex.h b/deps/acelite/ace/RW_Process_Mutex.h index 5ad1122da..f07a56735 100644 --- a/deps/acelite/ace/RW_Process_Mutex.h +++ b/deps/acelite/ace/RW_Process_Mutex.h @@ -4,7 +4,7 @@ /** * @file RW_Process_Mutex.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/RW_Thread_Mutex.cpp b/deps/acelite/ace/RW_Thread_Mutex.cpp index 1d94430ed..cffcc8d4e 100644 --- a/deps/acelite/ace/RW_Thread_Mutex.cpp +++ b/deps/acelite/ace/RW_Thread_Mutex.cpp @@ -3,13 +3,17 @@ * * Originally in Synch.cpp * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ #include "ace/RW_Thread_Mutex.h" #if defined (ACE_HAS_THREADS) +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/RW_Thread_Mutex.inl" #endif /* __ACE_INLINE__ */ diff --git a/deps/acelite/ace/RW_Thread_Mutex.h b/deps/acelite/ace/RW_Thread_Mutex.h index 1f096bec1..d54997e7b 100644 --- a/deps/acelite/ace/RW_Thread_Mutex.h +++ b/deps/acelite/ace/RW_Thread_Mutex.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/Reactor.h b/deps/acelite/ace/Reactor.h index fa2759f2a..d44a51909 100644 --- a/deps/acelite/ace/Reactor.h +++ b/deps/acelite/ace/Reactor.h @@ -5,7 +5,7 @@ * @file Reactor.h * * @author Irfan Pyarali - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -341,7 +341,6 @@ public: ACE_Reactor_Mask mask); #if defined (ACE_WIN32) - /** * Register handler for OS events. * @@ -360,7 +359,6 @@ public: */ int register_handler (ACE_Event_Handler *event_handler, ACE_HANDLE event_handle = ACE_INVALID_HANDLE); - #endif /* ACE_WIN32 */ /** @@ -578,7 +576,19 @@ public: const ACE_Time_Value &delay, const ACE_Time_Value &interval = ACE_Time_Value::zero); - +#if defined (ACE_HAS_CPP11) + template> + long schedule_timer (ACE_Event_Handler *event_handler, + const void *arg, + const std::chrono::duration& delay, + const std::chrono::duration& interval = + std::chrono::duration::zero ()) + { + ACE_Time_Value const tv_delay (delay); + ACE_Time_Value const tv_interval (interval); + return this->schedule_timer (event_handler, arg, tv_delay, tv_interval); + } +#endif /** * Reset recurring timer interval. * @@ -592,6 +602,15 @@ public: */ virtual int reset_timer_interval (long timer_id, const ACE_Time_Value &interval); +#if defined (ACE_HAS_CPP11) + template + int reset_timer_interval (long timer_id, + const std::chrono::duration& interval) + { + ACE_Time_Value const tv_interval (interval); + return this->reset_timer_interval (timer_id, tv_interval); + } +#endif /** * Cancel timer. diff --git a/deps/acelite/ace/Reactor_Impl.cpp b/deps/acelite/ace/Reactor_Impl.cpp index f8389bd87..dd496854a 100644 --- a/deps/acelite/ace/Reactor_Impl.cpp +++ b/deps/acelite/ace/Reactor_Impl.cpp @@ -2,6 +2,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE (ACE_Reactor_Impl) + ACE_Reactor_Impl::~ACE_Reactor_Impl (void) { } diff --git a/deps/acelite/ace/Reactor_Impl.h b/deps/acelite/ace/Reactor_Impl.h index 44d5d55af..b6513e5ec 100644 --- a/deps/acelite/ace/Reactor_Impl.h +++ b/deps/acelite/ace/Reactor_Impl.h @@ -45,19 +45,18 @@ class ACE_Sig_Set; class ACE_Export ACE_Reactor_Notify : public ACE_Event_Handler { public: - // = Initialization and termination methods. virtual int open (ACE_Reactor_Impl *, ACE_Timer_Queue *timer_queue = 0, int disable_notify = 0) = 0; virtual int close (void) = 0; /** - * Called by a thread when it wants to unblock the . - * This wakeups the if currently blocked. Pass over - * both the *and* the @a mask to allow the caller to - * dictate which method the will + * Called by a thread when it wants to unblock the Reactor_Impl. + * This wakeups the Reactor_Impl if currently blocked. Pass over + * both the Event_Handler *and* the @a mask to allow the caller to + * dictate which Event_Handler method the Reactor_Impl will * invoke. The ACE_Time_Value indicates how long to blocking - * trying to notify the . If @a timeout == 0, the + * trying to notify the Reactor_Impl. If @a timeout == 0, the * caller will block until action is possible, else will wait until * the relative time specified in *@a timeout elapses). */ @@ -66,29 +65,29 @@ public: ACE_Time_Value *timeout = 0) = 0; /// Handles pending threads (if any) that are waiting to unblock the - /// . + /// Reactor_Impl. virtual int dispatch_notifications (int &number_of_active_handles, ACE_Handle_Set &rd_mask) = 0; /// Returns the ACE_HANDLE of the notify pipe on which the reactor /// is listening for notifications so that other threads can unblock - /// the + /// the Reactor_Impl virtual ACE_HANDLE notify_handle (void) = 0; /// Verify whether the buffer has dispatchable info or not. virtual int is_dispatchable (ACE_Notification_Buffer &buffer)= 0; - /// Handle one of the notify call on the . This could be - /// because of a thread trying to unblock the + /// Handle one of the notify call on the handle. This could be + /// because of a thread trying to unblock the Reactor_Impl virtual int dispatch_notify (ACE_Notification_Buffer &buffer) = 0; /// Read one of the notify call on the @a handle into the /// @a buffer. This could be because of a thread trying to unblock - /// the + /// the Reactor_Impl virtual int read_notify_pipe (ACE_HANDLE handle, ACE_Notification_Buffer &buffer) = 0; /** - * Set the maximum number of times that the method + * Set the maximum number of times that the @c handle_input method * will iterate and dispatch the ACE_Event_Handlers that are * passed in via the notify queue before breaking out of the event * loop. By default, this is set to -1, which means "iterate until @@ -99,7 +98,7 @@ public: virtual void max_notify_iterations (int) = 0; /** - * Get the maximum number of times that the method + * Get the maximum number of times that the @c handle_input method * will iterate and dispatch the ACE_Event_Handlers that are * passed in via the notify queue before breaking out of its event * loop. @@ -181,8 +180,8 @@ public: * dispatched, 0 if the @a max_wait_time elapsed without dispatching * any handlers, or -1 if an error occurs. * - * The only difference between and - * is that in the alertable case, the eventloop will + * The only difference between alertable_handle_events() and + * handle_events() is that in the alertable case, the eventloop will * return when the system queues an I/O completion routine or an * Asynchronous Procedure Call. */ @@ -194,8 +193,8 @@ public: * @a max_wait_time value is a reference and can therefore never be * NULL. * - * The only difference between and - * is that in the alertable case, the eventloop will + * The only difference between alertable_handle_events() and + * handle_events() is that in the alertable case, the eventloop will * return when the system queues an I/O completion routine or an * Asynchronous Procedure Call. */ @@ -206,8 +205,8 @@ public: /** * Return the status of Reactor. If this function returns 0, the reactor is - * actively handling events. If it returns non-zero, and - * return -1 immediately. + * actively handling events. If it returns non-zero, handling_events() and + * handle_alertable_events() return -1 immediately. */ virtual int deactivated (void) = 0; @@ -221,12 +220,12 @@ public: // = Register and remove Handlers. /// Register @a event_handler with @a mask. The I/O handle will always - /// come from on the @a event_handler. + /// come from get_handle() on the @a event_handler. virtual int register_handler (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) = 0; /// Register @a event_handler with @a mask. The I/O handle is provided - /// through the parameter. + /// through the @a io_handle parameter. virtual int register_handler (ACE_HANDLE io_handle, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) = 0; @@ -242,8 +241,8 @@ public: /** * Register an @a event_handler that will be notified when - * is signaled. Since no event mask is passed - * through this interface, it is assumed that the + * event_handle is signaled. Since no event mask is passed + * through this interface, it is assumed that the @a event_handler * being passed in is an event handle and not an I/O handle. */ virtual int register_handler (ACE_Event_Handler *event_handler, @@ -253,7 +252,7 @@ public: /** * Register an @a event_handler that will be notified when - * is signaled. @a mask specifies the network events + * event_handle is signaled. @a mask specifies the network events * that the @a event_handler is interested in. */ virtual int register_handler (ACE_HANDLE event_handle, @@ -261,7 +260,7 @@ public: ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) = 0; - /// Register @a event_handler with all the @a handles in the . + /// Register @a event_handler with all the @a handles in the Handle_Set. virtual int register_handler (const ACE_Handle_Set &handles, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) = 0; @@ -285,8 +284,8 @@ public: /** * Removes @a event_handler. Note that the I/O handle will be - * obtained using method of @a event_handler . If - * @a mask == ACE_Event_Handler::DONT_CALL then the + * obtained using get_handle() method of @a event_handler . If + * @a mask == ACE_Event_Handler::DONT_CALL then the handle_close() * method of the @a event_handler is not invoked. */ virtual int remove_handler (ACE_Event_Handler *event_handler, @@ -294,7 +293,7 @@ public: /** * Removes @a handle. If @a mask == ACE_Event_Handler::DONT_CALL - * then the method of the associated + * then the handle_close() method of the associated event_handler * is not invoked. */ virtual int remove_handler (ACE_HANDLE handle, @@ -302,8 +301,8 @@ public: /** * Removes all handles in @a handle_set. If @a mask == - * ACE_Event_Handler::DONT_CALL then the method of - * the associated s is not invoked. + * ACE_Event_Handler::DONT_CALL then the handle_close() method of + * the associated event_handlers is not invoked. */ virtual int remove_handler (const ACE_Handle_Set &handle_set, ACE_Reactor_Mask mask) = 0; @@ -319,13 +318,13 @@ public: ACE_Sig_Action *old_disp = 0, int sigkey = -1) = 0; - /// Calls for every signal in @a sigset. + /// Calls remove_handler() for every signal in @a sigset. virtual int remove_handler (const ACE_Sig_Set &sigset) = 0; // = Suspend and resume Handlers. - /// Suspend @a event_handler temporarily. Use - /// to get the handle. + /// Suspend @a event_handler temporarily. Uses + /// ACE_Event_Handler::get_handle() to get the handle. virtual int suspend_handler (ACE_Event_Handler *event_handler) = 0; /// Suspend @a handle temporarily. @@ -337,7 +336,7 @@ public: /// Suspend all temporarily. virtual int suspend_handlers (void) = 0; - /// Resume @a event_handler. Use to + /// Resume @a event_handler. Uses ACE_Event_Handler::get_handle() to /// get the handle. virtual int resume_handler (ACE_Event_Handler *event_handler) = 0; @@ -347,7 +346,7 @@ public: /// Resume all @a handles in handle set. virtual int resume_handler (const ACE_Handle_Set &handles) = 0; - /// Resume all . + /// Resume all handles. virtual int resume_handlers (void) = 0; /// Does the reactor allow the application to resume the handle on @@ -388,7 +387,7 @@ public: /** * Resets the interval of the timer represented by @a timer_id to * @a interval, which is specified in relative time to the current - * . If @a interval is equal to + * gettimeofday(). If @a interval is equal to * ACE_Time_Value::zero, the timer will become a non-rescheduling * timer. Returns 0 if successful, -1 if not. */ @@ -449,7 +448,7 @@ public: * Set the maximum number of times that ACE_Reactor_Impl will * iterate and dispatch the ACE_Event_Handlers that are passed in * via the notify queue before breaking out of its - * loop. By default, this is set to + * ACE_Message_Queue::dequeue() loop. By default, this is set to * -1, which means "iterate until the queue is empty." Setting this * to a value like "1 or 2" will increase "fairness" (and thus * prevent starvation) at the expense of slightly higher dispatching @@ -461,7 +460,7 @@ public: * Get the maximum number of times that the ACE_Reactor_Impl will * iterate and dispatch the ACE_Event_Handlers that are passed in * via the notify queue before breaking out of its - * loop. + * ACE_Message_Queue::dequeue() loop. */ virtual int max_notify_iterations (void) = 0; diff --git a/deps/acelite/ace/Reactor_Timer_Interface.h b/deps/acelite/ace/Reactor_Timer_Interface.h index eaaa31a34..3000d93b1 100644 --- a/deps/acelite/ace/Reactor_Timer_Interface.h +++ b/deps/acelite/ace/Reactor_Timer_Interface.h @@ -31,7 +31,6 @@ class ACE_Event_Handler; class ACE_Export ACE_Reactor_Timer_Interface { public: - virtual ~ACE_Reactor_Timer_Interface (void); virtual long schedule_timer (ACE_Event_Handler *event_handler, @@ -39,8 +38,30 @@ public: const ACE_Time_Value &delay, const ACE_Time_Value &interval = ACE_Time_Value::zero) = 0; +#if defined (ACE_HAS_CPP11) + template> + long schedule_timer (ACE_Event_Handler *event_handler, + const void *arg, + const std::chrono::duration& delay, + const std::chrono::duration& interval = std::chrono::duration::zero ()) + { + ACE_Time_Value const tv_delay (delay); + ACE_Time_Value const tv_interval (interval); + return this->schedule_timer (event_handler, arg, tv_delay, tv_interval); + } +#endif + virtual int reset_timer_interval (long timer_id, const ACE_Time_Value &interval) = 0; +#if defined (ACE_HAS_CPP11) + template + int reset_timer_interval (long timer_id, + const std::chrono::duration& interval) + { + ACE_Time_Value const tv_interval (interval); + return this->reset_timer_interval (timer_id, tv_interval); + } +#endif virtual int cancel_timer (long timer_id, const void **arg = 0, diff --git a/deps/acelite/ace/Reactor_Token_T.cpp b/deps/acelite/ace/Reactor_Token_T.cpp index c446e4e28..f4399c903 100644 --- a/deps/acelite/ace/Reactor_Token_T.cpp +++ b/deps/acelite/ace/Reactor_Token_T.cpp @@ -3,6 +3,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Reactor_Token_T) + template void ACE_Reactor_Token_T::dump (void) const { diff --git a/deps/acelite/ace/Read_Buffer.h b/deps/acelite/ace/Read_Buffer.h index 9ef867793..b22d3f2d8 100644 --- a/deps/acelite/ace/Read_Buffer.h +++ b/deps/acelite/ace/Read_Buffer.h @@ -4,7 +4,7 @@ /** * @file Read_Buffer.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt * @author Seth Widoff */ //========================================================================== @@ -44,7 +44,6 @@ class ACE_Allocator; class ACE_Export ACE_Read_Buffer { public: - // = Initialization and termination methods. /// Read from a FILE *. ACE_Read_Buffer (FILE *fp, bool close_on_delete = false, diff --git a/deps/acelite/ace/Recursive_Thread_Mutex.cpp b/deps/acelite/ace/Recursive_Thread_Mutex.cpp index 517f8d6f8..7d379ab20 100644 --- a/deps/acelite/ace/Recursive_Thread_Mutex.cpp +++ b/deps/acelite/ace/Recursive_Thread_Mutex.cpp @@ -3,7 +3,7 @@ * * Originally in Synch.cpp * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ #include "ace/Recursive_Thread_Mutex.h" @@ -15,6 +15,9 @@ #endif /* __ACE_INLINE__ */ #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Recursive_Thread_Mutex.h b/deps/acelite/ace/Recursive_Thread_Mutex.h index 9c2d06217..8c4c867ff 100644 --- a/deps/acelite/ace/Recursive_Thread_Mutex.h +++ b/deps/acelite/ace/Recursive_Thread_Mutex.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt and + * @author Douglas C. Schmidt and * Abdullah Sowayan */ //========================================================================== diff --git a/deps/acelite/ace/Refcounted_Auto_Ptr.cpp b/deps/acelite/ace/Refcounted_Auto_Ptr.cpp index 455ee868c..d97c128b9 100644 --- a/deps/acelite/ace/Refcounted_Auto_Ptr.cpp +++ b/deps/acelite/ace/Refcounted_Auto_Ptr.cpp @@ -5,6 +5,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Refcounted_Auto_Ptr) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Refcounted_Auto_Ptr_Rep) + template ACE_Refcounted_Auto_Ptr::~ACE_Refcounted_Auto_Ptr (void) { diff --git a/deps/acelite/ace/Refcounted_Auto_Ptr.h b/deps/acelite/ace/Refcounted_Auto_Ptr.h index b5670cc05..670243dc1 100644 --- a/deps/acelite/ace/Refcounted_Auto_Ptr.h +++ b/deps/acelite/ace/Refcounted_Auto_Ptr.h @@ -45,9 +45,6 @@ template class ACE_Refcounted_Auto_Ptr { public: - - // = Initialization and termination methods. - /// Constructor that initializes an ACE_Refcounted_Auto_Ptr to /// the specified pointer value. explicit ACE_Refcounted_Auto_Ptr (X *p = 0); diff --git a/deps/acelite/ace/Remote_Name_Space.cpp b/deps/acelite/ace/Remote_Name_Space.cpp index 00378e78f..c40d190ef 100644 --- a/deps/acelite/ace/Remote_Name_Space.cpp +++ b/deps/acelite/ace/Remote_Name_Space.cpp @@ -108,9 +108,15 @@ ACE_Remote_Name_Space::resolve (const ACE_NS_WString &name, ACE_NS_WString temp (reply.value (), reply.value_len () / sizeof (ACE_WCHAR_T)); value = temp; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (type, + static_cast(ACE_Allocator::instance()->malloc(sizeof(char) * (reply.type_len () + 1))), + -1); +#else ACE_NEW_RETURN (type, char[reply.type_len () + 1], -1); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_OS::strcpy (type, reply.type ()); return 0; } @@ -361,6 +367,8 @@ ACE_Remote_Name_Space::~ACE_Remote_Name_Space (void) ACE_TRACE ("ACE_Remote_Name_Space::~ACE_Remote_Name_Space"); } +ACE_ALLOC_HOOK_DEFINE(ACE_Remote_Name_Space) + void ACE_Remote_Name_Space::dump (void) const { diff --git a/deps/acelite/ace/Remote_Name_Space.h b/deps/acelite/ace/Remote_Name_Space.h index d1dbe8a78..6c0c42722 100644 --- a/deps/acelite/ace/Remote_Name_Space.h +++ b/deps/acelite/ace/Remote_Name_Space.h @@ -45,7 +45,6 @@ typedef ACE_Unbounded_Set ACE_WSTRING_SET; class ACE_Export ACE_Remote_Name_Space : public ACE_Name_Space { public: - // = Initialization and termination methods. /// "Do-nothing" constructor. ACE_Remote_Name_Space (void); @@ -133,6 +132,8 @@ public: /// Dump the state of the object. virtual void dump (void) const; + ACE_ALLOC_HOOK_DECLARE; + private: /// Interface to Name server process for NET_LOCAL namespace. ACE_Name_Proxy ns_proxy_; diff --git a/deps/acelite/ace/Remote_Tokens.h b/deps/acelite/ace/Remote_Tokens.h index edf389b2e..582e63ee4 100644 --- a/deps/acelite/ace/Remote_Tokens.h +++ b/deps/acelite/ace/Remote_Tokens.h @@ -4,7 +4,7 @@ /** * @file Remote_Tokens.h * - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) + * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) * @author Tim Harrison (harrison@cs.wustl.edu) */ //============================================================================= diff --git a/deps/acelite/ace/Reverse_Lock_T.h b/deps/acelite/ace/Reverse_Lock_T.h index 1457c27ec..f582c3f49 100644 --- a/deps/acelite/ace/Reverse_Lock_T.h +++ b/deps/acelite/ace/Reverse_Lock_T.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/SOCK.cpp b/deps/acelite/ace/SOCK.cpp index 3cbfd4b12..6127d625d 100644 --- a/deps/acelite/ace/SOCK.cpp +++ b/deps/acelite/ace/SOCK.cpp @@ -1,5 +1,8 @@ #include "ace/SOCK.h" #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SOCK.inl" diff --git a/deps/acelite/ace/SOCK.h b/deps/acelite/ace/SOCK.h index 4392d1c20..8fa3942c4 100644 --- a/deps/acelite/ace/SOCK.h +++ b/deps/acelite/ace/SOCK.h @@ -4,7 +4,7 @@ /** * @file SOCK.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/SOCK_Acceptor.cpp b/deps/acelite/ace/SOCK_Acceptor.cpp index 819b61b73..47057df08 100644 --- a/deps/acelite/ace/SOCK_Acceptor.cpp +++ b/deps/acelite/ace/SOCK_Acceptor.cpp @@ -5,6 +5,9 @@ #include "ace/OS_NS_string.h" #include "ace/OS_NS_sys_socket.h" #include "ace/os_include/os_fcntl.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SOCK_Acceptor.inl" @@ -218,12 +221,15 @@ ACE_SOCK_Acceptor::dump (void) const int ACE_SOCK_Acceptor::shared_open (const ACE_Addr &local_sap, int protocol_family, - int backlog) + int backlog, + int ipv6_only) { ACE_TRACE ("ACE_SOCK_Acceptor::shared_open"); int error = 0; -#if defined (ACE_HAS_IPV6) +#if !defined (ACE_HAS_IPV6) + ACE_UNUSED_ARG (ipv6_only); +#else /* defined (ACE_HAS_IPV6) */ if (protocol_family == PF_INET6) { sockaddr_in6 local_inet6_addr; @@ -240,29 +246,31 @@ ACE_SOCK_Acceptor::shared_open (const ACE_Addr &local_sap, else local_inet6_addr = *reinterpret_cast (local_sap.get_addr ()); -# if defined (ACE_WIN32) - // on windows vista and later, Winsock can support dual stack sockets - // but this must be explicitly set prior to the bind. Since this - // behavior is the default on *nix platforms, it should be benigh to - // just do it here. On older platforms the setsockopt will fail, but - // that should be OK. - int zero = 0; - ACE_OS::setsockopt (this->get_handle (), - IPPROTO_IPV6, - IPV6_V6ONLY, - (char *)&zero, - sizeof (zero)); -# endif /* ACE_WIN32 */ - // We probably don't need a bind_port written here. - // There are currently no supported OS's that define - // ACE_LACKS_WILDCARD_BIND. - if (ACE_OS::bind (this->get_handle (), - reinterpret_cast (&local_inet6_addr), - sizeof local_inet6_addr) == -1) + /* + * Handle IPv6-only requests. On Windows, v6-only is the default + * unless it is turned off. On Linux, v4/v6 dual is the default + * unless v6-only is turned on. + * This must be done before attempting to bind the address. + * On Windows older than Vista this will fail. + */ + int setting = !!ipv6_only; + if (-1 == ACE_OS::setsockopt (this->get_handle (), + IPPROTO_IPV6, + IPV6_V6ONLY, + (char *)&setting, + sizeof (setting))) error = 1; + else + // We probably don't need a bind_port written here. + // There are currently no supported OS's that define + // ACE_LACKS_WILDCARD_BIND. + if (ACE_OS::bind (this->get_handle (), + reinterpret_cast (&local_inet6_addr), + sizeof local_inet6_addr) == -1) + error = 1; } else -#endif +#endif /* ACE_HAS_IPV6 */ if (protocol_family == PF_INET) { sockaddr_in local_inet_addr; @@ -312,7 +320,8 @@ ACE_SOCK_Acceptor::open (const ACE_Addr &local_sap, int reuse_addr, int protocol_family, int backlog, - int protocol) + int protocol, + int ipv6_only) { ACE_TRACE ("ACE_SOCK_Acceptor::open"); @@ -330,7 +339,8 @@ ACE_SOCK_Acceptor::open (const ACE_Addr &local_sap, else return this->shared_open (local_sap, protocol_family, - backlog); + backlog, + ipv6_only); } ACE_SOCK_Acceptor::ACE_SOCK_Acceptor (const ACE_Addr &local_sap, @@ -340,7 +350,8 @@ ACE_SOCK_Acceptor::ACE_SOCK_Acceptor (const ACE_Addr &local_sap, int reuse_addr, int protocol_family, int backlog, - int protocol) + int protocol, + int ipv6_only) { ACE_TRACE ("ACE_SOCK_Acceptor::ACE_SOCK_Acceptor"); if (this->open (local_sap, @@ -350,7 +361,8 @@ ACE_SOCK_Acceptor::ACE_SOCK_Acceptor (const ACE_Addr &local_sap, reuse_addr, protocol_family, backlog, - protocol) == -1) + protocol, + ipv6_only) == -1) ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_SOCK_Acceptor"))); @@ -363,7 +375,8 @@ ACE_SOCK_Acceptor::open (const ACE_Addr &local_sap, int reuse_addr, int protocol_family, int backlog, - int protocol) + int protocol, + int ipv6_only) { ACE_TRACE ("ACE_SOCK_Acceptor::open"); @@ -386,7 +399,8 @@ ACE_SOCK_Acceptor::open (const ACE_Addr &local_sap, else return this->shared_open (local_sap, protocol_family, - backlog); + backlog, + ipv6_only); } // General purpose routine for performing server ACE_SOCK creation. @@ -395,14 +409,16 @@ ACE_SOCK_Acceptor::ACE_SOCK_Acceptor (const ACE_Addr &local_sap, int reuse_addr, int protocol_family, int backlog, - int protocol) + int protocol, + int ipv6_only) { ACE_TRACE ("ACE_SOCK_Acceptor::ACE_SOCK_Acceptor"); if (this->open (local_sap, reuse_addr, protocol_family, backlog, - protocol) == -1) + protocol, + ipv6_only) == -1) ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_SOCK_Acceptor"))); diff --git a/deps/acelite/ace/SOCK_Acceptor.h b/deps/acelite/ace/SOCK_Acceptor.h index cda6d40b0..b05375a3c 100644 --- a/deps/acelite/ace/SOCK_Acceptor.h +++ b/deps/acelite/ace/SOCK_Acceptor.h @@ -4,7 +4,7 @@ /** * @file SOCK_Acceptor.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -37,7 +37,6 @@ class ACE_Accept_QoS_Params; class ACE_Export ACE_SOCK_Acceptor : public ACE_SOCK { public: - // = Initialization and termination methods. /// Default constructor. ACE_SOCK_Acceptor (void); @@ -46,15 +45,18 @@ public: * @a local_sap is the address that we're going to listen for * connections on. If @a reuse_addr is 1 then we'll use the * @c SO_REUSEADDR to reuse this address. + * @a ipv6_only is used when opening a IPv6 acceptor. If non-zero, + * the socket will only accept connections from IPv6 peers. If zero + * the socket will accept both IPv4 and v6 if it is able to. */ ACE_SOCK_Acceptor (const ACE_Addr &local_sap, int reuse_addr = 0, int protocol_family = PF_UNSPEC, int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); + int protocol = 0, + int ipv6_only = 0); - /// Initialize a passive-mode QoS-enabled acceptor socket. Returns 0 - /// on success and -1 on failure. + /// Initialize a passive-mode QoS-enabled acceptor socket. ACE_SOCK_Acceptor (const ACE_Addr &local_sap, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, @@ -62,20 +64,26 @@ public: int reuse_addr, int protocol_family = PF_UNSPEC, int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); + int protocol = 0, + int ipv6_only = 0); /** * Initialize a passive-mode BSD-style acceptor socket (no QoS). * @a local_sap is the address that we're going to listen for * connections on. If @a reuse_addr is 1 then we'll use the - * @c SO_REUSEADDR to reuse this address. Returns 0 on success and + * @c SO_REUSEADDR to reuse this address. + * @a ipv6_only is used when opening a IPv6 acceptor. If non-zero, + * the socket will only accept connections from IPv6 peers. If zero + * the socket will accept both IPv4 and v6 if it is able to. + * @retval Returns 0 on success and * -1 on failure. */ int open (const ACE_Addr &local_sap, int reuse_addr = 0, int protocol_family = PF_UNSPEC, int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); + int protocol = 0, + int ipv6_only = 0); /// Initialize a passive-mode QoS-enabled acceptor socket. Returns 0 /// on success and -1 on failure. @@ -86,7 +94,8 @@ public: int reuse_addr, int protocol_family = PF_UNSPEC, int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); + int protocol = 0, + int ipv6_only = 0); /// Close the socket. Returns 0 on success and -1 on failure. int close (void); @@ -159,7 +168,8 @@ protected: */ int shared_open (const ACE_Addr &local_sap, int protocol_family, - int backlog); + int backlog, + int ipv6_only); private: /// Do not allow this function to percolate up to this interface... diff --git a/deps/acelite/ace/SOCK_CODgram.cpp b/deps/acelite/ace/SOCK_CODgram.cpp index bf74e145c..3921375ac 100644 --- a/deps/acelite/ace/SOCK_CODgram.cpp +++ b/deps/acelite/ace/SOCK_CODgram.cpp @@ -1,6 +1,9 @@ #include "ace/SOCK_CODgram.h" #include "ace/Log_Category.h" #include "ace/OS_NS_sys_socket.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SOCK_CODgram.inl" diff --git a/deps/acelite/ace/SOCK_Connector.cpp b/deps/acelite/ace/SOCK_Connector.cpp index 460146292..e84767064 100644 --- a/deps/acelite/ace/SOCK_Connector.cpp +++ b/deps/acelite/ace/SOCK_Connector.cpp @@ -4,6 +4,9 @@ #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_sys_socket.h" #include "ace/os_include/os_fcntl.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (ACE_HAS_WINCE) #include "ace/OS_QoS.h" @@ -193,6 +196,19 @@ ACE_SOCK_Connector::connect (ACE_SOCK_Stream &new_stream, local_sap) == -1) return -1; +#if defined(ACE_WIN32) && defined(ACE_HAS_IPV6) + // On windows, the IPv4-mapped IPv6 address format can only be used on a dual-stack socket. + const ACE_INET_Addr& remote_address = static_cast(remote_sap); + if (remote_address.is_ipv4_mapped_ipv6()) { + int zero = 0; + ACE_OS::setsockopt(new_stream.get_handle(), + IPPROTO_IPV6, + IPV6_V6ONLY, + (char *)&zero, + sizeof(zero)); + } +#endif + int result = ACE_OS::connect (new_stream.get_handle (), reinterpret_cast (remote_sap.get_addr ()), remote_sap.get_size ()); @@ -228,6 +244,19 @@ ACE_SOCK_Connector::connect (ACE_SOCK_Stream &new_stream, local_sap) == -1) return -1; +#if defined(ACE_WIN32) && defined(ACE_HAS_IPV6) + // On windows, the IPv4-mapped IPv6 address format can only be used on a dual-stack socket. + const ACE_INET_Addr& remote_address = static_cast(remote_sap); + if (remote_address.is_ipv4_mapped_ipv6()) { + int zero = 0; + ACE_OS::setsockopt(new_stream.get_handle(), + IPPROTO_IPV6, + IPV6_V6ONLY, + (char *)&zero, + sizeof(zero)); + } +#endif + int result = ACE_OS::connect (new_stream.get_handle (), reinterpret_cast (remote_sap.get_addr ()), remote_sap.get_size (), diff --git a/deps/acelite/ace/SOCK_Connector.h b/deps/acelite/ace/SOCK_Connector.h index a8f7d3603..e84410257 100644 --- a/deps/acelite/ace/SOCK_Connector.h +++ b/deps/acelite/ace/SOCK_Connector.h @@ -4,7 +4,7 @@ /** * @file SOCK_Connector.h * - * @author Doug Schmidt + * @author Doug Schmidt */ //============================================================================= @@ -259,7 +259,7 @@ public: * to the peer. * @param remote_sap If non-0, it points to the @c ACE_INET_Addr object * that will contain the address of the connected peer. - * @param timeout Same values and return value possibilites as for + * @param timeout Same values and return value possibilities as for * connect(). @see connect(). */ int complete (ACE_SOCK_Stream &new_stream, diff --git a/deps/acelite/ace/SOCK_Dgram.cpp b/deps/acelite/ace/SOCK_Dgram.cpp index 75b078667..17b00ad01 100644 --- a/deps/acelite/ace/SOCK_Dgram.cpp +++ b/deps/acelite/ace/SOCK_Dgram.cpp @@ -8,6 +8,9 @@ #include "ace/OS_NS_ctype.h" #include "ace/os_include/net/os_if.h" #include "ace/Truncate.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) # include "ace/SOCK_Dgram.inl" @@ -63,9 +66,16 @@ ACE_SOCK_Dgram::recv (iovec *io_vec, return -1; else if (inlen > 0) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (io_vec->iov_base, + static_cast(ACE_Allocator::instance()->malloc(sizeof(char) * inlen)), + -1); +#else ACE_NEW_RETURN (io_vec->iov_base, char[inlen], -1); +#endif /* ACE_HAS_ALLOC_HOOKS */ + ssize_t rcv_len = ACE_OS::recvfrom (this->get_handle (), (char *) io_vec->iov_base, inlen, @@ -74,7 +84,11 @@ ACE_SOCK_Dgram::recv (iovec *io_vec, &addr_len); if (rcv_len < 0) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(io_vec->iov_base); +#else delete [] (char *)io_vec->iov_base; +#endif /* ACE_HAS_ALLOC_HOOKS */ io_vec->iov_base = 0; } else @@ -102,10 +116,26 @@ ACE_SOCK_Dgram::recv (iovec *io_vec, int ACE_SOCK_Dgram::shared_open (const ACE_Addr &local, - int protocol_family) + int protocol_family, + int ipv6_only) { ACE_TRACE ("ACE_SOCK_Dgram::shared_open"); bool error = false; +#if defined (ACE_HAS_IPV6) + int setting = !!ipv6_only; + if (protocol_family == PF_INET6 && + -1 == ACE_OS::setsockopt (this->get_handle (), + IPPROTO_IPV6, + IPV6_V6ONLY, + (char *)&setting, + sizeof (setting))) + { + this->close(); + return -1; + } +#else + ACE_UNUSED_ARG (ipv6_only); +#endif /* defined (ACE_HAS_IPV6) */ if (local == ACE_Addr::sap_any) { @@ -139,7 +169,8 @@ ACE_SOCK_Dgram::open (const ACE_Addr &local, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, - int reuse_addr) + int reuse_addr, + int ipv6_only) { if (ACE_SOCK::open (SOCK_DGRAM, protocol_family, @@ -150,7 +181,8 @@ ACE_SOCK_Dgram::open (const ACE_Addr &local, reuse_addr) == -1) return -1; else if (this->shared_open (local, - protocol_family) == -1) + protocol_family, + ipv6_only) == -1) return -1; else return 0; @@ -162,7 +194,8 @@ int ACE_SOCK_Dgram::open (const ACE_Addr &local, int protocol_family, int protocol, - int reuse_addr) + int reuse_addr, + int ipv6_only) { ACE_TRACE ("ACE_SOCK_Dgram::open"); @@ -184,7 +217,8 @@ ACE_SOCK_Dgram::open (const ACE_Addr &local, return -1; else return this->shared_open (local, - protocol_family); + protocol_family, + ipv6_only); } // Here's the general-purpose constructor used by a connectionless @@ -193,14 +227,16 @@ ACE_SOCK_Dgram::open (const ACE_Addr &local, ACE_SOCK_Dgram::ACE_SOCK_Dgram (const ACE_Addr &local, int protocol_family, int protocol, - int reuse_addr) + int reuse_addr, + int ipv6_only) { ACE_TRACE ("ACE_SOCK_Dgram::ACE_SOCK_Dgram"); if (this->open (local, protocol_family, protocol, - reuse_addr) == -1) + reuse_addr, + ipv6_only) == -1) ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_SOCK_Dgram"))); @@ -212,7 +248,8 @@ ACE_SOCK_Dgram::ACE_SOCK_Dgram (const ACE_Addr &local, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, - int reuse_addr) + int reuse_addr, + int ipv6_only) { ACE_TRACE ("ACE_SOCK_Dgram::ACE_SOCK_Dgram"); if (this->open (local, @@ -221,7 +258,8 @@ ACE_SOCK_Dgram::ACE_SOCK_Dgram (const ACE_Addr &local, protocolinfo, g, flags, - reuse_addr) == -1) + reuse_addr, + ipv6_only) == -1) ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_SOCK_Dgram"))); @@ -253,11 +291,16 @@ ACE_SOCK_Dgram::send (const iovec iov[], send_msg.msg_control = 0; send_msg.msg_controllen = 0; send_msg.msg_flags = 0; -#else +#elif !defined ACE_LACKS_SENDMSG send_msg.msg_accrights = 0; send_msg.msg_accrightslen = 0; #endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ +#ifdef ACE_WIN32 + send_msg.msg_control = 0; + send_msg.msg_controllen = 0; +#endif + return ACE_OS::sendmsg (this->get_handle (), &send_msg, flags); @@ -270,11 +313,29 @@ ssize_t ACE_SOCK_Dgram::recv (iovec iov[], int n, ACE_Addr &addr, - int flags) const + int flags, + ACE_INET_Addr *to_addr) const { ACE_TRACE ("ACE_SOCK_Dgram::recv"); msghdr recv_msg; +#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) || defined ACE_WIN32 +#define ACE_USE_MSG_CONTROL + union control_buffer { + cmsghdr control_msg_header; +#if defined (IP_RECVDSTADDR) + u_char padding[ACE_CMSG_SPACE (sizeof (in_addr))]; +#elif defined (IP_PKTINFO) + u_char padding[ACE_CMSG_SPACE (sizeof (in_pktinfo))]; +#endif +#if defined (ACE_HAS_IPV6) + u_char padding6[ACE_CMSG_SPACE (sizeof (in6_pktinfo))]; +#endif + } cbuf; +#else + ACE_UNUSED_ARG (to_addr); +#endif + recv_msg.msg_iov = (iovec *) iov; recv_msg.msg_iovlen = n; #if defined (ACE_HAS_SOCKADDR_MSG_NAME) @@ -284,19 +345,60 @@ ACE_SOCK_Dgram::recv (iovec iov[], #endif /* ACE_HAS_SOCKADDR_MSG_NAME */ recv_msg.msg_namelen = addr.get_size (); -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - recv_msg.msg_control = 0 ; - recv_msg.msg_controllen = 0 ; -#else +#ifdef ACE_USE_MSG_CONTROL + recv_msg.msg_control = to_addr ? &cbuf : 0; + recv_msg.msg_controllen = to_addr ? sizeof (cbuf) : 0; +#elif !defined ACE_LACKS_SENDMSG recv_msg.msg_accrights = 0; recv_msg.msg_accrightslen = 0; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ +#endif ssize_t status = ACE_OS::recvmsg (this->get_handle (), &recv_msg, flags); addr.set_size (recv_msg.msg_namelen); addr.set_type (((sockaddr_in *) addr.get_addr())->sin_family); + +#ifdef ACE_USE_MSG_CONTROL + if (to_addr) { + this->get_local_addr (*to_addr); + if (to_addr->get_type() == AF_INET) { +#if defined (IP_RECVDSTADDR) || defined (IP_PKTINFO) + for (cmsghdr *ptr = ACE_CMSG_FIRSTHDR (&recv_msg); ptr; ptr = ACE_CMSG_NXTHDR (&recv_msg, ptr)) { +#if defined (IP_RECVDSTADDR) + if (ptr->cmsg_level == IPPROTO_IP && ptr->cmsg_type == IP_RECVDSTADDR) { + to_addr->set_address ((const char *) (ACE_CMSG_DATA (ptr)), + sizeof (struct in_addr), + 0); + break; + } +#else + if (ptr->cmsg_level == IPPROTO_IP && ptr->cmsg_type == IP_PKTINFO) { + to_addr->set_address ((const char *) &(((in_pktinfo *) (ACE_CMSG_DATA (ptr)))->ipi_addr), + sizeof (struct in_addr), + 0); + break; + } +#endif + } +#endif + } +#if defined (ACE_HAS_IPV6) && defined (IPV6_PKTINFO) + else if (to_addr->get_type() == AF_INET6) { + for (cmsghdr *ptr = ACE_CMSG_FIRSTHDR (&recv_msg); ptr; ptr = ACE_CMSG_NXTHDR (&recv_msg, ptr)) { + if (ptr->cmsg_level == IPPROTO_IPV6 && ptr->cmsg_type == IPV6_PKTINFO) { + to_addr->set_address ((const char *) &(((in6_pktinfo *)(ACE_CMSG_DATA (ptr)))->ipi6_addr), + sizeof (struct in6_addr), + 0); + + break; + } + } + } +#endif + } +#endif + return status; } @@ -332,9 +434,14 @@ ACE_SOCK_Dgram::send (const iovec iov[], #if defined (ACE_HAS_ALLOCA) buf = alloca (length); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (buf, (buf *) + ACE_Allocator::instance ()->malloc (length), -1); +# else ACE_NEW_RETURN (buf, char[length], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ char *ptr = buf; @@ -347,7 +454,11 @@ ACE_SOCK_Dgram::send (const iovec iov[], ssize_t result = ACE_SOCK_Dgram::send (buf, length, addr, flags); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (buf); +# else delete [] buf; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ return result; } @@ -359,13 +470,16 @@ ssize_t ACE_SOCK_Dgram::recv (iovec iov[], int n, ACE_Addr &addr, - int flags) const + int flags, + ACE_INET_Addr *to_addr) const { ACE_TRACE ("ACE_SOCK_Dgram::recv"); ssize_t length = 0; int i; + ACE_UNUSED_ARG (to_addr); + for (i = 0; i < n; i++) #if ! (defined(__BORLANDC__) || defined(ACE_LINUX) || defined(ACE_HAS_RTEMS)) // The iov_len is unsigned on Linux, RTEMS and with Borland. If we go @@ -381,9 +495,14 @@ ACE_SOCK_Dgram::recv (iovec iov[], #if defined (ACE_HAS_ALLOCA) buf = alloca (length); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (buf, (buf *) + ACE_Allocator::instance ()->malloc (length), -1); +# else ACE_NEW_RETURN (buf, char[length], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ length = ACE_SOCK_Dgram::recv (buf, length, addr, flags); @@ -408,7 +527,11 @@ ACE_SOCK_Dgram::recv (iovec iov[], } #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (buf); +# else delete [] buf; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ return length; } @@ -606,12 +729,11 @@ ACE_SOCK_Dgram::make_multicast_ifaddr6 (ipv6_mreq *ret_mreq, 0, sizeof (lmreq)); -#if defined(ACE_LINUX) +#ifndef ACE_LACKS_IF_NAMETOINDEX if (net_if != 0) { - lmreq.ipv6mr_interface = ACE_OS::if_nametoindex (ACE_TEXT_ALWAYS_CHAR(net_if)); + lmreq.ipv6mr_interface = ACE_OS::if_nametoindex (ACE_TEXT_ALWAYS_CHAR (net_if)); } - else #elif defined (ACE_WIN32) if (net_if != 0) { @@ -667,11 +789,9 @@ ACE_SOCK_Dgram::make_multicast_ifaddr6 (ipv6_mreq *ret_mreq, delete[] buf; // clean up } - else #else /* ACE_WIN32 */ ACE_UNUSED_ARG(net_if); #endif /* ACE_WIN32 */ - lmreq.ipv6mr_interface = 0; // now set the multicast address ACE_OS::memcpy (&lmreq.ipv6mr_multiaddr, @@ -684,6 +804,6 @@ ACE_SOCK_Dgram::make_multicast_ifaddr6 (ipv6_mreq *ret_mreq, return 0; } -#endif /* ACE_LINUX && ACE_HAS_IPV6 */ +#endif /* ACE_HAS_IPV6 */ ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SOCK_Dgram.h b/deps/acelite/ace/SOCK_Dgram.h index 1b8f9f8be..674662714 100644 --- a/deps/acelite/ace/SOCK_Dgram.h +++ b/deps/acelite/ace/SOCK_Dgram.h @@ -4,7 +4,7 @@ /** * @file SOCK_Dgram.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -15,6 +15,9 @@ #include "ace/SOCK.h" #include "ace/INET_Addr.h" +// Included so users have access to ACE_RECVPKTINFO and ACE_RECVPKTINFO6 . +#include "ace/OS_NS_sys_socket.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ @@ -34,7 +37,6 @@ class ACE_Time_Value; class ACE_Export ACE_SOCK_Dgram : public ACE_SOCK { public: - // = Initialization and termination methods. /// Default constructor. ACE_SOCK_Dgram (void); @@ -43,7 +45,8 @@ public: ACE_SOCK_Dgram (const ACE_Addr &local, int protocol_family = ACE_PROTOCOL_FAMILY_INET, int protocol = 0, - int reuse_addr = 0); + int reuse_addr = 0, + int ipv6_only = 0); /** * This is a QoS-enabed method for initiating a socket dgram that @@ -56,14 +59,16 @@ public: ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g = 0, u_long flags = 0, - int reuse_addr = 0); + int reuse_addr = 0, + int ipv6_only = 0); /// This is a BSD-style method (i.e., no QoS) for initiating a socket /// dgram that will accept datagrams at the address. int open (const ACE_Addr &local, int protocol_family = ACE_PROTOCOL_FAMILY_INET, int protocol = 0, - int reuse_addr = 0); + int reuse_addr = 0, + int ipv6_only = 0); /** * This is a QoS-enabed method for initiating a socket dgram that @@ -76,7 +81,8 @@ public: ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g = 0, u_long flags = 0, - int reuse_addr = 0); + int reuse_addr = 0, + int ipv6_only = 0); /// Default dtor. ~ACE_SOCK_Dgram (void); @@ -116,11 +122,16 @@ public: int flags = 0) const; /// Recv an of size @a n to the datagram socket (uses - /// ). + /// ). The IP destination address will be placed in @a + /// *to_addr if it is not null and set_option has been called with + /// 1) level IPPROTO_IP, option ACE_RECVPKTINFO, and value 1 for + /// IPV4 addresses or 2) IPPROTO_IPV6, option ACE_RECVPKTINFO6, and + /// value 1 for IPV6 addresses. ssize_t recv (iovec iov[], int n, ACE_Addr &addr, - int flags = 0) const; + int flags = 0, + ACE_INET_Addr *to_addr = 0) const; /** * Wait up to @a timeout amount of time to receive a datagram into @@ -204,7 +215,9 @@ public: protected: /// Open is shared by this and by . - int shared_open (const ACE_Addr &local, int protocol_family); + int shared_open (const ACE_Addr &local, + int protocol_family, + int ipv6_only = 0); /// Create a multicast addr/if pair, in format useful for system calls. /// If mreq param is NULL, just verify the passed addr/interface specs. diff --git a/deps/acelite/ace/SOCK_Dgram_Bcast.cpp b/deps/acelite/ace/SOCK_Dgram_Bcast.cpp index 1ec606ca7..f4cc86f7a 100644 --- a/deps/acelite/ace/SOCK_Dgram_Bcast.cpp +++ b/deps/acelite/ace/SOCK_Dgram_Bcast.cpp @@ -6,6 +6,9 @@ #include "ace/os_include/net/os_if.h" #include "ace/OS_NS_netdb.h" #include "ace/OS_Memory.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SOCK_Dgram_Bcast.inl" @@ -25,6 +28,8 @@ ACE_Bcast_Node::ACE_Bcast_Node (ACE_INET_Addr &addr, ACE_TRACE ("ACE_Bcast_Node::ACE_Bcast_Node"); } +ACE_ALLOC_HOOK_DEFINE(ACE_Bcast_Node) + void ACE_SOCK_Dgram_Bcast::dump (void) const { @@ -150,7 +155,11 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) return -1; else ACE_OS::memcpy ((char *) &host_addr.sin_addr.s_addr, +# ifdef ACE_HOSTENT_H_ADDR + (char *) hp->ACE_HOSTENT_H_ADDR, +# else (char *) hp->h_addr, +# endif hp->h_length); } diff --git a/deps/acelite/ace/SOCK_Dgram_Bcast.h b/deps/acelite/ace/SOCK_Dgram_Bcast.h index 710565ed4..3175ba84a 100644 --- a/deps/acelite/ace/SOCK_Dgram_Bcast.h +++ b/deps/acelite/ace/SOCK_Dgram_Bcast.h @@ -44,6 +44,8 @@ public: /// Pointer to the next interface in the chain. ACE_Bcast_Node *next_; + + ACE_ALLOC_HOOK_DECLARE; }; /** @@ -55,7 +57,6 @@ public: class ACE_Export ACE_SOCK_Dgram_Bcast : public ACE_SOCK_Dgram { public: - // = Initialization and termination methods. /// Default constructor. ACE_SOCK_Dgram_Bcast (void); diff --git a/deps/acelite/ace/SOCK_Dgram_Mcast.cpp b/deps/acelite/ace/SOCK_Dgram_Mcast.cpp index dd427e282..cfaab1fcb 100644 --- a/deps/acelite/ace/SOCK_Dgram_Mcast.cpp +++ b/deps/acelite/ace/SOCK_Dgram_Mcast.cpp @@ -5,6 +5,9 @@ #include "ace/OS_NS_errno.h" #include "ace/os_include/net/os_if.h" #include "ace/os_include/arpa/os_inet.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if defined (ACE_LINUX) && defined (ACE_HAS_IPV6) #include "ace/OS_NS_sys_socket.h" @@ -145,7 +148,11 @@ ACE_SOCK_Dgram_Mcast::~ACE_SOCK_Dgram_Mcast (void) ACE_TRACE ("ACE_SOCK_Dgram_Mcast::~ACE_SOCK_Dgram_Mcast"); // Free memory and optionally unsubscribe from currently subscribed group(s). +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(this->send_net_if_); +#else delete [] this->send_net_if_; +#endif /* ACE_HAS_ALLOC_HOOKS */ this->clear_subs_list (); } @@ -241,8 +248,11 @@ ACE_SOCK_Dgram_Mcast::open_i (const ACE_INET_Addr &mcast_addr, { if (this->set_nic (net_if, mcast_addr.get_type ())) return -1; - +#if defined (ACE_HAS_ALLOC_HOOKS) + this->send_net_if_ = static_cast(ACE_Allocator::instance()->malloc(sizeof(ACE_TCHAR) * (ACE_OS::strlen (net_if) + 1))); +#else this->send_net_if_ = new ACE_TCHAR[ACE_OS::strlen (net_if) + 1]; +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_OS::strcpy (this->send_net_if_, net_if); } diff --git a/deps/acelite/ace/SOCK_Dgram_Mcast.h b/deps/acelite/ace/SOCK_Dgram_Mcast.h index 02a4b85f3..5a8d994d5 100644 --- a/deps/acelite/ace/SOCK_Dgram_Mcast.h +++ b/deps/acelite/ace/SOCK_Dgram_Mcast.h @@ -6,7 +6,7 @@ * * @author Irfan Pyrali * @author Tim Harrison - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt * @author Bill Fulton * @author Don Hinton */ @@ -191,8 +191,6 @@ public: DEFOPTS = DEFOPT_BINDADDR | DEFOPT_NULLIFACE }; - // = Initialization routines. - /// Create an unitialized instance and define per-instance optional /// functionality. /** diff --git a/deps/acelite/ace/SOCK_IO.cpp b/deps/acelite/ace/SOCK_IO.cpp index 9048c8d3f..e2b68a645 100644 --- a/deps/acelite/ace/SOCK_IO.cpp +++ b/deps/acelite/ace/SOCK_IO.cpp @@ -4,6 +4,10 @@ #include "ace/OS_Memory.h" #include "ace/Truncate.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/SOCK_IO.inl" #endif /* __ACE_INLINE__ */ @@ -47,9 +51,16 @@ ACE_SOCK_IO::recvv (iovec *io_vec, return -1; else if (inlen > 0) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (io_vec->iov_base, + static_cast(ACE_Allocator::instance()->malloc(sizeof(char) * inlen)), + -1); +#else ACE_NEW_RETURN (io_vec->iov_base, char[inlen], -1); +#endif /* ACE_HAS_ALLOC_HOOKS */ + // It's ok to blindly cast this value since 'inlen' is an int and, thus, // we can't get more than that back. Besides, if the recv() fails, we // don't want that value cast to unsigned and returned. @@ -73,7 +84,7 @@ ACE_SOCK_IO::recvv (iovec *io_vec, // the ints (basically, an varargs version of writev). The count N is // the *total* number of trailing arguments, *not* a couple of the // number of tuple pairs! - +#ifndef ACE_LACKS_VA_FUNCTIONS ssize_t ACE_SOCK_IO::send (size_t n, ...) const { @@ -85,9 +96,16 @@ ACE_SOCK_IO::send (size_t n, ...) const #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -102,7 +120,11 @@ ACE_SOCK_IO::send (size_t n, ...) const iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; @@ -125,9 +147,16 @@ ACE_SOCK_IO::recv (size_t n, ...) const #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -142,10 +171,15 @@ ACE_SOCK_IO::recv (size_t n, ...) const iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; } +#endif // ACE_LACKS_VA_FUNCTIONS ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SOCK_IO.h b/deps/acelite/ace/SOCK_IO.h index 670375aa0..0ea281bb3 100644 --- a/deps/acelite/ace/SOCK_IO.h +++ b/deps/acelite/ace/SOCK_IO.h @@ -4,7 +4,7 @@ /** * @file SOCK_IO.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -47,8 +47,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_SOCK_IO : public ACE_SOCK { public: - // = Initialization and termination methods. - /// Constructor. ACE_SOCK_IO (void); @@ -82,9 +80,11 @@ public: ssize_t recvv (iovec *io_vec, const ACE_Time_Value *timeout = 0) const; +#ifndef ACE_LACKS_VA_FUNCTIONS /// Recv @a n varargs messages to the connected socket. ssize_t recv (size_t n, ...) const; +#endif /// Recv @a n bytes via Win32 @c ReadFile using overlapped I/O. ssize_t recv (void *buf, @@ -107,9 +107,11 @@ public: int n, const ACE_Time_Value *timeout = 0) const; +#ifndef ACE_LACKS_VA_FUNCTIONS /// Send @a n varargs messages to the connected socket. ssize_t send (size_t n, ...) const; +#endif /// Send @a n bytes via Win32 using overlapped I/O. ssize_t send (const void *buf, diff --git a/deps/acelite/ace/SOCK_Netlink.cpp b/deps/acelite/ace/SOCK_Netlink.cpp index e26745b8d..c1c1ce4d5 100644 --- a/deps/acelite/ace/SOCK_Netlink.cpp +++ b/deps/acelite/ace/SOCK_Netlink.cpp @@ -8,6 +8,9 @@ #include "ace/OS_NS_unistd.h" #include "ace/SOCK_Netlink.h" #include "ace/OS_NS_sys_socket.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SOCK_Netlink.inl" diff --git a/deps/acelite/ace/SOCK_Netlink.h b/deps/acelite/ace/SOCK_Netlink.h index 993a5d4f5..d9a8b965b 100644 --- a/deps/acelite/ace/SOCK_Netlink.h +++ b/deps/acelite/ace/SOCK_Netlink.h @@ -37,9 +37,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * This code was created so one could use ACE reactor * as a gateway to a linux kernel. */ -class ACE_Export ACE_SOCK_Netlink : public ACE_SOCK { +class ACE_Export ACE_SOCK_Netlink : public ACE_SOCK +{ public: - // = Initialization and termination methods. /// Default constructor. ACE_SOCK_Netlink(void); ~ACE_SOCK_Netlink(void); diff --git a/deps/acelite/ace/SOCK_SEQPACK_Acceptor.cpp b/deps/acelite/ace/SOCK_SEQPACK_Acceptor.cpp index a4f5062e2..fc1bc669b 100644 --- a/deps/acelite/ace/SOCK_SEQPACK_Acceptor.cpp +++ b/deps/acelite/ace/SOCK_SEQPACK_Acceptor.cpp @@ -333,8 +333,13 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa // representations of the primary and secondary // addresses. sockaddr_in* local_inet_addrs = 0; +#if defined(ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_NORETURN (local_inet_addrs, + static_cast(ACE_Allocator::instance()->malloc(sizeof(sockaddr_in) * num_addresses))); +#else ACE_NEW_NORETURN (local_inet_addrs, sockaddr_in[num_addresses]); +#endif if (!local_inet_addrs) error = 1; @@ -398,7 +403,11 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa #endif /* ACE_HAS_LKSCTP */ } +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(local_inet_addrs); +#else delete [] local_inet_addrs; +#endif /* ACE_HAS_ALLOC_HOOKS */ } } else if (ACE_OS::bind (this->get_handle (), diff --git a/deps/acelite/ace/SOCK_SEQPACK_Acceptor.h b/deps/acelite/ace/SOCK_SEQPACK_Acceptor.h index e5c7fc545..a4f6b3c84 100644 --- a/deps/acelite/ace/SOCK_SEQPACK_Acceptor.h +++ b/deps/acelite/ace/SOCK_SEQPACK_Acceptor.h @@ -7,7 +7,7 @@ * @author Patrick J. Lardieri * @author Gaurav Naik, Lockheed Martin ATL * @author based on SOCK_STREAM_Acceptor - * by Douglas C. Schmidt + * by Douglas C. Schmidt */ //============================================================================= @@ -43,7 +43,6 @@ class ACE_Time_Value; class ACE_Export ACE_SOCK_SEQPACK_Acceptor : public ACE_SOCK { public: - // = Initialization and termination methods. /// Default constructor. ACE_SOCK_SEQPACK_Acceptor (void); diff --git a/deps/acelite/ace/SOCK_SEQPACK_Association.cpp b/deps/acelite/ace/SOCK_SEQPACK_Association.cpp index b5b14363b..e1921645f 100644 --- a/deps/acelite/ace/SOCK_SEQPACK_Association.cpp +++ b/deps/acelite/ace/SOCK_SEQPACK_Association.cpp @@ -49,10 +49,8 @@ ACE_SOCK_SEQPACK_Association::abort (void) // setsockopt() SO_LINGER configures socket to reap immediately. // Normal close then aborts the association. // - linger slinger; - + linger slinger = { 0, 0 }; slinger.l_onoff = 1; - slinger.l_linger = 0; if (-1 == ACE_OS::setsockopt (this->get_handle (), SOL_SOCKET, @@ -162,7 +160,11 @@ ACE_SOCK_SEQPACK_Association::get_local_addrs (ACE_INET_Addr *addrs, size_t &siz // an ACE_Auto_Array_Ptr.) { sockaddr_in *addr_structs_bootstrap = 0; +#if defined(ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (addr_structs_bootstrap, static_cast(ACE_Allocator::instance()->malloc(sizeof(sockaddr_in) * size)), -1); +#else ACE_NEW_RETURN (addr_structs_bootstrap, sockaddr_in[size], -1); +#endif addr_structs.reset(addr_structs_bootstrap); } @@ -301,7 +303,11 @@ ACE_SOCK_SEQPACK_Association::get_remote_addrs (ACE_INET_Addr *addrs, size_t &si // an ACE_Auto_Array_Ptr.) { sockaddr_in *addr_structs_bootstrap = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (addr_structs_bootstrap, static_cast(ACE_Allocator::instance()->malloc(sizeof(sockaddr_in) * (size))), -1); +#else ACE_NEW_RETURN (addr_structs_bootstrap, sockaddr_in[size], -1); +#endif addr_structs.reset(addr_structs_bootstrap); } diff --git a/deps/acelite/ace/SOCK_SEQPACK_Association.h b/deps/acelite/ace/SOCK_SEQPACK_Association.h index 604feec91..c1eb5be44 100644 --- a/deps/acelite/ace/SOCK_SEQPACK_Association.h +++ b/deps/acelite/ace/SOCK_SEQPACK_Association.h @@ -8,7 +8,7 @@ * @author Patrick J. Lardieri * @author Gaurav Naik, Lockheed Martin ATL * @author based on SOCK_Stream - * by Douglas C. Schmidt + * by Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/SOCK_SEQPACK_Connector.cpp b/deps/acelite/ace/SOCK_SEQPACK_Connector.cpp index b941c2f6d..92787f9a5 100644 --- a/deps/acelite/ace/SOCK_SEQPACK_Connector.cpp +++ b/deps/acelite/ace/SOCK_SEQPACK_Connector.cpp @@ -133,7 +133,11 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_start (ACE_SOCK_SEQPACK_Association & // representations of the primary and secondary // addresses. sockaddr_in* local_inet_addrs = 0; +#if defined(ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_NORETURN (local_inet_addrs, static_cast(ACE_Allocator::instance()->malloc(sizeof(sockaddr_in) * (num_addresses)))); +#else ACE_NEW_NORETURN (local_inet_addrs, sockaddr_in[num_addresses]); +#endif if (!local_inet_addrs) return -1; @@ -215,7 +219,11 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_start (ACE_SOCK_SEQPACK_Association & } #endif /* ACE_HAS_LKSCTP */ +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(local_inet_addrs); +#else delete [] local_inet_addrs; +#endif /* ACE_HAS_ALLOC_HOOKS */ } // Enable non-blocking, if required. diff --git a/deps/acelite/ace/SOCK_SEQPACK_Connector.h b/deps/acelite/ace/SOCK_SEQPACK_Connector.h index f82550956..102940fdf 100644 --- a/deps/acelite/ace/SOCK_SEQPACK_Connector.h +++ b/deps/acelite/ace/SOCK_SEQPACK_Connector.h @@ -48,7 +48,6 @@ class ACE_Time_Value; class ACE_Export ACE_SOCK_SEQPACK_Connector { public: - // = Initialization and termination methods. /// Default constructor. ACE_SOCK_SEQPACK_Connector (void); @@ -264,7 +263,7 @@ public: * to the peer. * @param remote_sap If non-0, it points to the @c ACE_INET_Addr object * that will contain the address of the connected peer. - * @param timeout Same values and return value possibilites as for + * @param timeout Same values and return value possibilities as for * connect(). @see connect(). */ int complete (ACE_SOCK_SEQPACK_Association &new_association, diff --git a/deps/acelite/ace/SOCK_Stream.cpp b/deps/acelite/ace/SOCK_Stream.cpp index e8abb169b..c25a9b429 100644 --- a/deps/acelite/ace/SOCK_Stream.cpp +++ b/deps/acelite/ace/SOCK_Stream.cpp @@ -4,7 +4,9 @@ #include "ace/SOCK_Stream.inl" #endif /* __ACE_INLINE__ */ - +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SOCK_Stream.h b/deps/acelite/ace/SOCK_Stream.h index 2f011b0b6..ae0c6969c 100644 --- a/deps/acelite/ace/SOCK_Stream.h +++ b/deps/acelite/ace/SOCK_Stream.h @@ -4,7 +4,7 @@ /** * @file SOCK_Stream.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/SPIPE.cpp b/deps/acelite/ace/SPIPE.cpp index 35f4b478e..a57a8a0ae 100644 --- a/deps/acelite/ace/SPIPE.cpp +++ b/deps/acelite/ace/SPIPE.cpp @@ -2,6 +2,10 @@ #include "ace/OS_NS_unistd.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/SPIPE.inl" #endif /* __ACE_INLINE__ */ diff --git a/deps/acelite/ace/SPIPE_Acceptor.cpp b/deps/acelite/ace/SPIPE_Acceptor.cpp index 518ce1323..84420da62 100644 --- a/deps/acelite/ace/SPIPE_Acceptor.cpp +++ b/deps/acelite/ace/SPIPE_Acceptor.cpp @@ -2,6 +2,9 @@ #include "ace/Log_Category.h" #include "ace/OS_NS_sys_stat.h" #include "ace/OS_NS_sys_time.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if defined (ACE_HAS_STREAM_PIPES) # include "ace/OS_NS_unistd.h" diff --git a/deps/acelite/ace/SPIPE_Acceptor.h b/deps/acelite/ace/SPIPE_Acceptor.h index 60d14a30e..ced2fc835 100644 --- a/deps/acelite/ace/SPIPE_Acceptor.h +++ b/deps/acelite/ace/SPIPE_Acceptor.h @@ -4,7 +4,7 @@ /** * @file SPIPE_Acceptor.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt * @author Prashant Jain */ //============================================================================= @@ -45,7 +45,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_SPIPE_Acceptor : public ACE_SPIPE { public: - // = Initialization and termination methods. /// Default constructor. ACE_SPIPE_Acceptor (void); diff --git a/deps/acelite/ace/SPIPE_Addr.h b/deps/acelite/ace/SPIPE_Addr.h index d9e030433..e6d781e19 100644 --- a/deps/acelite/ace/SPIPE_Addr.h +++ b/deps/acelite/ace/SPIPE_Addr.h @@ -4,7 +4,7 @@ /** * @file SPIPE_Addr.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -33,7 +33,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_SPIPE_Addr : public ACE_Addr { public: - // = Initialization methods. /// Default constructor. ACE_SPIPE_Addr (void); diff --git a/deps/acelite/ace/SPIPE_Connector.cpp b/deps/acelite/ace/SPIPE_Connector.cpp index 718236563..3b29e4fcb 100644 --- a/deps/acelite/ace/SPIPE_Connector.cpp +++ b/deps/acelite/ace/SPIPE_Connector.cpp @@ -4,6 +4,9 @@ #include "ace/OS_NS_sys_time.h" #include "ace/OS_NS_fcntl.h" #include "ace/OS_NS_unistd.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SPIPE_Connector.inl" diff --git a/deps/acelite/ace/SPIPE_Connector.h b/deps/acelite/ace/SPIPE_Connector.h index 2e6ccc201..76f233fcc 100644 --- a/deps/acelite/ace/SPIPE_Connector.h +++ b/deps/acelite/ace/SPIPE_Connector.h @@ -4,7 +4,7 @@ /** * @file SPIPE_Connector.h * - * @author Doug Schmidt + * @author Doug Schmidt * @author Prashant Jain */ //============================================================================= @@ -32,7 +32,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_SPIPE_Connector { public: - // = Initialization method. /// Default constructor. ACE_SPIPE_Connector (void); diff --git a/deps/acelite/ace/SPIPE_Stream.cpp b/deps/acelite/ace/SPIPE_Stream.cpp index aec34efe2..c9374c19b 100644 --- a/deps/acelite/ace/SPIPE_Stream.cpp +++ b/deps/acelite/ace/SPIPE_Stream.cpp @@ -5,6 +5,9 @@ #include "ace/SPIPE_Stream.inl" #endif /* __ACE_INLINE__ */ +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -31,6 +34,7 @@ ACE_SPIPE_Stream::ACE_SPIPE_Stream (void) // the *total* number of trailing arguments, *not* a couple of the // number of tuple pairs! +#ifndef ACE_LACKS_VA_FUNCTIONS ssize_t ACE_SPIPE_Stream::send (size_t n, ...) const { @@ -41,9 +45,16 @@ ACE_SPIPE_Stream::send (size_t n, ...) const #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -56,7 +67,11 @@ ACE_SPIPE_Stream::send (size_t n, ...) const ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; @@ -78,9 +93,16 @@ ACE_SPIPE_Stream::recv (size_t n, ...) const #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_ALLOCATOR_RETURN (iovp, (iovec *) + ACE_Allocator::instance ()->malloc (total_tuples * + sizeof (iovec)), + -1); +# else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_start (argp, n); @@ -93,10 +115,15 @@ ACE_SPIPE_Stream::recv (size_t n, ...) const ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) +# ifdef ACE_HAS_ALLOC_HOOKS + ACE_Allocator::instance ()->free (iovp); +# else delete [] iovp; +# endif /* ACE_HAS_ALLOC_HOOKS */ #endif /* !defined (ACE_HAS_ALLOCA) */ va_end (argp); return result; } +#endif // ACE_LACKS_VA_FUNCTIONS ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SPIPE_Stream.h b/deps/acelite/ace/SPIPE_Stream.h index 71ffd4cc5..5eaf33ce9 100644 --- a/deps/acelite/ace/SPIPE_Stream.h +++ b/deps/acelite/ace/SPIPE_Stream.h @@ -4,7 +4,7 @@ /** * @file SPIPE_Stream.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -54,7 +54,6 @@ public: friend class ACE_SPIPE_Acceptor; friend class ACE_SPIPE_Connector; - // = Initialization method. /// Default constructor. ACE_SPIPE_Stream (void); @@ -110,6 +109,7 @@ public: /// Recv iovecs via the OS "scatter-read" operation. ssize_t recv (iovec iov[], int len) const; +#ifndef ACE_LACKS_VA_FUNCTIONS /** * Send N char *ptrs and int lengths. Note that the char *'s * precede the ints (basically, an varargs version of writev). The @@ -126,6 +126,7 @@ public: * number of tuple pairs! */ ssize_t recv (size_t len, ...) const; +#endif /// Send @a len bytes via Win32 using overlapped I/O. ssize_t send (const void *buf, size_t len, ACE_OVERLAPPED *overlapped) const; diff --git a/deps/acelite/ace/SSL/ACE_SSL.pc.in b/deps/acelite/ace/SSL/ACE_SSL.pc.in deleted file mode 100644 index 51c04a18f..000000000 --- a/deps/acelite/ace/SSL/ACE_SSL.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_SSL -Description: ACE SSL Library -Requires: ACE -Version: @VERSION@ -Libs: -L${libdir} @ACE_TLS_LDFLAGS@ -lACE_SSL @ACE_TLS_LIBS@ -Cflags: -I${includedir} @ACE_TLS_CPPFLAGS@ diff --git a/deps/acelite/ace/SSL/SSL_Asynch_BIO.cpp b/deps/acelite/ace/SSL/SSL_Asynch_BIO.cpp deleted file mode 100644 index bd58fe2a6..000000000 --- a/deps/acelite/ace/SSL/SSL_Asynch_BIO.cpp +++ /dev/null @@ -1,248 +0,0 @@ -// -*- C++ -*- -#include "SSL_Asynch_BIO.h" - -#if OPENSSL_VERSION_NUMBER > 0x0090581fL && ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) - -#include "SSL_Asynch_Stream.h" -#include "ace/OS_NS_string.h" -#include "ace/Truncate.h" - -#if (defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1) -# define ACE_ASYNCH_BIO_WRITE_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ACE_Asynch_BIO_write) -# define ACE_ASYNCH_BIO_READ_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ACE_Asynch_BIO_read) -# define ACE_ASYNCH_BIO_PUTS_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ACE_Asynch_BIO_puts) -# define ACE_ASYNCH_BIO_CTRL_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ACE_Asynch_BIO_ctrl) -# define ACE_ASYNCH_BIO_NEW_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ACE_Asynch_BIO_new) -# define ACE_ASYNCH_BIO_FREE_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ACE_Asynch_BIO_free) -#else -# define ACE_ASYNCH_BIO_WRITE_NAME ACE_Asynch_BIO_write -# define ACE_ASYNCH_BIO_READ_NAME ACE_Asynch_BIO_read -# define ACE_ASYNCH_BIO_PUTS_NAME ACE_Asynch_BIO_puts -# define ACE_ASYNCH_BIO_CTRL_NAME ACE_Asynch_BIO_ctrl -# define ACE_ASYNCH_BIO_NEW_NAME ACE_Asynch_BIO_new -# define ACE_ASYNCH_BIO_FREE_NAME ACE_Asynch_BIO_free -#endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */ - -/** - * @name OpenSSL BIO Helper Methods for use with ACE's Asynchronous - * SSL I/O support. - */ -//@{ -extern "C" -{ - int ACE_ASYNCH_BIO_WRITE_NAME (BIO *pBIO, const char *buf, int len); - int ACE_ASYNCH_BIO_READ_NAME (BIO *pBIO, char *buf, int len); - int ACE_ASYNCH_BIO_PUTS_NAME (BIO *pBIO, const char *str); - long ACE_ASYNCH_BIO_CTRL_NAME (BIO *pBIO, int cmd, long arg1, void *arg2); - int ACE_ASYNCH_BIO_NEW_NAME (BIO *pBIO); - int ACE_ASYNCH_BIO_FREE_NAME (BIO *pBIO); -} -//@} - -#define BIO_TYPE_ACE ( 21 | BIO_TYPE_SOURCE_SINK ) - -static BIO_METHOD methods_ACE = - { - BIO_TYPE_ACE, // BIO_TYPE_PROXY_SERVER, - "ACE_Asynch_BIO", - ACE_ASYNCH_BIO_WRITE_NAME, - ACE_ASYNCH_BIO_READ_NAME, - ACE_ASYNCH_BIO_PUTS_NAME, - 0, /* ACE_ASYNCH_BIO_GETS_NAME, */ - ACE_ASYNCH_BIO_CTRL_NAME, - ACE_ASYNCH_BIO_NEW_NAME, - ACE_ASYNCH_BIO_FREE_NAME, - 0 - }; - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -BIO * -ACE_SSL_make_BIO (void * ssl_asynch_stream) -{ - BIO * const pBIO = BIO_new (&methods_ACE); - - if (pBIO) - BIO_ctrl (pBIO, - BIO_C_SET_FILE_PTR, - 0, - ssl_asynch_stream); - - return pBIO; -} - -/** - * @struct @c ACE_SSL_Asynch_Stream_Accessor - * - * @brief Privileged @c ACE_SSL_Asynch_Stream accessor. - * - * This structure is a @c friend to the @c ACE_SSL_Asynch_Stream - * class so that it can gain access to the protected - * ssl_bio_{read,write}() methods in that class. It is full declared - * in this implementation file to hide its interface from users to - * prevent potential abuse of the friend relationship between it and - * the @c ACE_SSL_Asynch_Stream class. - */ -struct ACE_SSL_Asynch_Stream_Accessor -{ - static int read (ACE_SSL_Asynch_Stream * stream, - char * buf, - size_t len, - int & errval) - { - return stream->ssl_bio_read (buf, len, errval); - } - - static int write (ACE_SSL_Asynch_Stream * stream, - const char * buf, - size_t len, - int & errval) - { - return stream->ssl_bio_write (buf, len, errval); - } -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -int -ACE_ASYNCH_BIO_NEW_NAME (BIO * pBIO) -{ - pBIO->init = 0; // not initialized - pBIO->num = 0; // still zero ( we can use it ) - pBIO->ptr = 0; // will be pointer to ACE_SSL_Asynch_Stream - pBIO->flags = 0; // - - return 1; -} - -int -ACE_ASYNCH_BIO_FREE_NAME (BIO * pBIO) -{ - if (pBIO && pBIO->shutdown) - { - pBIO->ptr = 0; - pBIO->init = 0; - pBIO->num = 0; - pBIO->flags = 0; - - return 1; - } - - return 0; -} - -int -ACE_ASYNCH_BIO_READ_NAME (BIO * pBIO, char * buf, int len) -{ - BIO_clear_retry_flags (pBIO); - - ACE_SSL_Asynch_Stream * const p_stream = - static_cast (pBIO->ptr); - - if (pBIO->init == 0 || p_stream == 0 || buf == 0 || len <= 0) - return -1; - - BIO_clear_retry_flags (pBIO); - - int errval = 0; - - int retval = - ACE_SSL_Asynch_Stream_Accessor::read (p_stream, - buf, - len, - errval); - - if (retval >= 0) - return retval; - - if (errval == EINPROGRESS) - BIO_set_retry_read (pBIO); - - return -1; -} - -int -ACE_ASYNCH_BIO_WRITE_NAME (BIO * pBIO, const char * buf, int len) -{ - BIO_clear_retry_flags (pBIO); - - ACE_SSL_Asynch_Stream * p_stream = - static_cast (pBIO->ptr); - - if (pBIO->init == 0 || p_stream == 0 || buf == 0 || len <= 0) - return -1; - - BIO_clear_retry_flags (pBIO); - - int errval = 0; - - int retval = - ACE_SSL_Asynch_Stream_Accessor::write (p_stream, - buf, - len, - errval); - - if (retval >= 0) - return retval; - - if (errval == EINPROGRESS) - BIO_set_retry_write (pBIO); - - return -1; -} - -long -ACE_ASYNCH_BIO_CTRL_NAME (BIO * pBIO, int cmd, long num, void *ptr) -{ - long ret = 1; - - switch (cmd) - { - case BIO_C_SET_FILE_PTR: - pBIO->shutdown = static_cast (num); - pBIO->ptr = ptr; - pBIO->init = 1; - break; - - case BIO_CTRL_INFO: - ret = 0; - break; - - case BIO_CTRL_GET_CLOSE: - ret = pBIO->shutdown; - break; - - case BIO_CTRL_SET_CLOSE: - pBIO->shutdown = static_cast (num); - break; - - case BIO_CTRL_PENDING: - case BIO_CTRL_WPENDING: - ret = 0; - break; - - case BIO_CTRL_DUP: - case BIO_CTRL_FLUSH: - ret = 1; - break; - - default: - ret = 0; - break; - } - - return ret; -} - -int -ACE_ASYNCH_BIO_PUTS_NAME (BIO *pBIO, const char *str) -{ - size_t const n = ACE_OS::strlen (str); - - return ACE_ASYNCH_BIO_WRITE_NAME (pBIO, - str, - ACE_Utils::truncate_cast (n)); -} - -#endif /* OPENSSL_VERSION_NUMBER > 0x0090581fL && (ACE_WIN32 || - ACE_HAS_AIO_CALLS) */ diff --git a/deps/acelite/ace/SSL/SSL_Asynch_BIO.h b/deps/acelite/ace/SSL/SSL_Asynch_BIO.h deleted file mode 100644 index 70b1a0fcc..000000000 --- a/deps/acelite/ace/SSL/SSL_Asynch_BIO.h +++ /dev/null @@ -1,39 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file SSL_Asynch_BIO.h - * - * @author Alexander Libman - * @author Ossama Othman - */ -//============================================================================= - -#ifndef ACE_SSL_ASYNCH_BIO_H -#define ACE_SSL_ASYNCH_BIO_H - -#include /**/ "ace/pre.h" - -#include "SSL_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// This must be included before any include on LynxOS -#include "ace/os_include/os_stdio.h" - -#include - -#if OPENSSL_VERSION_NUMBER > 0x0090581fL && ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -extern BIO * ACE_SSL_make_BIO (void * ssl_asynch_stream); -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* OPENSSL_VERSION_NUMBER > 0x0090581fL (ACE_WIN32 || - ACE_HAS_AIO_CALLS) */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SSL_ASYNCH_BIO_H */ diff --git a/deps/acelite/ace/SSL/SSL_Asynch_Stream.cpp b/deps/acelite/ace/SSL/SSL_Asynch_Stream.cpp deleted file mode 100644 index a63a353ac..000000000 --- a/deps/acelite/ace/SSL/SSL_Asynch_Stream.cpp +++ /dev/null @@ -1,1081 +0,0 @@ -#include "SSL_Asynch_Stream.h" - -// This only works on platforms with Asynchronous IO support. -#if OPENSSL_VERSION_NUMBER > 0x0090581fL && ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) - -#if defined (ACE_WIN32) -# include "ace/WIN32_Proactor.h" -#else -# include "ace/POSIX_Proactor.h" -#endif /* ACE_WIN32 */ - -#include "ace/OS_NS_string.h" -#include "ace/Proactor.h" -#include "ace/Truncate.h" - -#if !defined(__ACE_INLINE__) -#include "SSL_Asynch_Stream.inl" -#endif /* __ACE_INLINE__ */ - -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_SSL_Asynch_Write_Stream_Result::ACE_SSL_Asynch_Write_Stream_Result - (ACE_Handler & handler, - ACE_HANDLE handle, - ACE_Message_Block & message_block, - size_t bytes_to_write, - const void * act, - ACE_HANDLE event, - int priority, - int signal_number - ) - : AWS_RESULT (handler.proxy (), - handle, - message_block, - bytes_to_write, - act, - event, - priority, - signal_number - ) -{ -} - -ACE_SSL_Asynch_Read_Stream_Result::ACE_SSL_Asynch_Read_Stream_Result - (ACE_Handler & handler, - ACE_HANDLE handle, - ACE_Message_Block & message_block, - size_t bytes_to_read, - const void * act, - ACE_HANDLE event, - int priority, - int signal_number - ) - : ARS_RESULT (handler.proxy (), - handle, - message_block, - bytes_to_read, - act, - event, - priority, - signal_number - ) -{ -} - -ACE_SSL_Asynch_Result::ACE_SSL_Asynch_Result (ACE_Handler & handler) - : A_RESULT (handler.proxy (), - 0, // act, - ACE_INVALID_HANDLE, - 0, // Offset - 0, // OffsetHigh - 0, // Priority - ACE_SIGRTMIN //signal_number - ) -{ -} - -void -ACE_SSL_Asynch_Result::complete (size_t /* bytes_transferred */, - int /* success */, - const void * /* completion_key */, - u_long /* error */) -{ - this->handler_proxy_->handler ()->handle_wakeup (); -} - -// ************************************************************ -// ACE_SSL_Asynch_Stream Constructor / Destructor -// ************************************************************ -ACE_SSL_Asynch_Stream::ACE_SSL_Asynch_Stream ( - ACE_SSL_Asynch_Stream::Stream_Type s_type, - ACE_SSL_Context * context) - : type_ (s_type), - proactor_ (0), - ext_handler_ (0), - ext_read_result_ (0), - ext_write_result_(0), - flags_ (0), - ssl_ (0), - handshake_complete_(false), - bio_ (0), - bio_istream_ (), - bio_inp_msg_ (), - bio_inp_errno_(0), - bio_inp_flag_ (0), - bio_ostream_ (), - bio_out_msg_ (), - bio_out_errno_(0), - bio_out_flag_ (0), - mutex_ () -{ - ACE_TRACE ("ACE_SSL_Asynch_Stream::ACE_SSL_Asynch_Stream"); - // was honestly copied from ACE_SSL_SOCK_Stream :) - - ACE_SSL_Context * ctx = - (context == 0 ? ACE_SSL_Context::instance () : context); - - this->ssl_ = ::SSL_new (ctx->context ()); - - if (this->ssl_ == 0) - ACELIB_ERROR - ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE_SSL_Asynch_Stream %p\n"), - ACE_TEXT ("- cannot allocate new SSL structure") - )); - -} - -ACE_SSL_Asynch_Stream::~ACE_SSL_Asynch_Stream (void) -{ - ACE_TRACE ("ACE_SSL_Asynch_Stream::~ACE_SSL_Asynch_Stream"); - - - // It is safe to delete stream if all notifications are received, - // i.e., state is SF_DELETE_ENABLE or if proactor event loop is - // done. - if (this->flags_ & SF_STREAM_OPEN) // open - if ((this->flags_ & SF_DELETE_ENABLE) == 0) // but .. - ACELIB_DEBUG ((LM_DEBUG, - ACE_TEXT("ACE_SSL_Asynch_Stream::DTOR-") - ACE_TEXT("possible access violation ") - ACE_TEXT("if proactor still handles events\n"))); - - ::SSL_free (this->ssl_); - - // Was honestly copied from ACE_SSL_SOCK_Stream :) - - // @@ Question: should we reference count the Context object or - // leave that to the application developer? We do not reference - // count reactors (for example) and following some simple rules - // seems to work fine! -} - -// ************************************************************ -// close () -// returns : -// 0 - Stream is in the state SF_DELETE_ENABLE, -// so it is safe to delete stream -// -1 - Stream has pending AIO requests, -// close should be repeated later one more -// ************************************************************ - -int -ACE_SSL_Asynch_Stream::close (void) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1)); - - if ((flags_ & SF_STREAM_OPEN) == 0) // not open - flags_ |= SF_DELETE_ENABLE; - - if (flags_ & SF_DELETE_ENABLE) - return 0; - - flags_ |= SF_REQ_SHUTDOWN; - - this->do_SSL_state_machine (); - - return -1; -} - -// ************************************************************ -// Asynch_Operation interface -// cancel -// ************************************************************ -int -ACE_SSL_Asynch_Stream::cancel (void) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1)); - - if ((flags_ & SF_STREAM_OPEN) == 0) // not open - { - return 1; // AIO_ALLDONE - } - - // attempt to cancel internal, i.e. user's read/write - int rc_r_int = bio_istream_.cancel(); - int rc_w_int = bio_ostream_.cancel(); - - // attempt to cancel external, i.e. bio_ssl read/write - int rc_r_ext = notify_read (0, ERR_CANCELED); - int rc_w_ext = notify_write (0, ERR_CANCELED); - - if ((rc_r_int < 0 || rc_w_int < 0) - && (rc_r_ext < 0 || rc_w_ext < 0)) - { - return -1; // at least one error - } - - if (rc_r_int == 1 && rc_w_int == 1 - && rc_r_ext == 1 && rc_w_ext == 1) - { - return 1; // AIO_ALLDONE - } - - if ((rc_r_int == 2 || rc_w_int == 2) - && (rc_r_ext == 2 || rc_w_ext == 2)) - { - return 2; // AIO_NOT_CANCELED , at least one not canceled - } - - return 0; // AIO_CANCELED, at least will be one notification -} - -// ************************************************************ -// Asynch_Operation interface -// open -// ************************************************************ -int -ACE_SSL_Asynch_Stream::open (ACE_Handler & handler, - ACE_HANDLE handle, - const void * completion_key, - ACE_Proactor * proactor) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1)); - - if (this->flags_ & SF_STREAM_OPEN) - ACELIB_ERROR_RETURN - ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE_SSL_Asynch_Stream::open() %p\n"), - ACE_TEXT ("- already opened")), - -1); - - if (this->ssl_ == 0) - ACELIB_ERROR_RETURN - ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE_SSL_Asynch_Stream::open() %p\n"), - ACE_TEXT ("- SSL structure is absent")), - -1); - - if (handle == ACE_INVALID_HANDLE) - ACELIB_ERROR_RETURN - ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE_SSL_Asynch_Stream::open() %p\n"), - ACE_TEXT ("- invalid handle")), - -1); - - - // Get a proactor for/from the user. - this->proactor_ = this->get_proactor (proactor, handler); - this->ext_handler_ = & handler; - this->handle (handle); - - // Open internal input stream - if (this->bio_istream_.open (*this, // real callbacks to this - handle, - completion_key, - this->proactor_) != 0) - return -1; - - // Open internal output stream - if (this->bio_ostream_.open (*this, // real callbacks to this - handle, - completion_key, - this->proactor_) != 0) - return -1; - - this->bio_ = ACE_SSL_make_BIO (this); - - if (this->bio_ == 0) - ACELIB_ERROR_RETURN - ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE_SSL_Asynch_Stream::open() %p\n"), - ACE_TEXT ("- cannot allocate new BIO structure")), - -1); - - ::SSL_set_bio (this->ssl_ , this->bio_ , this->bio_); - - switch (this->type_) - { - case ST_CLIENT: - ::SSL_set_connect_state (this->ssl_); - break; - - case ST_SERVER: - ::SSL_set_accept_state (this->ssl_); - break; - - default: - ACELIB_ERROR_RETURN - ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE_SSL_Asynch_Stream::open() %p\n"), - ACE_TEXT ("- invalid stream type")), - -1); - } - - this->flags_ |= SF_STREAM_OPEN; - - this->do_SSL_state_machine (); - - return 0; -} - - -// ************************************************************ -// Asynch_Operation interface -// read -// ************************************************************ -int -ACE_SSL_Asynch_Stream::read (ACE_Message_Block & message_block, - size_t bytes_to_read, - const void * act, - int priority, - int signal_number) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1)); - - if ((this->flags_ & SF_STREAM_OPEN) == 0) // not open - return -1; - - if (this->flags_ & SF_REQ_SHUTDOWN) - return -1; - - // only one read operation is allowed now - // later it will be possible to make a queue - - if (this->ext_read_result_ != 0) - return -1; - - // create result for future notification - ACE_NEW_RETURN (this->ext_read_result_, - ACE_SSL_Asynch_Read_Stream_Result ( - *this->ext_handler_, - this->handle (), - message_block, - bytes_to_read, - act, - this->proactor_->get_handle(), - priority, - signal_number), - -1); - - this->do_SSL_state_machine (); // ignore return code - - return 0; -} - -// ************************************************************ -// Asynch_Operation interface -// write -// ************************************************************ -int -ACE_SSL_Asynch_Stream::write (ACE_Message_Block & message_block, - size_t bytes_to_write, - const void * act, - int priority, - int signal_number) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1)); - - if ((this->flags_ & SF_STREAM_OPEN) == 0) // not open - return -1; - - if (this->flags_ & SF_REQ_SHUTDOWN) - return -1; - - // only one read operation is allowed now - // later it will be possible to make a queue - - if (this->ext_write_result_ != 0) - return -1; - - // create result for future notification - ACE_NEW_RETURN (this->ext_write_result_, - ACE_SSL_Asynch_Write_Stream_Result ( - *this->ext_handler_, - this->handle (), - message_block, - bytes_to_write, - act, - this->proactor_->get_handle(), - priority, - signal_number), - -1); - - this->do_SSL_state_machine (); - - return 0; -} - -// ************************************************************ -// Main SSL engine -// ************************************************************ -int -ACE_SSL_Asynch_Stream::do_SSL_state_machine (void) -{ - // this protected member should be called - // with locked mutex_ - - int retval = this->do_SSL_handshake (); - - if (retval == 0) // handshake in progress ? - return 0; - - if (retval < 0) - this->flags_ |= SF_REQ_SHUTDOWN; - - this->do_SSL_read (); // execute user read request - this->do_SSL_write (); // execute user write request - - if ((this->flags_ & SF_REQ_SHUTDOWN) == 0) // Do we have any errors - return 0; - - this->do_SSL_shutdown (); - - this->notify_close (); - - return 0; -} - -// ************************************************************ -// do_SSL_shutdown -// return code: -// 1 SSL shutdown is finished already, success -// 0 SSL shutdown in progress -// -1 failure -// ************************************************************ -int -ACE_SSL_Asynch_Stream::do_SSL_shutdown (void) -{ - if (this->flags_ & SF_SHUTDOWN_DONE) // already done - return 1; - - this->flags_ |= SF_REQ_SHUTDOWN; - - // if we have any uncompleted user requests - // than cancel its - this->notify_read (0, ERR_CANCELED); - this->notify_write (0, ERR_CANCELED); - - int retval = ::SSL_shutdown (this->ssl_); - - int status = ::SSL_get_error (this->ssl_, retval); - - switch (status) - { - case SSL_ERROR_NONE: - case SSL_ERROR_ZERO_RETURN: - case SSL_ERROR_SYSCALL: - retval = 1; - break; - - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_WANT_CONNECT: - // case SSL_ERROR_WANT_ACCEPT: - case SSL_ERROR_WANT_X509_LOOKUP: - return 0; - - default: - this->print_error (status, - ACE_TEXT ("Shutdown error")); - retval = -1; - break; - } - - this->flags_ |= SF_SHUTDOWN_DONE; - - return retval; -} - -// ************************************************************ -// Do SSL handshake if necessary -// return code: -// 1 SSL handshake is finished already, success -// 0 SSL handshake in progress -// -1 failure -// ************************************************************ -int -ACE_SSL_Asynch_Stream::do_SSL_handshake (void) -{ - if (SSL_is_init_finished (this->ssl_)) - { - if (!handshake_complete_) - { - handshake_complete_ = true; - - if (!post_handshake_check ()) - { - return -1; - } - } - return 1; - } - - if (this->flags_ & SF_REQ_SHUTDOWN) - return -1; - - int retval = -1; - - switch (this->type_) - { - case ST_CLIENT: - retval = ::SSL_connect (this->ssl_); - break; - - case ST_SERVER: - retval = ::SSL_accept (this->ssl_); - break; - - default: - ACELIB_ERROR_RETURN - ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE_SSL_Asynch_Stream %p\n"), - ACE_TEXT ("- invalid stream type")), - -1); - } - - int status = ::SSL_get_error (this->ssl_, retval); - - switch (status) - { - case SSL_ERROR_NONE: - break; - - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_WANT_CONNECT: - //case SSL_ERROR_WANT_ACCEPT: - case SSL_ERROR_WANT_X509_LOOKUP: - return 0; - - case SSL_ERROR_ZERO_RETURN: - case SSL_ERROR_SYSCALL: - default: - this->print_error (status, - ACE_TEXT ("Handshake error")); - return -1; - } - - return 1; -} - - -bool -ACE_SSL_Asynch_Stream::post_handshake_check (void) -{ - return true; -} - -// ************************************************************ -// Perform SSL_read call if necessary and notify user -// ************************************************************ -int -ACE_SSL_Asynch_Stream::do_SSL_read (void) -{ - if (this->ext_read_result_ == 0) // nothing to do - { - return 0; - } - - if (this->flags_ & SF_REQ_SHUTDOWN) - { - this->notify_read (0, ERR_CANCELED); - return -1; - } - - ACE_Message_Block & mb = this->ext_read_result_->message_block (); - size_t bytes_req = this->ext_read_result_->bytes_to_read (); - - ERR_clear_error (); - - const int bytes_trn = - ::SSL_read (this->ssl_, - mb.wr_ptr (), - ACE_Utils::truncate_cast (bytes_req)); - - int const status = ::SSL_get_error (this->ssl_, bytes_trn); - - switch (status) - { - case SSL_ERROR_NONE: - this->notify_read (bytes_trn, 0); - return 1; - - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - return 0; - - case SSL_ERROR_ZERO_RETURN: - this->notify_read (0, 0); - return 1; - - case SSL_ERROR_SYSCALL: - if (bytes_trn == 0) - { - this->notify_read (0, 0); - return 1; - } - // If not an EOF, then fall through to "default" case. - - default: - break; - } - - this->notify_read (0, EFAULT); - this->print_error (status, - ACE_TEXT ("SSL_read error")); - - return -1; -} - -// ************************************************************ -// Perform SSL_write call if necessary and notify user -// ************************************************************ -int -ACE_SSL_Asynch_Stream::do_SSL_write (void) -{ - if (this->ext_write_result_ == 0) // nothing to do - { - return 0; - } - - if (this->flags_ & SF_REQ_SHUTDOWN) - { - this->notify_write (0, ERR_CANCELED); - return -1; - } - - ACE_Message_Block & mb = this->ext_write_result_->message_block (); - size_t bytes_req = this->ext_write_result_->bytes_to_write (); - - ERR_clear_error (); - - const int bytes_trn = - ::SSL_write (this->ssl_, - mb.rd_ptr (), - ACE_Utils::truncate_cast (bytes_req)); - - int const status = ::SSL_get_error (this->ssl_, bytes_trn); - - switch (status) - { - case SSL_ERROR_NONE: - this->notify_write (bytes_trn, 0); - return 1; - - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - return 0; - - case SSL_ERROR_ZERO_RETURN: - this->notify_write (bytes_trn, 0); - return 1; - - case SSL_ERROR_SYSCALL: - default: - break; - } - - this->notify_write(0, EFAULT); - this->print_error (status, - ACE_TEXT ("SSL_write error")); - - return -1; -} - -// ************************************************************ -// notify external user handler that -// it is now to safe destroy stream -// Return code looks like cancel() return code -// 0 - notified NOTIFIED -// 1 - nothing to notify ALLDONE -// 2 - unable to notify NOT NOTIFIED -// ************************************************************ -int -ACE_SSL_Asynch_Stream::notify_close (void) -{ - if (this->flags_ & SF_CLOSE_NTF_SENT) // already sent - return 1; - - if ((this->flags_ & SF_SHUTDOWN_DONE) == 0) // only after shutdown - return 2; // too early , we will do later - - if (this->pending_BIO_count () != 0) // wait for all internal IO - return 2; // too early , we will do later - - // create result for future notification - ACE_SSL_Asynch_Result * close_result = 0; - - ACE_NEW_RETURN (close_result, - ACE_SSL_Asynch_Result (*this), - 2); - //@@ Not exception safe! - - int retval = - close_result->post_completion (this->proactor_->implementation ()); - - if (retval == 0) - { - this->flags_ |= SF_CLOSE_NTF_SENT; - return 0; - } - - delete close_result; - return 2; -} - -// ************************************************************ -// notify external user handler about user write completion -// Return code looks like cancel() return code -// 0 - notified NOTIFIED/CANCELED -// 1 - nothing to notify ALLDONE -// 2 - unable to notify NOT NOTIFIED/CANCELED -// ************************************************************ - -int -ACE_SSL_Asynch_Stream::notify_read (int bytes_transferred, - int error) -{ - if (ext_read_result_ == 0) //nothing to notify - return 1; - - this->ext_read_result_->set_bytes_transferred (bytes_transferred); - this->ext_read_result_->set_error (error); - - int retval = - this->ext_read_result_->post_completion (proactor_->implementation ()); - - if (retval == 0) - { - this->ext_read_result_ = 0; - return 0; // success - } - - return 2; // unable to notify -} - -// ************************************************************ -// notify external user handler about user write completion -// Return code looks like cancel() return code -// 0 - notified NOTIFIED/CANCELED -// 1 - nothing to notify ALLDONE -// 2 - unable to notify NOT NOTIFIED/CANCELED -// ************************************************************ - -int -ACE_SSL_Asynch_Stream::notify_write (int bytes_transferred, - int error) -{ - if (this->ext_write_result_ == 0) //nothing to notify - return 1; - - this->ext_write_result_->set_bytes_transferred (bytes_transferred); - this->ext_write_result_->set_error (error); - - int retval = - this->ext_write_result_->post_completion ( - this->proactor_->implementation ()); - - if (retval == 0) - { - this->ext_write_result_ = 0; - return 0; // success - } - - return 2; // unable to notify -} - -// ************************************************************ -// Print SSL errors -// ************************************************************ -void -ACE_SSL_Asynch_Stream::print_error (int err_ssl, - const ACE_TCHAR * pText) -{ - ACELIB_DEBUG ((LM_DEBUG, - ACE_TEXT("SSL-error:%d %s\n"), - err_ssl, - pText)); - -#if OPENSSL_VERSION_NUMBER >= 0x0090601fL - // OpenSSL < 0.9.6a doesn't have ERR_error_string_n() function. - unsigned long lerr = 0; - char buf[1024]; - - while ((lerr = ERR_get_error()) != 0) - { - ERR_error_string_n (lerr, buf, sizeof buf); - - ACELIB_DEBUG ((LM_DEBUG, "%C\n", buf)); - } -#endif /* OPENSSL_VERSION_NUMBER */ -} - -// ************************************************************ -// BIO helper functions -// SSL library will ask BIO to do raw I/O -// BIO will call us to do this -// ************************************************************ -int -ACE_SSL_Asynch_Stream::ssl_bio_read (char * buf, - size_t len, - int & errval) -{ - // We do not have to acquire mutex - // as we called already with locked mutex - // from do_SSL_state_machine() - - errval = 0; - - size_t cur_len = this->bio_inp_msg_.length (); - - if (cur_len > 0) // there are more data buffered - { - const char * rd_ptr = this->bio_inp_msg_.rd_ptr (); - - if (cur_len > len) - { - cur_len = len; - } - - ACE_OS::memcpy (buf, rd_ptr, cur_len); - - this->bio_inp_msg_.rd_ptr (cur_len); // go ahead - - return ACE_Utils::truncate_cast (cur_len); - } - - if (this->bio_inp_errno_ != 0) // if was error - it is permanent ! - { - errval = this->bio_inp_errno_; - return -1; - } - - if (this->bio_inp_flag_ & BF_EOS) // End of stream - { - return 0; - } - - errval = EINPROGRESS; // SSL will try later - - if (this->bio_inp_flag_ & BF_AIO) // we are busy - { - return -1; - } - - if (this->bio_inp_msg_.size (len) != 0) - { - ACELIB_ERROR - ((LM_ERROR, - ACE_TEXT ("%N:%l ((%P|%t) ACE_SSL_Asynch_Stream %p\n"), - ACE_TEXT ("error in ACE_Message_Block::size() ") - )); - - errval = EINVAL; - return -1; - } - - char * base = this->bio_inp_msg_.base (); - - this->bio_inp_msg_.rd_ptr (base); - this->bio_inp_msg_.wr_ptr (base); - - if (this->bio_istream_.read ( - bio_inp_msg_, // message block - len, // priority - 0, // act - 0, // priority - ACE_SIGRTMIN // default signal - ) == -1) - { - ACELIB_ERROR - ((LM_ERROR, - ACE_TEXT ("%N:%l (%P|%t) ACE_SSL_Asynch_Stream %p\n"), - ACE_TEXT ("attempt read failed") - )); - - errval = EINVAL; // may be leave EINPROGRESS ?? - return -1; // to try later - } - - this->bio_inp_flag_ |= BF_AIO; // AIO is active - - return -1; -} - - -int -ACE_SSL_Asynch_Stream::ssl_bio_write (const char * buf, - size_t len, - int & errval) -{ - // We do not have to acquire mutex - // as we called already with locked mutex - // from do_SSL_state_machine - - errval = 0; - - if (this->bio_out_flag_ & BF_AIO) // sorry, we are busy - { - errval = EINPROGRESS; // try later - return -1; - } - - if (this->bio_out_errno_ != 0) // no recovery - { - errval = this->bio_out_errno_; - return -1; - } - - if (this->bio_out_msg_.size (len) != 0) - { - ACELIB_ERROR - ((LM_ERROR, - ACE_TEXT ("%N:%l ((%P|%t) ACE_SSL_Asynch_Stream %p\n"), - ACE_TEXT ("error in ACE_Message_Block::size() ") - )); - - errval = EINVAL; - return -1; - } - - char * base = this->bio_out_msg_.base (); - - this->bio_out_msg_.rd_ptr (base); - this->bio_out_msg_.wr_ptr (base); - - if (this->bio_out_msg_.copy (buf, len) == -1) - { - ACELIB_ERROR - ((LM_ERROR, - ACE_TEXT ("%N:%l ((%P|%t) ACE_SSL_Asynch_Stream %p\n"), - ACE_TEXT ("error in ACE_Message_Block::copy() ") - )); - - errval = EINVAL; - return -1; - } - - - if (this->bio_ostream_.write ( - this->bio_out_msg_, // message block - len, // priority - 0, // act - 0, // priority - ACE_SIGRTMIN // default signal - ) == -1) - { - ACELIB_ERROR - ((LM_ERROR, - ACE_TEXT ("%N:%l ((%P|%t) ACE_SSL_Asynch_Stream %p\n"), - ACE_TEXT ("attempt write failed") - )); - - errval = EINVAL; // may be leave EINPROGRESS ?? - return -1; // to try later - } - - this->bio_out_flag_ |= BF_AIO; // AIO is active - errval = 0; // Ok, go ahead - - return ACE_Utils::truncate_cast (len); -} - -// ************************************************************ -// Internal IO handlers -// virtual from ACE_Service_Handler -// ************************************************************ -void -ACE_SSL_Asynch_Stream::handle_write_stream ( - const ACE_Asynch_Write_Stream::Result &result) -{ - ACE_MT (ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_)); - - this->bio_out_flag_ &= ~BF_AIO; - - ACE_Message_Block & mb = result.message_block (); - - size_t bytes_req = result.bytes_to_write (); - size_t bytes_trn = result.bytes_transferred (); - u_long errval = result.error (); - size_t len = bytes_req - bytes_trn; - - if (errval != 0) // error ? - this->bio_out_errno_ = errval; // save err code - else if (len > 0) // TCP/IP overloaded ? - { // continue, rd_ptr at right place - if (this->bio_ostream_.write ( - mb, // message block - len, // priority - 0, // act - 0, // priority - ACE_SIGRTMIN // default signal - ) == 0) - { - this->bio_out_flag_ |= BF_AIO; - return; - } - - ACELIB_ERROR - ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE_SSL_Asynch_Stream %p\n"), - ACE_TEXT ("attempt write failed") - )); - - this->bio_out_errno_ = EINVAL; - } - - this->do_SSL_state_machine (); - - return; -} - -void -ACE_SSL_Asynch_Stream::handle_read_stream ( - const ACE_Asynch_Read_Stream::Result &result) -{ - ACE_MT (ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_)); - - this->bio_inp_flag_ &= ~BF_AIO; - - size_t bytes_trn = result.bytes_transferred (); - u_long errval = result.error (); - - if (errval != 0) // error ? - this->bio_inp_errno_ = errval; // save err code - else if (bytes_trn == 0) // end of stream ? - this->bio_inp_flag_ |= BF_EOS; // set flag EOS - - this->do_SSL_state_machine (); - - return; -} - -void -ACE_SSL_Asynch_Stream::handle_wakeup (void) -{ - ACE_Handler * user_handler = 0; - - { - ACE_MT (ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_)); - - this->flags_ |= SF_DELETE_ENABLE; - - user_handler = this->ext_handler_; - } - - if (user_handler != 0) - user_handler->handle_wakeup(); -} - -int -ACE_SSL_Asynch_Stream::pending_BIO_count (void) -{ - int ret = 0; - - if (this->bio_inp_flag_ & BF_AIO) - ++ret; - - if (this->bio_out_flag_ & BF_AIO) - ++ret; - - return ret; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* OPENSSL_VERSION_NUMBER > 0x0090581fL && (ACE_WIN32 || - ACE_HAS_AIO_CALLS) */ diff --git a/deps/acelite/ace/SSL/SSL_Asynch_Stream.h b/deps/acelite/ace/SSL/SSL_Asynch_Stream.h deleted file mode 100644 index de2a9dc16..000000000 --- a/deps/acelite/ace/SSL/SSL_Asynch_Stream.h +++ /dev/null @@ -1,464 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file SSL_Asynch_Stream.h - * - * @author Alexander Libman - */ -//============================================================================= - -#ifndef ACE_SSL_ASYNCH_STREAM_H -#define ACE_SSL_ASYNCH_STREAM_H - -#include /**/ "ace/pre.h" -#include "SSL_Context.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if OPENSSL_VERSION_NUMBER > 0x0090581fL && ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) - -#include "SSL_Asynch_BIO.h" - -#include "ace/Asynch_IO_Impl.h" -#include "ace/Message_Block.h" -#include "ace/Synch_Traits.h" -#include "ace/Thread_Mutex.h" - -/* - * This facility doesn't follow the normal ACE asynch I/O support classes' - * interface/implementation arrangement. It's not needed because rather than - * branching off to platform-specific APIs, all platforms use the OpenSSL - * API. Thus, you can think of this class as the implementation class (for - * OpenSSL) and there's no separate interface class. - * Also, since both read and write operations are defined in one I/O - * factory, there's no single Result class defined as there is for - * ACE_Asynch_Read_Stream, et al. There are separate result classes defined - * for read and write operations. - */ - -#if defined (ACE_WIN32) -# include "ace/WIN32_Asynch_IO.h" -typedef ACE_WIN32_Asynch_Result A_RESULT; -typedef ACE_WIN32_Asynch_Read_Stream_Result ARS_RESULT; -typedef ACE_WIN32_Asynch_Write_Stream_Result AWS_RESULT; - -# define ERR_CANCELED ERROR_OPERATION_ABORTED - -#else -# include "ace/POSIX_Asynch_IO.h" -typedef ACE_POSIX_Asynch_Result A_RESULT; -typedef ACE_POSIX_Asynch_Read_Stream_Result ARS_RESULT; -typedef ACE_POSIX_Asynch_Write_Stream_Result AWS_RESULT; - -# define ERR_CANCELED ECANCELED - -#endif /* ACE_WIN32 */ - - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_SSL_Asynch_Stream; // Forward decl for use in result class def. - -/** - * @class ACE_SSL_Asynch_Read_Stream_Result - * - * Result class that communicates result of read operations initiated on - * an ACE_SSL_Asynch_Stream object. - */ -class ACE_SSL_Asynch_Read_Stream_Result : public ARS_RESULT -{ - /// Factory class will have special permissions. - friend class ACE_SSL_Asynch_Stream; - -protected: - ACE_SSL_Asynch_Read_Stream_Result (ACE_Handler &handler, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number); -}; - -/** - * @class ACE_SSL_Asynch_Write_Stream_Result - * - * Result class that communicates result of write operations initiated on - * an ACE_SSL_Asynch_Stream object. - */ -class ACE_SSL_Asynch_Write_Stream_Result : public AWS_RESULT -{ - /// Factory class will have special permissions. - friend class ACE_SSL_Asynch_Stream; - -protected: - ACE_SSL_Asynch_Write_Stream_Result (ACE_Handler &handler, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number); -}; - - -/** - * @class ACE_SSL_Asynch_Result - * - * Result class that is used internally for socket close notifications. - */ -class ACE_SSL_Asynch_Result : public A_RESULT -{ -public: - ACE_SSL_Asynch_Result (ACE_Handler &handler); - - void complete (size_t bytes_transferred, - int success, - const void * completion_key, - u_long error); -}; - - -// Only provide forward declarations to prevent possible abuse of the -// friend declarations in ACE_SSL_Asynch_Stream. -struct ACE_SSL_Asynch_Stream_Accessor; - -/** - * @class ACE_SSL_Asynch_Stream - * - * @brief This class is a factory for initiating asynchronous reads - * and writes on an SSL stream. - * - * Once open() is called, multiple asynchronous read and write operations - * can be started using this class. The handler object (derived from - * ACE_Handler) specified in open() will receive completion events for the - * operations initiated via this class. - */ -class ACE_SSL_Export ACE_SSL_Asynch_Stream - : public ACE_Asynch_Operation, - public ACE_Handler -{ -public: - - // Use a class/struct to work around scoping - // problems for extern "C" free functions with some compilers. For - // example, some can't handle - // - // friend ::some_extern_c_free_function (...) - // - // Note that we could use a straight C++ (i.e. not extern "C") free - // function, but using a class or struct allows us to hide the - // interface from the user, which prevents abuse of this friend - // relationship. - friend struct ACE_SSL_Asynch_Stream_Accessor; - - enum Stream_Type - { - ST_CLIENT = 0x0001, - ST_SERVER = 0x0002 - }; - - /// Constructor. - /** - * @arg context Pointer to an ACE_SSL_Context instance containing - * the OpenSSL information to be associated with this - * ACE_SSL_Asynch_Stream. The needed SSL data will be - * copied before return. Therefore, this object can be - * reused, modified, or deleted upon return. If a 0 pointer - * is passed, the ACE_SSL_Context::instance() method will - * be called to get access to a singleton. - */ - ACE_SSL_Asynch_Stream (Stream_Type s_type = ST_SERVER, - ACE_SSL_Context * context = 0); - - /// Destructor - virtual ~ACE_SSL_Asynch_Stream (void); - - int cancel (void); - - int close (void); - - /// Return a pointer to the underlying SSL structure. - SSL *ssl (void) const; - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. - * - * @arg handler The ACE_Handler that will be called to handle completions - * for operations initiated using this factory. - * @arg handle The handle that future read/write operations will use. - * - * @retval 0 for success. - * @retval -1 for failure; consult @c errno for further information. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** - * Initiates an asynchronous read. If the operation is successfully - * initiated, the handle_read_stream() method will be called on the - * ACE_Handler object passed to open() when the operation completes. - * Data is read into the specified ACE_Message_Block beginning at its - * write pointer; the block's write pointer is updated to reflect any - * added data when the operation completes. - * - * @arg message_block The specified ACE_Message_Block will receive any - * data that is read. Data will be read into the - * block beginning at the block's write pointer. - * @arg num_bytes_to_read The maximum number of bytes to read. The actual - * amount read may be less. - * @arg act ACT which is passed to the completion handler in - * the result object. - * @arg priority Specifies the operation priority. This has an - * affect on POSIX only. Works like @i nice in Unix. - * Negative values are not allowed. 0 means priority - * of the operation same as the process priority. - * 1 means priority of the operation is one less than - * process, and so forth. This parameter has no - * affect on Win32. - * @arg signal_number The POSIX4 real-time signal number to be used - * for the operation. signal_number ranges from - * ACE_SIGRTMIN to ACE_SIGRTMAX. This argument is - * unused on non-POSIX4 systems. - * - * @retval 0 for success. - * @retval -1 for failure; consult @c errno for further information. - */ - int read (ACE_Message_Block &message_block, - size_t num_bytes_to_read, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - - /** - * Initiates an asynchronous write. If the operation is successfully - * initiated, the handle_write_stream() method will be called on the - * ACE_Handler object passed to open() when the operation completes. - * Data is taken from the specified ACE_Message_Block beginning at its - * read pointer; the block's read pointer is updated to reflect any - * data successfully sent when the operation completes. - * - * @arg message_block The specified ACE_Message_Block is the source of - * data that is written. Data will be taken from the - * block beginning at the block's read pointer. - * @arg bytes_to_write The maximum number of bytes to write. The actual - * amount written may be less. - * @arg act ACT which is passed to the completion handler in - * the result object. - * @arg priority Specifies the operation priority. This has an - * affect on POSIX only. Works like @i nice in Unix. - * Negative values are not allowed. 0 means priority - * of the operation same as the process priority. - * 1 means priority of the operation is one less than - * process, and so forth. This parameter has no - * affect on Win32. - * @arg signal_number The POSIX4 real-time signal number to be used - * for the operation. signal_number ranges from - * ACE_SIGRTMIN to ACE_SIGRTMAX. This argument is - * unused on non-POSIX4 systems. - * - * @retval 0 for success. - * @retval -1 for failure; consult @c errno for further information. - */ - int write (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - -protected: - /// Virtual from ACE_Asynch_Operation. Since this class is essentially an - /// implementation class, simply return 0. - virtual ACE_Asynch_Operation_Impl *implementation (void) const { return 0; } - - /// virtual from ACE_Handler - - /// This method is called when BIO write request is completed. It - /// processes the IO completion and calls do_SSL_state_machine(). - virtual void handle_write_stream - (const ACE_Asynch_Write_Stream::Result &result); - - /// This method is called when BIO read request is completed. It - /// processes the IO completion and calls do_SSL_state_machine(). - virtual void handle_read_stream - (const ACE_Asynch_Read_Stream::Result &result); - - /// This method is called when all SSL sessions are closed and no - /// more pending AIOs exist. It also calls users handle_wakeup(). - virtual void handle_wakeup (void); - - /** - * This method will be called after a successful SSL handshake indicating - * that the peer's certificate chain (if any) has been verified and the key - * exchange has completed. When a peer certificate is required, this - * method must be used to perform additional checks beyond the verification - * performed by OpenSSL. - * - * Check 1: - * - * SSL clients that require a peer certificate must specify SSL_VERIFY_PEER - * via ACE_SSL_Context::default_verify_mode. If the peer sends an invalid - * certificate, the SSL handshake will fail; however, if the peer does not - * send a certificate, the SSL handshake will complete successfully which - * may not be acceptable. In this case, you must override this method in a - * subclass and return false if the call to SSL_get_peer_certificate returns - * null. - * - * Check 2: - * - * An additional post handshake check that you should perform is to verify - * the certificate's FQDN against the host address you intended to connect - * to. This check will prevent an attacker from using a certificate signed - * by your CA to usurp your session. For further info on this check, see - * the post_connection_check method in Example 5-8 of 'Network Security with - * OpenSSL' by Viega, et. al. - * - * Return: - * - * false - Terminate the connection. Outstanding IO complete with ERR_CANCELED. - * - * true - Proceed with connection. The default implementation returns true. - */ - virtual bool post_handshake_check (void); - - /** - * @name SSL State Machine - */ - //@{ - int do_SSL_state_machine (void); - int do_SSL_handshake (void); - int do_SSL_read (void); - int do_SSL_write(void); - int do_SSL_shutdown(void); - //@} - - void print_error (int err_ssl, - const ACE_TCHAR *pText); - - int pending_BIO_count (void); - - /// This method is called to notify user handler when user's read in - /// done. - int notify_read (int bytes_transferred, int error); - - /// This method is called to notify user handler when user's write - /// in done. - int notify_write (int bytes_transferred, int error); - - /// This method is called to notify ourself that SSL session is - /// shutdown and that there is no more I/O activity now and in the - /// future. - int notify_close(void); - - /** - * @name BIO Helpers - */ - //@{ - int ssl_bio_read (char * buf, size_t len, int & errval); - int ssl_bio_write (const char * buf, size_t len, int & errval); - //@} - -private: - - // Preventing copying through construction or assignment. - ACE_SSL_Asynch_Stream (ACE_SSL_Asynch_Stream const &); - ACE_SSL_Asynch_Stream & operator= (ACE_SSL_Asynch_Stream const &); - -protected: - - /// Stream Type ST_CLIENT/ST_SERVER - Stream_Type type_; - - /// The proactor - ACE_Proactor * proactor_; - - /// External,i.e user handler - ACE_Handler * ext_handler_; - - /// External, i.e. read result faked for user - ACE_SSL_Asynch_Read_Stream_Result * ext_read_result_ ; - - /// External, i.e. write result faked for user - ACE_SSL_Asynch_Write_Stream_Result * ext_write_result_ ; - - /// Stream state/flags - enum Stream_Flag - { - /// istream_ open OK - SF_STREAM_OPEN = 0x0001, - /// request to SSL shutdown - SF_REQ_SHUTDOWN = 0x0002, - /// SSL shutdown finished - SF_SHUTDOWN_DONE = 0x0004, - /// Close notification sent - SF_CLOSE_NTF_SENT = 0x0008, - /// Stream can be safely destroyed - SF_DELETE_ENABLE = 0x0010 - }; - - int flags_; - - /// The SSL session. - SSL * ssl_; - - /// Flag ensures that post_connection_check() is called at most one time. - bool handshake_complete_; - - /// The BIO implementation - BIO * bio_; - - /// The real streams which work under the ssl connection. - /// BIO performs I/O via this streams - enum BIO_Flag // internal IO flags - { - /// End of stream - BF_EOS = 0x01, - /// Real AIO in progress - BF_AIO = 0x02 - }; - - /** - * @name Internal stream, buffer and info for BIO read - */ - //@{ - ACE_Asynch_Read_Stream bio_istream_; - ACE_Message_Block bio_inp_msg_; - int bio_inp_errno_; - int bio_inp_flag_; - //@} - - /** - * @name Internal stream, buffer and info for BIO write - */ - //@{ - ACE_Asynch_Write_Stream bio_ostream_; - ACE_Message_Block bio_out_msg_; - int bio_out_errno_; - int bio_out_flag_; - //@} - - /// Mutex to protect work - ACE_SYNCH_MUTEX mutex_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined(__ACE_INLINE__) -#include "SSL_Asynch_Stream.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* OPENSSL_VERSION_NUMBER > 0x0090581fL && (ACE_WIN32 || - ACE_HAS_AIO_CALLS) */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SSL_ASYNCH_STREAM_H */ diff --git a/deps/acelite/ace/SSL/SSL_Asynch_Stream.inl b/deps/acelite/ace/SSL/SSL_Asynch_Stream.inl deleted file mode 100644 index 969a37cd3..000000000 --- a/deps/acelite/ace/SSL/SSL_Asynch_Stream.inl +++ /dev/null @@ -1,10 +0,0 @@ -// -*- C++ -*- -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE SSL * -ACE_SSL_Asynch_Stream::ssl (void) const -{ - return this->ssl_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_Context.cpp b/deps/acelite/ace/SSL/SSL_Context.cpp deleted file mode 100644 index 56de6f04b..000000000 --- a/deps/acelite/ace/SSL/SSL_Context.cpp +++ /dev/null @@ -1,795 +0,0 @@ -#include "SSL_Context.h" - -#include "sslconf.h" - -#if !defined(__ACE_INLINE__) -#include "SSL_Context.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Guard_T.h" -#include "ace/Object_Manager.h" -#include "ace/Log_Category.h" -#include "ace/Singleton.h" -#include "ace/Synch_Traits.h" -#include "ace/Truncate.h" -#include "ace/ACE.h" -#include "ace/INET_Addr.h" -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_ctype.h" - -#ifdef ACE_HAS_THREADS -# include "ace/Thread_Mutex.h" -# include "ace/OS_NS_Thread.h" -#endif /* ACE_HAS_THREADS */ - -#include -#include -#include -#include -#include - -namespace -{ - /// Reference count of the number of times the ACE_SSL_Context was - /// initialized. - int ssl_library_init_count = 0; - - // @@ This should also be done with a singleton, otherwise it is not - // thread safe and/or portable to some weird platforms... - -#ifdef ACE_HAS_THREADS - /// Array of mutexes used internally by OpenSSL when the SSL - /// application is multithreaded. - ACE_SSL_Context::lock_type * ssl_locks = 0; - - // @@ This should also be managed by a singleton. -#endif -} - -#ifdef ACE_HAS_THREADS - -# if (defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1) -# define ACE_SSL_LOCKING_CALLBACK_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ACE_SSL_locking_callback) -# define ACE_SSL_THREAD_ID_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ACE_SSL_thread_id) -# else -# define ACE_SSL_LOCKING_CALLBACK_NAME ACE_SSL_locking_callback -# define ACE_SSL_THREAD_ID_NAME ACE_SSL_thread_id -# endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */ - - - -extern "C" -{ - void - ACE_SSL_LOCKING_CALLBACK_NAME (int mode, - int type, - const char * /* file */, - int /* line */) - { - // #ifdef undef - // fprintf(stderr,"thread=%4d mode=%s lock=%s %s:%d\n", - // CRYPTO_thread_id(), - // (mode&CRYPTO_LOCK)?"l":"u", - // (type&CRYPTO_READ)?"r":"w",file,line); - // #endif - // /* - // if (CRYPTO_LOCK_SSL_CERT == type) - // fprintf(stderr,"(t,m,f,l) %ld %d %s %d\n", - // CRYPTO_thread_id(), - // mode,file,line); - // */ - if (mode & CRYPTO_LOCK) - (void) ssl_locks[type].acquire (); - else - (void) ssl_locks[type].release (); - } - - // ------------------------------- - - // Return the current thread ID. OpenSSL uses this on platforms - // that need it. - unsigned long - ACE_SSL_THREAD_ID_NAME (void) - { - return (unsigned long) ACE_VERSIONED_NAMESPACE_NAME::ACE_OS::thr_self (); - } -} -#endif /* ACE_HAS_THREADS */ - - -// **************************************************************** - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#ifdef ACE_HAS_THREADS -ACE_SSL_Context::lock_type * ACE_SSL_Context::locks_ = 0; -#endif /* ACE_HAS_THREADS */ - -ACE_SSL_Context::ACE_SSL_Context (void) - : context_ (0), - mode_ (-1), - default_verify_mode_ (SSL_VERIFY_NONE), - default_verify_callback_ (0), - have_ca_ (0) -{ - ACE_SSL_Context::ssl_library_init (); -} - -ACE_SSL_Context::~ACE_SSL_Context (void) -{ - if (this->context_) - { - ::SSL_CTX_free (this->context_); - this->context_ = 0; - } - - ACE_SSL_Context::ssl_library_fini (); -} - -ACE_SSL_Context * -ACE_SSL_Context::instance (void) -{ - return ACE_Unmanaged_Singleton::instance (); -} - -void -ACE_SSL_Context::ssl_library_init (void) -{ - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, - ace_ssl_mon, - *ACE_Static_Object_Lock::instance ())); - - if (ssl_library_init_count == 0) - { - // Initialize the locking callbacks before initializing anything - // else. -#ifdef ACE_HAS_THREADS - int const num_locks = ::CRYPTO_num_locks (); - - this->locks_ = new lock_type[num_locks]; - ssl_locks = this->locks_; - -# if !defined (WIN32) - // This call isn't necessary on some platforms. See the CRYPTO - // library's threads(3) man page for details. - ::CRYPTO_set_id_callback (ACE_SSL_THREAD_ID_NAME); -# endif /* !WIN32 */ - ::CRYPTO_set_locking_callback (ACE_SSL_LOCKING_CALLBACK_NAME); -#endif /* ACE_HAS_THREADS */ - - ::SSLeay_add_ssl_algorithms (); - ::SSL_load_error_strings (); - - // Seed the random number generator. Note that the random - // number generator can be seeded more than once to "stir" its - // state. - -#ifdef WIN32 - // Seed the random number generator by sampling the screen. - ::RAND_screen (); -#endif /* WIN32 */ - -#if OPENSSL_VERSION_NUMBER >= 0x00905100L - // OpenSSL < 0.9.5 doesn't have EGD support. - - const char *egd_socket_file = - ACE_OS::getenv (ACE_SSL_EGD_FILE_ENV); - - if (egd_socket_file != 0) - (void) this->egd_file (egd_socket_file); -#endif /* OPENSSL_VERSION_NUMBER */ - - const char *rand_file = ACE_OS::getenv (ACE_SSL_RAND_FILE_ENV); - - if (rand_file != 0) - { - (void) this->seed_file (rand_file); - } - - // Initialize the mutexes that will be used by the SSL and - // crypto library. - } - - ++ssl_library_init_count; -} - -void -ACE_SSL_Context::ssl_library_fini (void) -{ - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, - ace_ssl_mon, - *ACE_Static_Object_Lock::instance ())); - - --ssl_library_init_count; - if (ssl_library_init_count == 0) - { - ::ERR_free_strings (); - ::EVP_cleanup (); - - // Clean up the locking callbacks after everything else has been - // cleaned up. -#ifdef ACE_HAS_THREADS - ::CRYPTO_set_locking_callback (0); - ssl_locks = 0; - - delete [] this->locks_; - this->locks_ = 0; -#endif /* ACE_HAS_THREADS */ - } -} - -int -ACE_SSL_Context::set_mode (int mode) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, - ace_ssl_mon, - *ACE_Static_Object_Lock::instance (), - -1)); - - if (this->context_ != 0) - return -1; - -#if OPENSSL_VERSION_NUMBER >= 0x10000002 - const SSL_METHOD *method = 0; -#else - SSL_METHOD *method = 0; -#endif - - switch (mode) - { -#if !defined (OPENSSL_NO_SSL2) - case ACE_SSL_Context::SSLv2_client: - method = ::SSLv2_client_method (); - break; - case ACE_SSL_Context::SSLv2_server: - method = ::SSLv2_server_method (); - break; - case ACE_SSL_Context::SSLv2: - method = ::SSLv2_method (); - break; -#endif /* OPENSSL_NO_SSL2 */ - case ACE_SSL_Context::SSLv3_client: - method = ::SSLv3_client_method (); - break; - case ACE_SSL_Context::SSLv3_server: - method = ::SSLv3_server_method (); - break; - case ACE_SSL_Context::SSLv3: - method = ::SSLv3_method (); - break; - case ACE_SSL_Context::SSLv23_client: - method = ::SSLv23_client_method (); - break; - case ACE_SSL_Context::SSLv23_server: - method = ::SSLv23_server_method (); - break; - case ACE_SSL_Context::SSLv23: - method = ::SSLv23_method (); - break; - case ACE_SSL_Context::TLSv1_client: - method = ::TLSv1_client_method (); - break; - case ACE_SSL_Context::TLSv1_server: - method = ::TLSv1_server_method (); - break; - case ACE_SSL_Context::TLSv1: - method = ::TLSv1_method (); - break; -#if defined(TLS1_1_VERSION) && (TLS_MAX_VERSION >= TLS1_1_VERSION) - case ACE_SSL_Context::TLSv1_1_client: - method = ::TLSv1_1_client_method (); - break; - case ACE_SSL_Context::TLSv1_1_server: - method = ::TLSv1_1_server_method (); - break; - case ACE_SSL_Context::TLSv1_1: - method = ::TLSv1_1_method (); - break; -#endif -#if defined(TLS1_2_VERSION) && (TLS_MAX_VERSION >= TLS1_2_VERSION) - case ACE_SSL_Context::TLSv1_2_client: - method = ::TLSv1_2_client_method (); - break; - case ACE_SSL_Context::TLSv1_2_server: - method = ::TLSv1_2_server_method (); - break; - case ACE_SSL_Context::TLSv1_2: - method = ::TLSv1_2_method (); - break; -#endif - default: - method = ::SSLv3_method (); - break; - } - - this->context_ = ::SSL_CTX_new (method); - if (this->context_ == 0) - return -1; - - this->mode_ = mode; - - // Load the trusted certificate authority (default) certificate - // locations. But do not return -1 on error, doing so confuses CTX - // allocation (severe error) with the less important loading of CA - // certificate location error. If it is important for your - // application then call ACE_SSL_Context::have_trusted_ca(), - // immediately following this call to set_mode(). - (void) this->load_trusted_ca (); - - return 0; -} - -int -ACE_SSL_Context::filter_versions (const char* versionlist) -{ - this->check_context (); - - ACE_CString vlist = versionlist; - ACE_CString seplist = " ,;"; - ACE_CString::size_type pos = 0; - bool match = false; - - for (; pos < vlist.length (); pos++) - { - vlist[pos] = ACE_OS::ace_tolower (vlist[pos]); - } - -#if defined (SSL_OP_NO_SSLv2) - pos = vlist.find("sslv2"); - match = pos != ACE_CString::npos && - (pos == vlist.length () - 5 || - seplist.find (vlist[pos + 5]) != ACE_CString::npos); - if (!match) - { - ::SSL_CTX_set_options (this->context_, SSL_OP_NO_SSLv2); - } -#endif /* SSL_OP_NO_SSLv2 */ - -#if defined (SSL_OP_NO_SSLv3) - pos = vlist.find("sslv3"); - match = pos != ACE_CString::npos && - (pos == vlist.length () - 5 || - seplist.find (vlist[pos + 5]) != ACE_CString::npos); - if (!match) - { - ::SSL_CTX_set_options (this->context_, SSL_OP_NO_SSLv3); - } -#endif /* SSL_OP_NO_SSLv3 */ - -#if defined (SSL_OP_NO_TLSv1) - pos = vlist.find("tlsv1"); - match = pos != ACE_CString::npos && - (pos == vlist.length () - 5 || - seplist.find (vlist[pos + 5]) != ACE_CString::npos); - if (!match) - { - ::SSL_CTX_set_options (this->context_, SSL_OP_NO_TLSv1); - } -#endif /* SSL_OP_NO_TLSv1 */ - -#if defined (SSL_OP_NO_TLSv1_1) - pos = vlist.find("tlsv1.1"); - match = pos != ACE_CString::npos && - (pos == vlist.length () - 7 || - seplist.find (vlist[pos + 7]) != ACE_CString::npos); - if (!match) - { - ::SSL_CTX_set_options (this->context_, SSL_OP_NO_TLSv1_1); - } -#endif /* SSL_OP_NO_TLSv1_1 */ - -#if defined (SSL_OP_NO_TLSv1_2) - pos = vlist.find("tlsv1.2"); - match = pos != ACE_CString::npos && - (pos == vlist.length () - 7 || - seplist.find (vlist[pos + 7]) != ACE_CString::npos); - if (!match) - { - ::SSL_CTX_set_options (this->context_, SSL_OP_NO_TLSv1_2); - } -#endif /* SSL_OP_NO_TLSv1_2 */ - return 0; -} - - -bool -ACE_SSL_Context::check_host (const ACE_INET_Addr &host, SSL *peerssl) -{ -#if defined (OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10002001L) - - this->check_context (); - - int result = 0; - char name[MAXHOSTNAMELEN+1]; - - if (peerssl == 0 || host.get_host_name (name, MAXHOSTNAMELEN) == -1) - { - return false; - } - - X509* cert = ::SSL_get_peer_certificate (peerssl); - if (cert == 0) - { - return false; - } - - char *peer = 0; - char **peerarg = ACE::debug () ? &peer : 0; - int flags = X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT; - size_t len = ACE_OS::strlen (name); - - result = ::X509_check_host (cert, name, len, flags, peerarg); - - if (ACE::debug ()) - { - ACELIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) SSL_Context::check_host ") - ACE_TEXT ("name <%s> returns %d, peer <%s>\n"), - name, result, peer)); - } - if (peer != 0) - { - ::OPENSSL_free (peer); - } - - ::X509_free (cert); - - return result == 1; -#else - ACE_UNUSED_ARG (host); - ACE_UNUSED_ARG (peerssl); - - return false; -#endif /* OPENSSL_VERSION_NUMBER */ -} - -int -ACE_SSL_Context::load_trusted_ca (const char* ca_file, - const char* ca_dir, - bool use_env_defaults) -{ - this->check_context (); - - if (ca_file == 0 && use_env_defaults) - { - // Use the default environment settings. - ca_file = ACE_OS::getenv (ACE_SSL_CERT_FILE_ENV); -#ifdef ACE_DEFAULT_SSL_CERT_FILE - if (ca_file == 0) - ca_file = ACE_DEFAULT_SSL_CERT_FILE; -#endif - } - - if (ca_dir == 0 && use_env_defaults) - { - // Use the default environment settings. - ca_dir = ACE_OS::getenv (ACE_SSL_CERT_DIR_ENV); -#ifdef ACE_DEFAULT_SSL_CERT_DIR - if (ca_dir == 0) - ca_dir = ACE_DEFAULT_SSL_CERT_DIR; -#endif - } - - // NOTE: SSL_CTX_load_verify_locations() returns 0 on error. - if (::SSL_CTX_load_verify_locations (this->context_, - ca_file, - ca_dir) <= 0) - { - if (ACE::debug ()) - ACE_SSL_Context::report_error (); - return -1; - } - - ++this->have_ca_; - - // For TLS/SSL servers scan all certificates in ca_file and ca_dir and - // list them as acceptable CAs when requesting a client certificate. - if (mode_ == SSLv23 - || mode_ == SSLv23_server - || mode_ == TLSv1 - || mode_ == TLSv1_server -#if !defined (OPENSSL_NO_SSL2) - || mode_ == SSLv2 - || mode_ == SSLv2_server -#endif /* !OPENSSL_NO_SSL2 */ - || mode_ == SSLv3 - || mode_ == SSLv3_server) - { - // Note: The STACK_OF(X509_NAME) pointer is a copy of the pointer in - // the CTX; any changes to it by way of these function calls will - // change the CTX directly. - STACK_OF (X509_NAME) * cert_names = 0; - cert_names = ::SSL_CTX_get_client_CA_list (this->context_); - bool error = false; - - // Add CAs from both the file and dir, if specified. There should - // already be a STACK_OF(X509_NAME) in the CTX, but if not, we create - // one. - if (ca_file) - { - if (cert_names == 0) - { - if ((cert_names = ::SSL_load_client_CA_file (ca_file)) != 0) - ::SSL_CTX_set_client_CA_list (this->context_, cert_names); - else - error = true; - } - else - { - // Add new certificate names to the list. - error = (0 == ::SSL_add_file_cert_subjects_to_stack (cert_names, - ca_file)); - } - - if (error) - { - if (ACE::debug ()) - ACE_SSL_Context::report_error (); - return -1; - } - } - - // SSL_add_dir_cert_subjects_to_stack is defined at 0.9.8a (but not - // on OpenVMS or Mac Classic); it may be available earlier. Change - // this comparison if so. It's still (1.0.1g) broken on windows too. -#if defined (OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090801fL) -# if !defined (OPENSSL_SYS_VMS) && !defined (OPENSSL_SYS_MACINTOSH_CLASSIC) -# if !defined (OPENSSL_SYS_WIN32) - - if (ca_dir != 0) - { - if (cert_names == 0) - { - if ((cert_names = sk_X509_NAME_new_null ()) == 0) - { - if (ACE::debug ()) - ACE_SSL_Context::report_error (); - return -1; - } - ::SSL_CTX_set_client_CA_list (this->context_, cert_names); - } - if (0 == ::SSL_add_dir_cert_subjects_to_stack (cert_names, ca_dir)) - { - if (ACE::debug ()) - ACE_SSL_Context::report_error (); - return -1; - } - } -# endif /* !OPENSSL_SYS_WIN32 */ -# endif /* !OPENSSL_SYS_VMS && !OPENSSL_SYS_MACINTOSH_CLASSIC */ -#endif /* OPENSSL_VERSION_NUMBER >= 0.9.8a release */ - - } - - return 0; -} - - -int -ACE_SSL_Context::private_key (const char *file_name, - int type) -{ - if (this->private_key_.type () != -1) - return 0; - - this->check_context (); - - this->private_key_ = ACE_SSL_Data_File (file_name, type); - - if (::SSL_CTX_use_PrivateKey_file (this->context_, - this->private_key_.file_name (), - this->private_key_.type ()) <= 0) - { - this->private_key_ = ACE_SSL_Data_File (); - return -1; - } - else - return this->verify_private_key (); -} - -int -ACE_SSL_Context::verify_private_key (void) -{ - this->check_context (); - - return (::SSL_CTX_check_private_key (this->context_) <= 0 ? -1 : 0); -} - -int -ACE_SSL_Context::certificate (const char *file_name, - int type) -{ - if (this->certificate_.type () != -1) - return 0; - - this->certificate_ = ACE_SSL_Data_File (file_name, type); - - this->check_context (); - - if (::SSL_CTX_use_certificate_file (this->context_, - this->certificate_.file_name (), - this->certificate_.type ()) <= 0) - { - this->certificate_ = ACE_SSL_Data_File (); - return -1; - } - else - return 0; -} - -int -ACE_SSL_Context::certificate (X509* cert) -{ - // Is it really a good idea to return 0 if we're not setting the - // certificate? - if (this->certificate_.type () != -1) - return 0; - - this->check_context(); - - if (::SSL_CTX_use_certificate (this->context_, cert) <= 0) - { - return -1; - } - else - { - // No file is associated with the certificate, set this to a fictional - // value so we don't reset it later. - this->certificate_ = ACE_SSL_Data_File ("MEMORY CERTIFICATE"); - - return 0; - } -} - -void -ACE_SSL_Context::set_verify_peer (int strict, int once, int depth) -{ - this->check_context (); - - // Setup the peer verififcation mode. - - int verify_mode = SSL_VERIFY_PEER; - if (once) - verify_mode |= SSL_VERIFY_CLIENT_ONCE; - if (strict) - verify_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT; - - // set the default verify mode - this->default_verify_mode (verify_mode); - - // Set the max certificate depth but later let the verify_callback - // catch the depth error by adding one to the required depth. - if (depth > 0) - ::SSL_CTX_set_verify_depth (this->context_, depth + 1); -} - - -int -ACE_SSL_Context::random_seed (const char * seed) -{ - int len = ACE_Utils::truncate_cast (ACE_OS::strlen (seed)); - ::RAND_seed (seed, len); - -#if OPENSSL_VERSION_NUMBER >= 0x00905100L - // RAND_status() returns 1 if the PRNG has enough entropy. - return (::RAND_status () == 1 ? 0 : -1); -#else - return 0; // Ugly, but OpenSSL <= 0.9.4 doesn't have RAND_status(). -#endif /* OPENSSL_VERSION_NUMBER >= 0x00905100L */ -} - -int -ACE_SSL_Context::egd_file (const char * socket_file) -{ -#if OPENSSL_VERSION_NUMBER < 0x00905100L - // OpenSSL < 0.9.5 doesn't have EGD support. - ACE_UNUSED_ARG (socket_file); - ACE_NOTSUP_RETURN (-1); -#else - // RAND_egd() returns the amount of entropy used to seed the random - // number generator. The actual value should be greater than 16, - // i.e. 128 bits. - if (::RAND_egd (socket_file) > 0) - return 0; - else - return -1; -#endif /* OPENSSL_VERSION_NUMBER >= 0x00905100L */ -} - -int -ACE_SSL_Context::seed_file (const char * seed_file, long bytes) -{ - // RAND_load_file() returns the number of bytes used to seed the - // random number generator. If the file reads ok, check RAND_status to - // see if it got enough entropy. - if (::RAND_load_file (seed_file, bytes) > 0) -#if OPENSSL_VERSION_NUMBER >= 0x00905100L - // RAND_status() returns 1 if the PRNG has enough entropy. - return (::RAND_status () == 1 ? 0 : -1); -#else - return 0; // Ugly, but OpenSSL <= 0.9.4 doesn't have RAND_status(). -#endif /* OPENSSL_VERSION_NUMBER >= 0x00905100L */ - else - return -1; -} - -void -ACE_SSL_Context::report_error (unsigned long error_code) -{ - if (error_code == 0) - return; - - char error_string[256]; - -// OpenSSL < 0.9.6a doesn't have ERR_error_string_n() function. -#if OPENSSL_VERSION_NUMBER >= 0x0090601fL - (void) ::ERR_error_string_n (error_code, error_string, sizeof error_string); -#else /* OPENSSL_VERSION_NUMBER >= 0x0090601fL */ - (void) ::ERR_error_string (error_code, error_string); -#endif /* OPENSSL_VERSION_NUMBER >= 0x0090601fL */ - - ACELIB_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_SSL (%P|%t) error code: %u - %C\n"), - error_code, - error_string)); -} - -void -ACE_SSL_Context::report_error (void) -{ - unsigned long err = ::ERR_get_error (); - ACE_SSL_Context::report_error (err); - ACE_OS::last_error (err); -} - -int -ACE_SSL_Context::dh_params (const char *file_name, - int type) -{ - if (this->dh_params_.type () != -1) - return 0; - - // For now we only support PEM encodings - if (type != SSL_FILETYPE_PEM) - return -1; - - this->dh_params_ = ACE_SSL_Data_File (file_name, type); - - this->check_context (); - - { - // Swiped from Rescorla's examples and the OpenSSL s_server.c app - DH * ret=0; - BIO * bio = 0; - - if ((bio = ::BIO_new_file (this->dh_params_.file_name (), "r")) == 0) - { - this->dh_params_ = ACE_SSL_Data_File (); - return -1; - } - - ret = PEM_read_bio_DHparams (bio, 0, 0, 0); - BIO_free (bio); - - if (ret == 0) - { - this->dh_params_ = ACE_SSL_Data_File (); - return -1; - } - - if (::SSL_CTX_set_tmp_dh (this->context_, ret) < 0) - { - this->dh_params_ = ACE_SSL_Data_File (); - return -1; - } - DH_free (ret); - } - - return 0; -} - -// **************************************************************** -ACE_SINGLETON_TEMPLATE_INSTANTIATE(ACE_Unmanaged_Singleton, ACE_SSL_Context, ACE_SYNCH_MUTEX) - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_Context.h b/deps/acelite/ace/SSL/SSL_Context.h deleted file mode 100644 index 9dc1958ff..000000000 --- a/deps/acelite/ace/SSL/SSL_Context.h +++ /dev/null @@ -1,425 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file SSL_Context.h - * - * @author Carlos O'Ryan - * @author Ossama Othman - */ -//============================================================================= - -#ifndef ACE_SSL_CONTEXT_H -#define ACE_SSL_CONTEXT_H - -#include /**/ "ace/pre.h" - -#include "SSL_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SString.h" - -#ifdef ACE_HAS_THREADS -# include "ace/Synch_Traits.h" -#endif /* ACE_HAS_THREADS */ - -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_INET_Addr; - -class ACE_SSL_Export ACE_SSL_Data_File -{ -public: - /// Default constructor - ACE_SSL_Data_File (void); - - /// Contructor from a file name and the file type. - ACE_SSL_Data_File (const char *file_name, - int type = SSL_FILETYPE_PEM); - - /// The file name - const char *file_name (void) const; - - /// The type - int type (void) const; - -private: - /// The file name - ACE_CString file_name_; - - /// The type, used by the SSL library to parse the file contents. - int type_; -}; - -// **************************************************************** - -// NOTE: Solaris studio compilers amongst others will issue warnings if the -// the correct type of function pointer (i.e. extern "C" ) is not stored/used -// of the form: -// Warning (Anachronism): Formal argument callback of type -// extern "C" int(*)(int,x509_store_ctx_st*) in call to -// SSL_CTX_set_verify(ssl_ctx_st*, int, extern "C" int(*)(int,x509_store_ctx_st*)) -// is being passed int(*)(int,x509_store_ctx_st*) -// when C library routines are passed CallBack functions pointers that are -// actually C++ functions. -// -// Unfortunatly you can not specify extern "C" linkage anywhere inside a class -// declaration or inside a function prototype for individual parameters. I.e: -// class { extern "C" int (*callback_) (int, void *); }; -// to store a function pointer as a data member of the class is illegal as is: -// void function (extern "C" int (*callback) (int, void *); -// to declare function (or a class member) that takes a extern "C" function -// pointer as a parameter. -// -// Since we need an extern "C" function pointer as a parameter to be stored -// in the class and handled by member functions, we are forced to declare -// a typedef of that extern "C" function pointer that we can then use. -// Again unfortunatly you also are not allowed to simply add the extern "C" -// to the typedef itself, instead you have to place the typedef declaration -// inside an extern "C" block, thus: - -extern "C" { - typedef int (*extern_C_CallBackVerify_t) (int, X509_STORE_CTX *); -} - -/** - * @class ACE_SSL_Context - * - * @brief A wrapper for the OpenSSL SSL_CTX related functions. - * - * This class provides a wrapper for the SSL_CTX data structure. - * Since most applications have a single SSL_CTX structure, this class - * can be used as a singleton. - */ -class ACE_SSL_Export ACE_SSL_Context -{ -public: -#ifdef ACE_HAS_THREADS - typedef ACE_SYNCH_MUTEX lock_type; -#endif /* ACE_HAS_THREADS */ - - enum { - INVALID_METHOD = -1, -#if !defined (OPENSSL_NO_SSL2) - SSLv2_client = 1, - SSLv2_server, - SSLv2, -#endif /* !OPENSSL_NO_SSL2 */ - SSLv3_client = 4, - SSLv3_server, - SSLv3, - SSLv23_client, - SSLv23_server, - SSLv23, - TLSv1_client, - TLSv1_server, - TLSv1, - TLSv1_1_client, - TLSv1_1_server, - TLSv1_1, - TLSv1_2_client, - TLSv1_2_server, - TLSv1_2 - }; - - /// Constructor - ACE_SSL_Context (void); - - /// Destructor - ~ACE_SSL_Context (void); - - /// The Singleton context, the SSL components use the singleton if - /// nothing else is available. - static ACE_SSL_Context *instance (void); - - /** - * Set the CTX mode. The mode can be set only once, afterwards the - * function has no effect and returns -1. - * Once the mode is set the underlying SSL_CTX is initialized and - * the class can be used. - * If the mode is not set, then the class automatically initializes - * itself to the default mode. - */ - int set_mode (int mode = ACE_SSL_Context::SSLv23); - - int get_mode (void) const; - - /// Get the SSL context - SSL_CTX *context (void); - - /// Get the file name and file format used for the private key - int private_key_type (void) const; - const char *private_key_file_name (void) const; - - /// Set the private key file. - /** - * @note This method should only be called after a certificate has - * been set since key verification is performed against the - * certificate, among other things. - */ - int private_key (const char *file_name, int type = SSL_FILETYPE_PEM); - - /// Verify that the private key is valid. - /** - * @note This method should only be called after a certificate has - * been set since key verification is performed against the - * certificate, among other things. - */ - int verify_private_key (void); - - /// Get the file name and file format used for the certificate file - int certificate_type (void) const; - const char *certificate_file_name (void) const; - - /// Set the certificate file. - int certificate (const char *file_name, - int type = SSL_FILETYPE_PEM); - - /// Load certificate from memory rather than a file. - int certificate (X509* cert); - - /// Parse the string and filter crypto versions accordingly - int filter_versions (const char *filter); - - /// verify the peer cert matches the host - bool check_host (const ACE_INET_Addr& host, SSL * peerssl); - - /** - * Load the location of the trusted certification authority - * certificates. Note that CA certificates are stored in PEM format - * as a sequence of certificates in @a ca_file or as a set of - * individual certificates in @a ca_dir (or both). - * - * Note this method is called by set_mode() to load the default - * environment settings for @a ca_file and @a ca_dir, if any. This - * allows for automatic service configuration (and backward - * compatibility with previous versions). - * - * Note that the underlying SSL function will add valid file and - * directory names to the load location lists maintained as part of - * the SSL_CTX table. It therefore doesn't make sense to keep a - * copy of the file and path name of the most recently added - * @a ca_file or @a ca_path. - * - * @param[in] ca_file CA file pathname. Passed to - * @c SSL_CTX_load_verify_locations() if not - * 0. If 0, behavior depends on the value of - * @a use_env_defaults. - * @param[in] ca_dir CA directory pathname. Passed to - * @c SSL_CTX_load_verify_locations() if not - * 0. If 0, behavior depends on the value of - * @a use_env_defaults. - * @param[in] use_env_defaults If false, the specified @a ca_file argument - * is passed to - * @c SSL_CTX_load_verify_locations(), - * regardless of its value. - * If true (the default), additional defaults - * can be applied to either @a ca_file, - * @a ca_dir, or both. The following - * additional defaults are applied when the - * @a ca_file argument is 0: - * - The @c SSL_CERT_FILE environment variable - * will be queried for a file name to use as - * the @a ca_file argument. The environment - * variable name to query can be changed by - * supplying a @c ACE_SSL_CERT_FILE_ENV - * configuration item when building ACE. - * - If there is no @c SSL_CERT_FILE in the - * current environment, the file specified - * by the @c ACE_DEFAULT_SSL_CERT_FILE ACE - * configuration item will be used. The - * default value is "cert.pem" on Windows - * and "/etc/ssl/cert.pem" on all other - * platforms. - * The following additional defaults are - * applied when the @a ca_dir argument is 0: - * - The @c SSL_CERT_DIR environment variable - * will be queried for a file name to use as - * the @a ca_dir argument. The environment - * variable name to query can be changed by - * supplying a @c ACE_SSL_CERT_DIR_ENV - * configuration item when building ACE. - * - If there is no @c SSL_CERT_DIR in the - * current environment, the directory - * specified by the @c - * ACE_DEFAULT_SSL_CERT_DIR ACE - * configuration item will be used. The - * default value is "certs" on Windows - * and "/etc/ssl/certs" on all other - * platforms. - * - * @return 0 for success or -1 on error. - * - * @see OpenSSL manual SSL_CTX_load_verify_locations(3) for a - * detailed description of the CA file and directory requirements - * and processing. - */ - int load_trusted_ca (const char* ca_file = 0, - const char* ca_dir = 0, - bool use_env_defaults = true); - - /** - * Test whether any CA locations have been successfully loaded and - * return the number of successful attempts. - * - * @retval >0 The number of successful CA load attempts. - * @retval 0 If all CA load attempts have failed. - */ - int have_trusted_ca (void) const; - - /** - * @todo Complete this documentation where elipses(...) are used - * - * @doc Use this method when certificate chain verification is - * required. The default server behaviour is SSL_VERIFY_NONE - * i.e. client certicates are requested for verified. This method - * can be used to configure server to request client certificates - * and perform the certificate verification. If is set - * true the client connection is rejected when certificate - * verification fails. Otherwise the session is accepted with a - * warning, which is the default behaviour. If is set true - * (default), certificates are requested only once per session. - * The last parameter can be used to set the verification - * depth. - * - * Note for verification to work correctly there should be a valid - * CA name list set using load_trusted_ca(). - * - * @see OpenSSL documentation of SSL_CTX_set_verify(3) for details of - * the verification process. - * - * @see OpenSSL documentation ... set_verify_depth(3) ... - * - * Note that this method overrides the use of the - * default_verify_mode() method. - */ - void set_verify_peer (int strict = 0, int once = 1, int depth = 0); - - /// TODO: a implementation that will lookup the CTX table for the list - /// of files and paths etc. - /// Query the location of trusted certification authority - /// certificates. - // const char* ca_file_name(void) const; - // const char* ca_dir_name(void) const; - - /** - * Set and query the default verify mode for this context, it is - * inherited by all the ACE_SSL objects created using the context. - * It can be overriden on a per-ACE_SSL object. - */ - void default_verify_mode (int mode); - int default_verify_mode (void) const; - - /** - * Set and query the default verify callback for this context, it is - * inherited by all the ACE_SSL objects created using the context. - * It can be overriden on a per-ACE_SSL object. - */ - void default_verify_callback (extern_C_CallBackVerify_t); - extern_C_CallBackVerify_t default_verify_callback (void) const; - - /** - * @name OpenSSL Random Number Generator Seed Related Methods - * - * These are methods that can be used to seed OpenSSL's - * pseudo-random number generator. These methods can be called more - * than once. - */ - //@{ - /// Seed the underlying random number generator. This value should - /// have at least 128 bits of entropy. - static int random_seed (const char * seed); - - /// Set the Entropy Gathering Daemon (EGD) UNIX domain socket file to - /// read random seed values from. - static int egd_file (const char * socket_file); - - /** - * Set the file that contains the random seed value state, and the - * amount of bytes to read. "-1" bytes causes the entire file to be - * read. - */ - static int seed_file (const char * seed_file, long bytes = -1); - //@} - - /// Print SSL error corresponding to the given error code. - static void report_error (unsigned long error_code); - - /// Print the last SSL error for the current thread. - static void report_error (void); - - /** - * @name Diffie-Hellman (DH) Parameters - * - * When using DSS-based certificates, Diffie-Hellman keys need to be - * exchanged. These must be provided in the form of DH key - * generation parameters loaded in, or as fixed keys hardcoded into - * the code itself. ACE_SSL supports loaded parameters. - * - */ - //@{ - /** - * Load Diffie-Hellman parameters from file_name. The specified file can be - * a standalone file containing only DH parameters (e.g., as created - * by openssl dhparam), or it can be a certificate which has - * a PEM-encoded set of DH params concatenated on to i. - */ - int dh_params (const char *file_name, int type = SSL_FILETYPE_PEM); - const char *dh_params_file_name () const; - int dh_params_file_type () const; - //@} - -private: - /// Verify if the context has been initialized or not. - void check_context (void); - - /// @@ More to document - void ssl_library_init (); - void ssl_library_fini (); - - // = Prevent assignment and copy initialization. - //@{ - ACE_SSL_Context (const ACE_SSL_Context &); - ACE_SSL_Context & operator= (const ACE_SSL_Context &); - //@} - -private: - /// The SSL_CTX structure - SSL_CTX *context_; - - /// Cache the mode so we can answer fast - int mode_; - - /// The private key, certificate, and Diffie-Hellman parameters files - ACE_SSL_Data_File private_key_; - ACE_SSL_Data_File certificate_; - ACE_SSL_Data_File dh_params_; - - /// The default verify mode. - int default_verify_mode_; - - /// The default verify callback. - extern_C_CallBackVerify_t default_verify_callback_; - - /// count of successful CA load attempts - int have_ca_; - -#ifdef ACE_HAS_THREADS - /// Array of mutexes used internally by OpenSSL when the SSL - /// application is multithreaded. - static lock_type * locks_; -#endif /* ACE_HAS_THREADS */ -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined(__ACE_INLINE__) -#include "SSL_Context.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_SSL_CONTEXT_H */ diff --git a/deps/acelite/ace/SSL/SSL_Context.inl b/deps/acelite/ace/SSL/SSL_Context.inl deleted file mode 100644 index d7ccb88d7..000000000 --- a/deps/acelite/ace/SSL/SSL_Context.inl +++ /dev/null @@ -1,122 +0,0 @@ -// -*- C++ -*- -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_SSL_Data_File::ACE_SSL_Data_File (void) - : type_ (-1) -{ -} - -ACE_INLINE -ACE_SSL_Data_File::ACE_SSL_Data_File (const char *file_name, - int type) - : file_name_ (file_name), - type_ (type) -{ -} - -ACE_INLINE const char * -ACE_SSL_Data_File::file_name (void) const -{ - return this->file_name_.c_str (); -} - -ACE_INLINE int -ACE_SSL_Data_File::type (void) const -{ - return this->type_; -} - -// **************************************************************** - -ACE_INLINE void -ACE_SSL_Context::check_context (void) -{ - if (this->context_ == 0) - { - this->set_mode (); - } - - ::SSL_CTX_set_verify (this->context_, this->default_verify_mode (), - this->default_verify_callback ()); -} - -ACE_INLINE SSL_CTX * -ACE_SSL_Context::context (void) -{ - this->check_context (); - return this->context_; -} - -ACE_INLINE int -ACE_SSL_Context::private_key_type (void) const -{ - return this->private_key_.type (); -} - -ACE_INLINE const char* -ACE_SSL_Context::private_key_file_name (void) const -{ - return this->private_key_.file_name (); -} - -ACE_INLINE int -ACE_SSL_Context::certificate_type (void) const -{ - return this->certificate_.type (); -} - -ACE_INLINE const char* -ACE_SSL_Context::certificate_file_name (void) const -{ - return this->certificate_.file_name (); -} - -ACE_INLINE int -ACE_SSL_Context::dh_params_file_type (void) const -{ - return this->dh_params_.type (); -} - -ACE_INLINE const char* -ACE_SSL_Context::dh_params_file_name (void) const -{ - return this->dh_params_.file_name (); -} - -ACE_INLINE void -ACE_SSL_Context::default_verify_mode (int mode) -{ - this->default_verify_mode_ = mode; -} - -ACE_INLINE int -ACE_SSL_Context::default_verify_mode (void) const -{ - return this->default_verify_mode_; -} - -ACE_INLINE void -ACE_SSL_Context::default_verify_callback (extern_C_CallBackVerify_t callback) -{ - this->default_verify_callback_ = callback; -} - -ACE_INLINE extern_C_CallBackVerify_t ACE_SSL_Context::default_verify_callback(void) const -{ - return this->default_verify_callback_; -} - -ACE_INLINE int -ACE_SSL_Context::get_mode (void) const -{ - return this->mode_; -} - -ACE_INLINE int -ACE_SSL_Context::have_trusted_ca (void) const -{ - return this->have_ca_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_Export.h b/deps/acelite/ace/SSL/SSL_Export.h deleted file mode 100644 index 0c98d7d28..000000000 --- a/deps/acelite/ace/SSL/SSL_Export.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- -// Definition for Win32 Export directives. -// This file is generated automatically by -// generate_export_file.pl -// ------------------------------ -#if !defined (ACE_SSL_EXPORT_H) -#define ACE_SSL_EXPORT_H - -#include /**/ "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_SSL_HAS_DLL) -# define ACE_SSL_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && ACE_SSL_HAS_DLL */ - -#if !defined (ACE_SSL_HAS_DLL) -#define ACE_SSL_HAS_DLL 1 -#endif /* ! ACE_SSL_HAS_DLL */ - -#if defined (ACE_SSL_HAS_DLL) -# if (ACE_SSL_HAS_DLL == 1) -# if defined (ACE_SSL_BUILD_DLL) -# define ACE_SSL_Export ACE_Proper_Export_Flag -# define ACE_SSL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_SSL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else -# define ACE_SSL_Export ACE_Proper_Import_Flag -# define ACE_SSL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_SSL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_SSL_BUILD_DLL */ -# else -# define ACE_SSL_Export -# define ACE_SSL_SINGLETON_DECLARATION(T) -# define ACE_SSL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ! ACE_SSL_HAS_DLL == 1 */ -#else -# define ACE_SSL_Export -# define ACE_SSL_SINGLETON_DECLARATION(T) -# define ACE_SSL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_SSL_HAS_DLL */ - -#endif /* ACE_SSL_EXPORT_H */ - -// End of auto generated file. diff --git a/deps/acelite/ace/SSL/SSL_Initializer.cpp b/deps/acelite/ace/SSL/SSL_Initializer.cpp deleted file mode 100644 index b4baac0bc..000000000 --- a/deps/acelite/ace/SSL/SSL_Initializer.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "SSL_Initializer.h" -#include "SSL_Context.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -int -ACE_SSL_Initializer::static_init (void) -{ - ACE_Service_Config::process_directive (ace_svc_desc_ACE_SSL_Initializer); - return 0; -} - -int -ACE_SSL_Initializer::init (int, ACE_TCHAR *[]) -{ - // Initialize ACE_SSL_Context singleton. - ACE_SSL_Context * ssl_ctx = ACE_SSL_Context::instance (); - ACE_ASSERT (ssl_ctx != 0); - ACE_UNUSED_ARG (ssl_ctx); - - return 0; -} - -int -ACE_SSL_Initializer::fini (void) -{ - // Explicitly close the ACE_SSL_Context singleton. - ACE_Unmanaged_Singleton::close(); - - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE (ACE_SSL_Initializer, - ACE_TEXT ("ACE_SSL_Initializer"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ACE_SSL_Initializer), - ACE_Service_Type::DELETE_THIS | - ACE_Service_Type::DELETE_OBJ, - 0) -ACE_FACTORY_DEFINE (ACE_SSL, ACE_SSL_Initializer) diff --git a/deps/acelite/ace/SSL/SSL_Initializer.h b/deps/acelite/ace/SSL/SSL_Initializer.h deleted file mode 100644 index d73c8f88a..000000000 --- a/deps/acelite/ace/SSL/SSL_Initializer.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file SSL_Initializer.h - * - * @author Vladimir Zykov - */ -//============================================================================= - -#ifndef ACE_SSL_INITIALIZER_H -#define ACE_SSL_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "SSL_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "ace/Service_Object.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_SSL_Export ACE_SSL_Initializer - : public ACE_Service_Object -{ -public: - /// Used to force the initialization of ACE_SSL. - static int static_init (void); - - /// Create ACE_SSL_Context singleton. - virtual int init (int argc, ACE_TCHAR *argv[]); - - /// Do cleanup of SSL library. - virtual int fini (void); -}; - -static int ACE_Force_ACE_SSL_Initializer = ACE_SSL_Initializer::static_init (); - -ACE_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE (ACE_SSL_Initializer) -ACE_FACTORY_DECLARE (ACE_SSL, ACE_SSL_Initializer) - -#include /**/ "ace/post.h" - -#endif /* ACE_SSL_INITIALIZER_H */ diff --git a/deps/acelite/ace/SSL/SSL_SOCK.cpp b/deps/acelite/ace/SSL/SSL_SOCK.cpp deleted file mode 100644 index b82ec7d55..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "SSL_SOCK.h" - -#if !defined (__ACE_INLINE__) -#include "SSL_SOCK.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/OS_NS_errno.h" -#include "ace/os_include/os_signal.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_SSL_SOCK::ACE_SSL_SOCK (void) -{ - ACE_TRACE ("ACE_SSL_SOCK::ACE_SSL_SOCK"); -} - -ACE_SSL_SOCK::~ACE_SSL_SOCK (void) -{ - ACE_TRACE ("ACE_SSL_SOCK::~ACE_SSL_SOCK"); -} - -int -ACE_SSL_SOCK::enable (int value) const -{ - ACE_TRACE ("ACE_SSL_SOCK::enable"); - - switch (value) - { -#ifdef SIGURG - case SIGURG: - case ACE_SIGURG: -#endif /* SIGURG */ - case SIGIO: - case ACE_SIGIO: - case ACE_CLOEXEC: - ACE_NOTSUP_RETURN (-1); - case ACE_NONBLOCK: - return ACE_IPC_SAP::enable (value); - default: - return -1; - } -} - -int -ACE_SSL_SOCK::disable (int value) const -{ - ACE_TRACE("ACE_SSL_SOCK::disable"); - switch (value) - { -#ifdef SIGURG - case SIGURG: - case ACE_SIGURG: -#endif /* SIGURG */ - case SIGIO: - case ACE_SIGIO: - case ACE_CLOEXEC: - ACE_NOTSUP_RETURN (-1); - case ACE_NONBLOCK: - return ACE_IPC_SAP::disable (value); - default: - return -1; - } -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_SOCK.h b/deps/acelite/ace/SSL/SSL_SOCK.h deleted file mode 100644 index 16e84af89..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK.h +++ /dev/null @@ -1,91 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file SSL_SOCK.h - * - * @author Ossama Othman - */ -//============================================================================= - - -#ifndef ACE_SSL_SOCK_H -#define ACE_SSL_SOCK_H - -#include /**/ "ace/pre.h" - -#include "SSL_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SOCK.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_SSL_SOCK - * - * @brief An abstract class that forms the basis for more specific - * classes, such as "ACE_SSL_SOCK_Acceptor" and - * "ACE_SSL_SOCK_Stream". Do not instantiate this class. - * - * This class provides functions that are common to all of the - * ACE_SSL_SOCK_* classes. ACE_SSL_SOCK provides the ability - * to get and set socket options, get the local and remote - * addresses, and close the socket. - */ -class ACE_SSL_Export ACE_SSL_SOCK : public ACE_SOCK -{ -public: - - /** - * Override ACE_SOCK base class implementations with these SSL - * specific ones. - */ - //@{ - int set_option (int level, - int option, - void *optval, - int optlen) const; - int get_option (int level, - int option, - void *optval, - int *optlen) const; - int enable (int value) const; - int disable (int value) const; - void set_handle (ACE_HANDLE); - ACE_HANDLE get_handle (void) const; - int control (int cmd, void *arg) const; - //@} - -protected: - - /// Default constructor is private to prevent instances of this class - /// from being defined. - ACE_SSL_SOCK (void); - - /// Destructor - /** - * Not a virtual destructor. Protected destructor to prevent - * operator delete() from being called through a base class - * ACE_SSL_SOCK pointer/reference. - */ - ~ACE_SSL_SOCK (void); - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "SSL_SOCK.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SSL_SOCK_H */ - - - - diff --git a/deps/acelite/ace/SSL/SSL_SOCK.inl b/deps/acelite/ace/SSL/SSL_SOCK.inl deleted file mode 100644 index 6a12914d8..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK.inl +++ /dev/null @@ -1,68 +0,0 @@ -// -*- C++ -*- -#include "ace/OS_NS_sys_socket.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void -ACE_SSL_SOCK::set_handle (ACE_HANDLE fd) -{ - this->ACE_SOCK::set_handle (fd); -} - -ACE_INLINE ACE_HANDLE -ACE_SSL_SOCK::get_handle (void) const -{ - // return this->ssl_ ? (ACE_HANDLE) ::SSL_get_fd (this->ssl_) : ACE_INVALID_HANDLE; - return this->ACE_SOCK::get_handle (); -} - - -ACE_INLINE int -ACE_SSL_SOCK::control (int cmd, void *arg) const -{ - return ACE_OS::ioctl (this->get_handle (), cmd, arg); -} - -ACE_INLINE int -ACE_SSL_SOCK::set_option (int level, - int option, - void *optval, - int optlen) const -{ -// switch (option) -// { -// case SO_SNDBUF: -// return ::BIO_set_write_buffer_size (this->io_bio_, *((int *) optval)); -// case SO_RCVCBUF: -// return ::BIO_set_read_buffer_size (this->io_bio_, *((int *) optval)); -// default: - return ACE_OS::setsockopt (this->get_handle (), - level, - option, (char *) optval, - optlen); -// } -} - -// Provides access to the ACE_OS::getsockopt system call. - -ACE_INLINE int -ACE_SSL_SOCK::get_option (int level, - int option, - void *optval, - int *optlen) const -{ -// switch (option) -// { -// case SO_SNDBUF: -// return ::BIO_get_write_buffer_size (this->io_bio_, *((int *) optval)); -// case SO_RCVCBUF: -// return ::BIO_get_read_buffer_size (this->io_bio_, *((int *) optval)); -// default: - return ACE_OS::getsockopt (this->get_handle (), - level, - option, (char *) optval, - optlen); -// } -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_SOCK_Acceptor.cpp b/deps/acelite/ace/SSL/SSL_SOCK_Acceptor.cpp deleted file mode 100644 index d790662af..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK_Acceptor.cpp +++ /dev/null @@ -1,243 +0,0 @@ -// -*- C++ -*- - -#include "SSL_SOCK_Acceptor.h" - -#include "ace/Handle_Set.h" -#include "ace/OS_Errno.h" -#include "ace/OS_NS_errno.h" -#include "ace/Log_Category.h" -#include "ace/Time_Value.h" -#include "ace/Countdown_Time.h" -#include "ace/Truncate.h" - -#if !defined (__ACE_INLINE__) -#include "SSL_SOCK_Acceptor.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_SSL_SOCK_Acceptor) - -ACE_SSL_SOCK_Acceptor::~ACE_SSL_SOCK_Acceptor (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::~ACE_SSL_SOCK_Acceptor"); -} - - -int -ACE_SSL_SOCK_Acceptor::ssl_accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Time_Value *timeout) const -{ - SSL *ssl = new_stream.ssl (); - - if (SSL_is_init_finished (ssl)) - return 0; - - if (!SSL_in_accept_init (ssl)) - ::SSL_set_accept_state (ssl); - - ACE_HANDLE handle = new_stream.get_handle (); - - // We're going to call SSL_accept, optionally doing ACE::select and - // retrying the SSL_accept, until the SSL handshake is done or - // it fails. - // To get the timeout affect, set the socket to nonblocking mode - // before beginning if there is a timeout specified. If the timeout - // is 0 (wait as long as it takes) then don't worry about the blocking - // status; we'll block in SSL_accept if the socket is blocking, and - // block in ACE::select if not. - int reset_blocking_mode = 0; - if (timeout != 0) - { - reset_blocking_mode = ACE_BIT_DISABLED (ACE::get_flags (handle), - ACE_NONBLOCK); - // Set the handle into non-blocking mode if it's not already - // in it. - if (reset_blocking_mode - && ACE::set_flags (handle, - ACE_NONBLOCK) == -1) - return -1; - } - - // Take into account the time between each select() call below. - ACE_Countdown_Time countdown (timeout); - - int status; - do - { - // These handle sets are used to set up for whatever SSL_accept - // says it wants next. They're reset on each pass around the loop. - ACE_Handle_Set rd_handle; - ACE_Handle_Set wr_handle; - - status = ::SSL_accept (ssl); - switch (::SSL_get_error (ssl, status)) - { - case SSL_ERROR_NONE: - status = 0; // To tell caller about success - break; // Done - - case SSL_ERROR_WANT_WRITE: - wr_handle.set_bit (handle); - status = 1; // Wait for more activity - break; - - case SSL_ERROR_WANT_READ: - rd_handle.set_bit (handle); - status = 1; // Wait for more activity - break; - - case SSL_ERROR_ZERO_RETURN: - // The peer has notified us that it is shutting down via - // the SSL "close_notify" message so we need to - // shutdown, too. - status = -1; - break; - - case SSL_ERROR_SYSCALL: - // On some platforms (e.g. MS Windows) OpenSSL does not - // store the last error in errno so explicitly do so. - // - // Explicitly check for EWOULDBLOCK since it doesn't get - // converted to an SSL_ERROR_WANT_{READ,WRITE} on some - // platforms. If SSL_accept failed outright, though, don't - // bother checking more. This can happen if the socket gets - // closed during the handshake. - if (ACE_OS::set_errno_to_last_error () == EWOULDBLOCK && - status == -1) - { - // Although the SSL_ERROR_WANT_READ/WRITE isn't getting - // set correctly, the read/write state should be valid. - // Use that to decide what to do. - status = 1; // Wait for more activity - if (SSL_want_write (ssl)) - wr_handle.set_bit (handle); - else if (SSL_want_read (ssl)) - rd_handle.set_bit (handle); - else - status = -1; // Doesn't want anything - bail out - } - else - status = -1; - break; - - default: - ACE_SSL_Context::report_error (); - status = -1; - break; - } - - if (status == 1) - { - // Must have at least one handle to wait for at this point. - ACE_ASSERT (rd_handle.num_set() == 1 || wr_handle.num_set () == 1); - status = ACE::select (int (handle) + 1, - &rd_handle, - &wr_handle, - 0, - timeout); - - (void) countdown.update (); - - // 0 is timeout, so we're done. - // -1 is error, so we're done. - // Could be both handles set (same handle in both masks) so - // set to 1. - if (status >= 1) - status = 1; - else // Timeout or failure - status = -1; - } - - } while (status == 1 && !SSL_is_init_finished (ssl)); - - if (reset_blocking_mode) - { - ACE_Errno_Guard eguard (errno); - ACE::clr_flags (handle, ACE_NONBLOCK); - } - - return (status == -1 ? -1 : 0); - -} - -// General purpose routine for accepting new connections. -// Since our underlying acceptor is of the plain old ACE_SOCK_Acceptor -// variety, get the basic socket setup done with it, then take care of -// the SSL handshake if the socket is accepted. -int -ACE_SSL_SOCK_Acceptor::accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Addr *remote_addr, - ACE_Time_Value *timeout, - bool restart, - bool reset_new_handle) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::accept"); - - // Take into account the time to complete the basic TCP handshake - // and the SSL handshake. - ACE_Countdown_Time countdown (timeout); - - ACE_SOCK_Stream temp_stream; - if (-1 == this->acceptor_.accept (temp_stream, - remote_addr, - timeout, - restart, - reset_new_handle)) - return -1; - - (void) countdown.update (); - - new_stream.set_handle (temp_stream.get_handle ()); - temp_stream.set_handle (ACE_INVALID_HANDLE); - - if (this->ssl_accept (new_stream, timeout) == -1) - { - new_stream.close (); - new_stream.set_handle (ACE_INVALID_HANDLE); - return -1; - } - - return 0; - -} - -int -ACE_SSL_SOCK_Acceptor::accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Accept_QoS_Params qos_params, - ACE_Addr *remote_addr, - ACE_Time_Value *timeout, - bool restart, - bool reset_new_handle) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::accept"); - - // Take into account the time to complete the basic TCP handshake - // and the SSL handshake. - ACE_Countdown_Time countdown (timeout); - - ACE_SOCK_Stream temp_stream; - if (-1 == this->acceptor_.accept (temp_stream, - qos_params, - remote_addr, - timeout, - restart, - reset_new_handle)) - return -1; - - (void) countdown.update (); - - new_stream.set_handle (temp_stream.get_handle ()); - temp_stream.set_handle (ACE_INVALID_HANDLE); - - if (this->ssl_accept (new_stream, timeout) == -1) - { - new_stream.close (); - new_stream.set_handle (ACE_INVALID_HANDLE); - return -1; - } - - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_SOCK_Acceptor.h b/deps/acelite/ace/SSL/SSL_SOCK_Acceptor.h deleted file mode 100644 index add881ed3..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK_Acceptor.h +++ /dev/null @@ -1,195 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file SSL_SOCK_Acceptor.h - * - * @author John Heitmann - * @author Chris Zimman - * @author Ossama Othman - */ -//============================================================================= - -#ifndef ACE_SSL_SOCK_ACCEPTOR_H -#define ACE_SSL_SOCK_ACCEPTOR_H - -#include /**/ "ace/pre.h" - -#include "SSL_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "SSL_SOCK_Stream.h" - -#include "ace/SOCK_Acceptor.h" -#include "ace/OS_QoS.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_SSL_SOCK_Acceptor - * - * @brief Defines a factory that creates new @c ACE_SSL_SOCK_Stream - * objects passively. - * - * The ACE_SSL_SOCK_Acceptor has its own @c ACE_SOCK_Acceptor - * which handles the basic socket acceptance. This class is a - * wrapper which adds the SSL acceptance handshake handling. - * Since SSL is record oriented, some additional steps must be taken - * after the basic socket acceptance to complete the SSL handshake that - * takes place at session establishment. - * - * @note The user must currently ensure that only one thread services - * a given SSL session at any given time since some underlying - * SSL implementations, such as OpenSSL, are not entirely - * thread-safe or reentrant. - */ -class ACE_SSL_Export ACE_SSL_SOCK_Acceptor : public ACE_SSL_SOCK -{ -public: - - /// Default constructor. - ACE_SSL_SOCK_Acceptor (void); - - /// Default destructor. - ~ACE_SSL_SOCK_Acceptor (void); - - /** - * Initiate a passive mode SSL/BSD-style acceptor socket. - * @param local_sap The address that we're going to listen for - * connections on. If this is @c ACE_Addr::sap_any, - * this socket listens on an the "any" IP address - * and selects an unused port. To find out what port - * was selected, call this object's - * @c ACE_SOCK::get_local_addr(ACE_Addr&) method - * upon return. - */ - ACE_SSL_SOCK_Acceptor (const ACE_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = PF_UNSPEC, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - - /** - * Initiate a passive-mode QoS-enabled acceptor socket. - * @param local_sap The address that we're going to listen for - * connections on. If this is @c ACE_Addr::sap_any, - * this socket listens on an the "any" IP address - * and selects an unused port. To find out what port - * was selected, call this object's - * @c ACE_SOCK::get_local_addr(ACE_Addr&) method - * upon return. - */ - ACE_SSL_SOCK_Acceptor (const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int protocol_family = PF_UNSPEC, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - - /** - * Initiate a passive mode SSL/BSD-style acceptor socket. - * @param local_sap The address that we're going to listen for - * connections on. If this is @c ACE_Addr::sap_any, - * this socket listens on an the "any" IP address - * and selects an unused port. To find out what port - * was selected, call this object's - * @c ACE_SOCK::get_local_addr(ACE_Addr&) method - * upon return. - * - * @return 0 if success; -1 for failure (errno contains error code). - */ - int open (const ACE_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = PF_UNSPEC, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - - /// Close the listening socket. - int close (void); - - /** - * @name Passive Connection "accept" Methods - * - * These are the canonical methods exposed by the Acceptor pattern. - */ - //@{ - /** - * Accept a new ACE_SSL_SOCK_Stream connection. On successful return, - * the socket has been accepted and the SSL handshake has been completed. - * @param new_stream The @c ACE_SSL_SOCK_Stream object that will receive - * the new SSL socket. - * @param remote_addr Pointer to an @c ACE_INET_Addr object that will - * receive the address of the peer that connected. - * @param timeout The maximum time to wait for the combined socket - * acceptance and handshake completion. 0 means - * block forever, a timeout of {0, 0} means poll. - * @param restart 1 means "restart if interrupted," that is, - * if errno == EINTR. - * - * @return 0 if success; -1 for failure (errno contains error code). - */ - int accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - bool restart = true, - bool reset_new_handle = false) const; - - /** - * Accept a new ACE_SSL_SOCK_Stream connection using the RVSP QoS - * information in qos_params. - * @param new_stream The @c ACE_SSL_SOCK_Stream object that will receive - * the new SSL socket. - * @param remote_addr Pointer to an @c ACE_INET_Addr object that will - * receive the address of the peer that connected. - * @param timeout The maximum time to wait for the combined socket - * acceptance and handshake completion. 0 means - * block forever, a timeout of {0, 0} means poll. - * @param restart 1 means "restart if interrupted," that is, - * if errno == EINTR. - * - * @return 0 if success; -1 for failure (errno contains error code). - */ - int accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Accept_QoS_Params qos_params, - ACE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - bool restart = true, - bool reset_new_handle = false) const; - //@} - - /// Meta-type info - //@{ - typedef ACE_INET_Addr PEER_ADDR; - typedef ACE_SSL_SOCK_Stream PEER_STREAM; - //@} - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - - /// Complete SSL passive connection establishment. - int ssl_accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Time_Value *timeout) const; - -private: - - /// The BSD-socket workhorse - ACE_SOCK_Acceptor acceptor_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "SSL_SOCK_Acceptor.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SSL_SOCK_ACCEPTOR_H */ diff --git a/deps/acelite/ace/SSL/SSL_SOCK_Acceptor.inl b/deps/acelite/ace/SSL/SSL_SOCK_Acceptor.inl deleted file mode 100644 index c02845b22..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK_Acceptor.inl +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor (void) - : acceptor_ () -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor"); -} - -ACE_INLINE -ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor (const ACE_Addr &local_sap, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) - : acceptor_ (local_sap, - reuse_addr, - protocol_family, - backlog, - protocol) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor"); - - this->set_handle (this->acceptor_.get_handle ()); -} - -ACE_INLINE -ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor (const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) - : acceptor_ (local_sap, - protocolinfo, - g, - flags, - reuse_addr, - protocol_family, - backlog, - protocol) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor"); - - this->set_handle (this->acceptor_.get_handle ()); -} - -ACE_INLINE int -ACE_SSL_SOCK_Acceptor::open (const ACE_Addr &local_sap, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::open"); - if (this->acceptor_.open (local_sap, - reuse_addr, - protocol_family, - backlog, - protocol) != 0) - return -1; - else - this->set_handle (this->acceptor_.get_handle ()); - - return 0; -} - -ACE_INLINE int -ACE_SSL_SOCK_Acceptor::close (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::close ()"); - - int const result = this->acceptor_.close (); - this->set_handle (ACE_INVALID_HANDLE); - - return result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_SOCK_Connector.cpp b/deps/acelite/ace/SSL/SSL_SOCK_Connector.cpp deleted file mode 100644 index 45df4ef04..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK_Connector.cpp +++ /dev/null @@ -1,418 +0,0 @@ -// -*- C++ -*- -#include "SSL_SOCK_Connector.h" - -#include "ace/OS_NS_errno.h" -#include "ace/Handle_Set.h" -#include "ace/INET_Addr.h" -#include "ace/Log_Category.h" -#include "ace/Countdown_Time.h" -#include "ace/Truncate.h" - -#include - -#if !defined (__ACE_INLINE__) -#include "SSL_SOCK_Connector.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_SSL_SOCK_Connector) - -ACE_SSL_SOCK_Connector::~ACE_SSL_SOCK_Connector (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::~ACE_SSL_SOCK_Connector"); -} - -int -ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Time_Value *timeout) -{ - SSL *ssl = new_stream.ssl (); - - if (SSL_is_init_finished (ssl)) - return 0; - - // Check if a connection is already pending for the given SSL - // structure. - if (!SSL_in_connect_init (ssl)) - ::SSL_set_connect_state (ssl); - - ACE_HANDLE handle = new_stream.get_handle (); - - // We're going to call SSL_connect, optionally doing ACE::select and - // retrying the SSL_connect, until the SSL handshake is done or - // it fails. - // To get the timeout affect, set the socket to nonblocking mode - // before beginning if there is a timeout specified. If the timeout - // is 0 (wait as long as it takes) then don't worry about the blocking - // status; we'll block in SSL_connect if the socket is blocking, and - // block in ACE::select if not. - int reset_blocking_mode = 0; - if (timeout != 0) - { - reset_blocking_mode = ACE_BIT_DISABLED (ACE::get_flags (handle), - ACE_NONBLOCK); - // Set the handle into non-blocking mode if it's not already - // in it. - if (reset_blocking_mode - && ACE::set_flags (handle, - ACE_NONBLOCK) == -1) - return -1; - } - - ACE_Time_Value t; - if (timeout != 0) - t = *timeout; // Need a non-const copy. - - // Take into account the time between each select() call below. - ACE_Countdown_Time countdown ((timeout == 0 ? 0 : &t)); - - int status; - - do - { - // These handle sets are used to set up for whatever SSL_connect - // says it wants next. They're reset on each pass around the loop. - ACE_Handle_Set rd_handle; - ACE_Handle_Set wr_handle; - - status = ::SSL_connect (ssl); - switch (::SSL_get_error (ssl, status)) - { - case SSL_ERROR_NONE: - // Start out with non-blocking disabled on the SSL stream. - new_stream.disable (ACE_NONBLOCK); - status = 0; // To tell caller about success - break; // Done - - case SSL_ERROR_WANT_WRITE: - wr_handle.set_bit (handle); - status = 1; // Wait for more activity - break; - - case SSL_ERROR_WANT_READ: - rd_handle.set_bit (handle); - status = 1; // Wait for more activity - break; - - case SSL_ERROR_ZERO_RETURN: - // The peer has notified us that it is shutting down via - // the SSL "close_notify" message so we need to - // shutdown, too. - status = -1; - break; - - case SSL_ERROR_SYSCALL: - // On some platforms (e.g. MS Windows) OpenSSL does not - // store the last error in errno so explicitly do so. - // - // Explicitly check for EWOULDBLOCK since it doesn't get - // converted to an SSL_ERROR_WANT_{READ,WRITE} on some - // platforms. If SSL_connect failed outright, though, don't - // bother checking more. This can happen if the socket gets - // closed during the handshake. - if (ACE_OS::set_errno_to_last_error () == EWOULDBLOCK && - status == -1) - { - // Although the SSL_ERROR_WANT_READ/WRITE isn't getting - // set correctly, the read/write state should be valid. - // Use that to decide what to do. - status = 1; // Wait for more activity - if (SSL_want_write (ssl)) - { - wr_handle.set_bit (handle); - } - else if (SSL_want_read (ssl)) - { - rd_handle.set_bit (handle); - } - else - { - status = -1; // Doesn't want anything - bail out - } - } - else - { - status = -1; - } - - break; - - default: - ACE_SSL_Context::report_error (); - status = -1; - break; - } - - if (status == 1) - { - // Must have at least one handle to wait for at this point. - ACE_ASSERT (rd_handle.num_set () == 1 || wr_handle.num_set () == 1); - - // Block indefinitely if timeout pointer is zero. - status = ACE::select (int (handle) + 1, - &rd_handle, - &wr_handle, - 0, - (timeout == 0 ? 0 : &t)); - - (void) countdown.update (); - - // 0 is timeout, so we're done. - // -1 is error, so we're done. - // Could be both handles set (same handle in both masks) so set to 1. - if (status >= 1) - { - status = 1; - } - else // Timeout or socket failure - { - status = -1; - } - } - - } while (status == 1 && !SSL_is_init_finished (ssl)); - - if (reset_blocking_mode) - { - ACE_Errno_Guard eguard (errno); - ACE::clr_flags (handle, ACE_NONBLOCK); - } - - return (status == -1 ? -1 : 0); -} - -int -ACE_SSL_SOCK_Connector::connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - const ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::connect"); - - // Take into account the time to complete the basic TCP handshake - // and the SSL handshake. - ACE_Time_Value time_copy; - ACE_Countdown_Time countdown (&time_copy); - if (timeout != 0) - { - time_copy += *timeout; - countdown.start (); - } - - int result = - this->connector_.connect (new_stream.peer (), - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms); - - int error = 0; - if (result == -1) - error = errno; // Save us some TSS accesses. - - // Obtain the handle from the underlying SOCK_Stream and set it in - // the SSL_SOCK_Stream. Note that the case where a connection is in - // progress is also handled. In that case, the handle must also be - // set in the SSL_SOCK_Stream so that the correct handle is returned - // when performing non-blocking connect()s. - if (new_stream.get_handle () == ACE_INVALID_HANDLE - && (result == 0 - || (result == -1 && (error == EWOULDBLOCK - || error == EINPROGRESS)))) - new_stream.set_handle (new_stream.peer ().get_handle ()); - - if (result == -1) - return result; - - // If using a timeout, update the countdown timer to reflect the time - // spent on the connect itself, then pass the remaining time to - // ssl_connect to bound the time on the handshake. - if (timeout != 0) - { - countdown.update (); - timeout = &time_copy; - } - - result = this->ssl_connect (new_stream, timeout); - - if (result == -1) - new_stream.close (); - - return result; -} - -int -ACE_SSL_SOCK_Connector::connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - const ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int perms) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::connect"); - - // Take into account the time to complete the basic TCP handshake - // and the SSL handshake. - ACE_Time_Value time_copy; - ACE_Countdown_Time countdown (&time_copy); - if (timeout != 0) - { - time_copy += *timeout; - countdown.start (); - } - - int result = this->connector_.connect (new_stream.peer (), - remote_sap, - qos_params, - timeout, - local_sap, - protocolinfo, - g, - flags, - reuse_addr, - perms); - - int error = 0; - if (result == -1) - error = errno; // Save us some TSS accesses. - - // Obtain the handle from the underlying SOCK_Stream and set it in - // the SSL_SOCK_Stream. Note that the case where a connection is in - // progress is also handled. In that case, the handle must also be - // set in the SSL_SOCK_Stream so that the correct handle is returned - // when performing non-blocking connect()s. - if (new_stream.get_handle () == ACE_INVALID_HANDLE - && (result == 0 - || (result == -1 && (error == EWOULDBLOCK - || error == EINPROGRESS)))) - new_stream.set_handle (new_stream.peer ().get_handle ()); - - if (result == -1) - return result; - - // If using a timeout, update the countdown timer to reflect the time - // spent on the connect itself, then pass the remaining time to - // ssl_connect to bound the time on the handshake. - if (timeout != 0) - { - countdown.update (); - timeout = &time_copy; - } - - result = this->ssl_connect (new_stream, timeout); - - if (result == -1) - new_stream.close (); - - return result; -} - -// Try to complete a non-blocking connection. - -int -ACE_SSL_SOCK_Connector::complete (ACE_SSL_SOCK_Stream &new_stream, - ACE_Addr *remote_sap, - const ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::complete"); - - // Take into account the time to complete the basic TCP handshake - // and the SSL handshake. - ACE_Time_Value time_copy; - ACE_Countdown_Time countdown (&time_copy); - if (tv != 0) - { - time_copy += *tv; - countdown.start (); - } - - // Only attempt to complete the TCP connection if it that hasn't - // already been done. - ACE_INET_Addr raddr; - if (new_stream.peer ().get_remote_addr (raddr) != 0 - && this->connector_.complete (new_stream.peer (), - remote_sap, - tv) == -1) - return -1; - - // The handle in the SSL_SOCK_Stream should have already been set in - // the connect() method. - - // If using a timeout, update the countdown timer to reflect the time - // spent on the connect itself, then pass the remaining time to - // ssl_connect to bound the time on the handshake. - if (tv != 0) - { - countdown.update (); - tv = &time_copy; - } - - if (this->ssl_connect (new_stream, tv) == -1) - { - new_stream.close (); - return -1; - } - - return 0; - -} - - -ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector ( - ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - const ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms) - : connector_ () -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector"); - this->connect (new_stream, - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms); -} - -ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector ( - ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - const ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int perms) - : connector_ () -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector"); - - this->connect (new_stream, - remote_sap, - qos_params, - timeout, - local_sap, - protocolinfo, - g, - flags, - reuse_addr, - perms); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_SOCK_Connector.h b/deps/acelite/ace/SSL/SSL_SOCK_Connector.h deleted file mode 100644 index 4c862c9fb..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK_Connector.h +++ /dev/null @@ -1,316 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file SSL_SOCK_Connector.h - * - * @author Ossama Othman - * @author Carlos O'Ryan - * @author John Heitmann - * @author Chris Zimman - */ -//============================================================================= - - -#ifndef ACE_SSL_SOCK_CONNECTOR_H -#define ACE_SSL_SOCK_CONNECTOR_H - -#include /**/ "ace/pre.h" - -#include "SSL_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "SSL_SOCK_Stream.h" - -#include "ace/SOCK_Connector.h" -#include "ace/OS_QoS.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_SSL_SOCK_Connector - * - * @brief Defines a factory that creates new s - * actively. - * - * The ACE_SSL_SOCK_Connector doesn't have a socket of its own, - * i.e., it simply "borrows" the one from the ACE_SSL_SOCK_Stream - * that's being connected. The reason for this is that the - * underlying socket API doesn't use a "factory" socket to connect - * "data-mode" sockets. Therefore, there's no need to inherit - * ACE_SSL_SOCK_Connector from ACE_SSL_SOCK. - * - * Since SSL is record-oriented, some additional work is done after - * the plain socket is connected. - * - * @note The user must currently ensure that only one thread services - * a given SSL session at any given time since some underlying - * SSL implementations, such as OpenSSL, are not entirely - * thread-safe or reentrant. - */ -class ACE_SSL_Export ACE_SSL_SOCK_Connector -{ - -public: - - /// Default constructor. - ACE_SSL_SOCK_Connector (void); - - /** - * Actively connect to a peer, producing a connected @c ACE_SSL_SOCK_Stream - * object if the connection succeeds. This method performs both the - * initial socket connect and the SSL handshake. - * - * @param new_stream The @c ACE_SSL_SOCK_Stream object that will be - * connected to the peer. - * @param remote_sap The address that we are trying to connect to. - * The protocol family of @c remote_sap is used for - * the connected socket. That is, if @c remote_sap - * contains an IPv6 address, a socket with family - * PF_INET6 will be used, else it will be PF_INET. - * @param timeout Pointer to an @c ACE_Time_Value object with amount - * of time to wait to connect. If the pointer is 0 - * then the call blocks until the connection attempt - * is complete, whether it succeeds or fails. If - * *timeout == {0, 0} then the connection is done - * using nonblocking mode. In this case, if the - * connection can't be made immediately, this method - * returns -1 and errno == EWOULDBLOCK. - * If *timeout > {0, 0} then this is the maximum amount - * of time to wait before timing out; if the specified - * amount of time passes before the connection is made, - * this method returns -1 and errno == ETIME. Note - * the difference between this case and when a blocking - * connect is attempted that TCP times out - in the latter - * case, errno will be ETIMEDOUT. - * @param local_sap (optional) The local address to bind to. If it's - * the default value of @c ACE_Addr::sap_any then the - * OS will choose an unused port. - * @param reuse_addr (optional) If the value is 1, the local address - * (@c local_sap) is reused, even if it hasn't been - * cleaned up yet. - * @param flags Ignored. - * @param perms Ignored. - * - * @return Returns 0 if the connection succeeds. If it fails, - * -1 is returned and errno contains a specific error - * code. - */ - ACE_SSL_SOCK_Connector (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - const ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0); - - /** - * Actively connect to a peer, producing a connected @c ACE_SSL_SOCK_Stream - * object if the connection succeeds. This method performs both the - * initial socket connect and the SSL handshake. - * - * @param new_stream The @c ACE_SSL_SOCK_Stream object that will be - * connected to the peer. - * @param remote_sap The address that we are trying to connect to. - * The protocol family of @c remote_sap is used for - * the connected socket. That is, if @c remote_sap - * contains an IPv6 address, a socket with family - * PF_INET6 will be used, else it will be PF_INET. - * @param qos_params Contains QoS parameters that are passed to the - * IntServ (RSVP) and DiffServ protocols. - * @see ACE_QoS_Params. - * @param timeout Pointer to an @c ACE_Time_Value object with amount - * of time to wait to connect. If the pointer is 0 - * then the call blocks until the connection attempt - * is complete, whether it succeeds or fails. If - * *timeout == {0, 0} then the connection is done - * using nonblocking mode. In this case, if the - * connection can't be made immediately, this method - * returns -1 and errno == EWOULDBLOCK. - * If *timeout > {0, 0} then this is the maximum amount - * of time to wait before timing out; if the specified - * amount of time passes before the connection is made, - * this method returns -1 and errno == ETIME. Note - * the difference between this case and when a blocking - * connect is attempted that TCP times out - in the latter - * case, errno will be ETIMEDOUT. - * @param local_sap (optional) The local address to bind to. If it's - * the default value of @c ACE_Addr::sap_any then the - * OS will choose an unused port. - * @param reuse_addr (optional) If the value is 1, the local address - * (@c local_sap) is reused, even if it hasn't been - * cleaned up yet. - * @param flags Ignored. - * @param perms Ignored. - * - * @return Returns 0 if the connection succeeds. If it fails, - * -1 is returned and errno contains a specific error - * code. - */ - ACE_SSL_SOCK_Connector (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - const ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0, - int perms = 0); - - /// Default dtor. - ~ACE_SSL_SOCK_Connector (void); - - /** - * Actively connect to a peer, producing a connected @c ACE_SSL_SOCK_Stream - * object if the connection succeeds. This method performs both the - * initial socket connect and the SSL handshake. - * - * @param new_stream The @c ACE_SSL_SOCK_Stream object that will be - * connected to the peer. - * @param remote_sap The address that we are trying to connect to. - * The protocol family of @c remote_sap is used for - * the connected socket. That is, if @c remote_sap - * contains an IPv6 address, a socket with family - * PF_INET6 will be used, else it will be PF_INET. - * @param timeout Pointer to an @c ACE_Time_Value object with amount - * of time to wait to connect. If the pointer is 0 - * then the call blocks until the connection attempt - * is complete, whether it succeeds or fails. If - * *timeout == {0, 0} then the connection is done - * using nonblocking mode. In this case, if the - * connection can't be made immediately, this method - * returns -1 and errno == EWOULDBLOCK. - * If *timeout > {0, 0} then this is the maximum amount - * of time to wait before timing out; if the specified - * amount of time passes before the connection is made, - * this method returns -1 and errno == ETIME. Note - * the difference between this case and when a blocking - * connect is attempted that TCP times out - in the latter - * case, errno will be ETIMEDOUT. - * @param local_sap (optional) The local address to bind to. If it's - * the default value of @c ACE_Addr::sap_any then the - * OS will choose an unused port. - * @param reuse_addr (optional) If the value is 1, the local address - * (@c local_sap) is reused, even if it hasn't been - * cleaned up yet. - * @param flags Ignored. - * @param perms Ignored. - * - * @return Returns 0 if the connection succeeds. If it fails, - * -1 is returned and errno contains a specific error - * code. - */ - int connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - const ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0); - - /** - * Actively connect to a peer, producing a connected @c ACE_SSL_SOCK_Stream - * object if the connection succeeds. This method performs both the - * initial socket connect and the SSL handshake. - * - * @param new_stream The @c ACE_SSL_SOCK_Stream object that will be - * connected to the peer. - * @param remote_sap The address that we are trying to connect to. - * The protocol family of @c remote_sap is used for - * the connected socket. That is, if @c remote_sap - * contains an IPv6 address, a socket with family - * PF_INET6 will be used, else it will be PF_INET. - * @param qos_params Contains QoS parameters that are passed to the - * IntServ (RSVP) and DiffServ protocols. - * @see ACE_QoS_Params. - * @param timeout Pointer to an @c ACE_Time_Value object with amount - * of time to wait to connect. If the pointer is 0 - * then the call blocks until the connection attempt - * is complete, whether it succeeds or fails. If - * *timeout == {0, 0} then the connection is done - * using nonblocking mode. In this case, if the - * connection can't be made immediately, this method - * returns -1 and errno == EWOULDBLOCK. - * If *timeout > {0, 0} then this is the maximum amount - * of time to wait before timing out; if the specified - * amount of time passes before the connection is made, - * this method returns -1 and errno == ETIME. Note - * the difference between this case and when a blocking - * connect is attempted that TCP times out - in the latter - * case, errno will be ETIMEDOUT. - * @param local_sap (optional) The local address to bind to. If it's - * the default value of @c ACE_Addr::sap_any then the - * OS will choose an unused port. - * @param reuse_addr (optional) If the value is 1, the local address - * (@c local_sap) is reused, even if it hasn't been - * cleaned up yet. - * @param flags Ignored. - * @param perms Ignored. - * - * @return Returns 0 if the connection succeeds. If it fails, - * -1 is returned and errno contains a specific error - * code. - */ - int connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - const ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0, - int perms = 0); - - /** - * Try to complete a non-blocking connection. - * If connection completion is successful then contains - * the connected ACE_SSL_SOCK_Stream. If is non-NULL - * then it will contain the address of the connected peer. - */ - int complete (ACE_SSL_SOCK_Stream &new_stream, - ACE_Addr *remote_sap = 0, - const ACE_Time_Value *timeout = 0); - - /// Resets any event associations on this handle - bool reset_new_handle (ACE_HANDLE handle); - - /// Meta-type info - //@{ - typedef ACE_INET_Addr PEER_ADDR; - typedef ACE_SSL_SOCK_Stream PEER_STREAM; - //@} - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - - /// Complete non-blocking SSL active connection. - int ssl_connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Time_Value *timeout); - -private: - - /// The class that does all of the non-secure socket connection. - /// It is default contructed, and subsequently used by connect(). - ACE_SOCK_Connector connector_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "SSL_SOCK_Connector.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SSL_SOCK_CONNECTOR_H */ diff --git a/deps/acelite/ace/SSL/SSL_SOCK_Connector.inl b/deps/acelite/ace/SSL/SSL_SOCK_Connector.inl deleted file mode 100644 index 0dd4bb62e..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK_Connector.inl +++ /dev/null @@ -1,25 +0,0 @@ -// -*- C++ -*- -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector (void) - : connector_ () -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector"); -} - -ACE_INLINE bool -ACE_SSL_SOCK_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::reset_new_handle"); - return this->connector_.reset_new_handle (handle); -} - -ACE_INLINE void -ACE_SSL_SOCK_Connector::dump (void) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::dump"); - this->connector_.dump (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_SOCK_Stream.cpp b/deps/acelite/ace/SSL/SSL_SOCK_Stream.cpp deleted file mode 100644 index 7ad901d12..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK_Stream.cpp +++ /dev/null @@ -1,584 +0,0 @@ -#include "ace/Handle_Set.h" -#include "ace/Log_Category.h" -#include "ace/Countdown_Time.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_sys_select.h" -#include "ace/OS_Memory.h" - -#include - -#include "SSL_SOCK_Stream.h" - -#if !defined (__ACE_INLINE__) -#include "SSL_SOCK_Stream.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_SSL_SOCK_Stream) - -ACE_SSL_SOCK_Stream::ACE_SSL_SOCK_Stream (ACE_SSL_Context *context) - : ssl_ (0), - stream_ () -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::ACE_SSL_SOCK_Stream"); - - ACE_SSL_Context * ctx = - (context == 0 ? ACE_SSL_Context::instance () : context); - - this->ssl_ = ::SSL_new (ctx->context ()); - - if (this->ssl_ == 0) - { - ACELIB_ERROR ((LM_ERROR, - "(%P|%t) ACE_SSL_SOCK_Stream " - "- cannot allocate new SSL structure %p\n", - ACE_TEXT (""))); - } -} - -ACE_SSL_SOCK_Stream::~ACE_SSL_SOCK_Stream (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::~ACE_SSL_SOCK_Stream"); - - ::SSL_free (this->ssl_); - - // @@ Question: should we reference count the Context object or - // leave that to the application developer? We do not reference - // count reactors (for example) and following some simple rules - // seems to work fine! -} - -ssize_t -ACE_SSL_SOCK_Stream::sendv (const iovec iov[], - size_t n, - const ACE_Time_Value *max_wait_time) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::sendv"); - - // There is subtle problem in this method that occurs when using - // non-blocking IO. The semantics of a non-blocking scatter write - // (sendv()) are not possible to retain with the emulation in this - // method. - - ssize_t bytes_sent = 0; - - ACE_Time_Value t; - ACE_Time_Value *timeout = const_cast (max_wait_time); - - if (max_wait_time != 0) - { - // Make a copy since ACE_Countdown_Time modifies the - // ACE_Time_Value. - t = *max_wait_time; - timeout = &t; - } - - // Take into account the time between each send. - ACE_Countdown_Time countdown (timeout); - - for (size_t i = 0; i < n; ++i) - { - ssize_t const result = this->send (iov[i].iov_base, - iov[i].iov_len, - timeout); - - if (result == -1) - { - // There is a subtle difference in behaviour depending on - // whether or not any data was sent. If no data was sent, - // then always return -1. Otherwise return bytes_sent. - // This gives the caller an opportunity to keep track of - if (bytes_sent > 0) - break; - else - return -1; - } - else - { - bytes_sent += result; - - // Do not continue on to the next loop iteration if the - // amount of data sent was less than the amount data given. - // This avoids a subtle problem where "holes" in the data - // stream would occur if partial sends of a given buffer in - // the iovec array occured. - if (static_cast (result) < static_cast (iov[i].iov_len)) - break; - } - - (void) countdown.update (); - } - - return bytes_sent; -} - -ssize_t -ACE_SSL_SOCK_Stream::recvv (iovec *io_vec, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recvv"); - - // From ACE_SOCK_IO::recvv(). -#if defined (FIONREAD) - ACE_Handle_Set handle_set; - handle_set.reset (); - handle_set.set_bit (this->get_handle ()); - - io_vec->iov_base = 0; - - // Check the status of the current socket. - switch ( - ACE_OS::select (int (this->get_handle ()) + 1, - handle_set, - 0, - 0, - timeout)) - { - case -1: - return -1; - /* NOTREACHED */ - case 0: - errno = ETIME; - return -1; - /* NOTREACHED */ - default: - // Goes fine, fallthrough to get data - break; - } - - int inlen; - - if (ACE_OS::ioctl (this->get_handle (), - FIONREAD, - &inlen) == -1) - return -1; - else if (inlen > 0) - { - ACE_NEW_RETURN (io_vec->iov_base, - char[inlen], - -1); - io_vec->iov_len = this->recv (io_vec->iov_base, - inlen); - return io_vec->iov_len; - } - else - return 0; -#else - ACE_UNUSED_ARG (io_vec); - ACE_UNUSED_ARG (timeout); - ACE_NOTSUP_RETURN (-1); -#endif /* FIONREAD */ -} - -ssize_t -ACE_SSL_SOCK_Stream::send (const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send"); - - // If SSL has data in the buffer, i.e. SSL_pending() returns a - // non-zero value, then don't block on select(). - if (timeout == 0 || ::SSL_pending (this->ssl_)) - return this->send (buf, len, flags); - - int val = 0; - if (ACE::enter_send_timedwait (this->get_handle (), - timeout, - val) == -1) - return -1; - - ssize_t const bytes_transferred = this->send (buf, len, flags); - - ACE::restore_non_blocking_mode (this->get_handle (), val); - - return bytes_transferred; -} - -ssize_t -ACE_SSL_SOCK_Stream::recv (void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv"); - - return this->recv_i (buf, n, flags, timeout); -} - - -ssize_t -ACE_SSL_SOCK_Stream::send (size_t n, ...) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send"); - - size_t const total_tuples = n / 2; - - va_list argp; - va_start (argp, n); - - ssize_t bytes_sent = 0; - - // NOTE: This method used to fill an IO vector (e.g. iovec) and then - // send it using a scatter write (sendv()). However, it is - // not possible to emulate a non-blocking scatter write over - // SSL. As such, there is no point in attempting to use - // scatter writes over SSL. - for (size_t i = 0; i < total_tuples; ++i) - { - ssize_t const data_len = va_arg (argp, ssize_t); - ssize_t const result = this->send (va_arg (argp, char *), data_len); - - if (result == -1) - { - // There is a subtle difference in behaviour depending on - // whether or not any data was sent. If no data was sent, - // then always return -1. Otherwise return bytes_sent. - // This gives the caller an opportunity to keep track of - // which data was actually sent. - if (bytes_sent > 0) - break; - else - { - va_end (argp); - return -1; - } - } - else - { - bytes_sent += result; - - // Do not continue on to the next loop iteration if the - // amount of data sent was less than the amount of data - // given. This avoids a subtle problem where "holes" in the - // data stream would occur if partial sends of a given - // buffer in the varargs occured. - if (result < data_len) - break; - - } - } - - va_end (argp); - - return bytes_sent; -} - -ssize_t -ACE_SSL_SOCK_Stream::recv (size_t n, ...) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv"); - - size_t const total_tuples = n / 2; - - va_list argp; - va_start (argp, n); - - ssize_t bytes_recv = 0; - - for (size_t i = 0; i < total_tuples; ++i) - { - ssize_t const data_len = va_arg (argp, ssize_t); - ssize_t const result = this->recv (va_arg (argp, char *), data_len); - - if (result == -1) - { - // There is a subtle difference in behaviour depending on - // whether or not any data was received. If no data was - // received, then always return -1. Otherwise return - // bytes_received. This gives the caller an opportunity to - // keep track of which data was actually received. - if (bytes_recv > 0) - { - break; - } - else - { - va_end (argp); - return -1; - } - } - else - { - bytes_recv += result; - - // Do not continue on to the next loop iteration if the - // amount of data received was less than the amount of data - // desired. This avoids a subtle problem where "holes" in - // the data stream would occur if partial receives of a - // given buffer in the varargs occured. - if (result < data_len) - { - break; - } - } - } - - va_end (argp); - - return bytes_recv; -} - -ssize_t -ACE_SSL_SOCK_Stream::send_n (const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bt) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send_n"); - - // No support for send flags in SSL. - if (flags != 0) - { - ACE_NOTSUP_RETURN (-1); - } - - /* This code mimics ACE::send_n */ - // Total number of bytes written. - size_t temp = 0; - size_t &bytes_transferred = ((bt == 0) ? temp : *bt); - - // Actual number of bytes written in each attempt - ssize_t n = 0; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - n = this->send ((const char*) buf + bytes_transferred, - len - bytes_transferred, - flags, - timeout); - - if (n < 0) - { - if (errno == EWOULDBLOCK) - { - // If blocked, try again. - n = 0; - continue; - } - else - { - return -1; - } - } - else if (n == 0) - { - break; - } - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE_SSL_SOCK_Stream::recv_n (void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bt) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_n"); - - if (flags != 0) - { - if ((flags | MSG_PEEK) != MSG_PEEK) - { - ACE_NOTSUP_RETURN (-1); - } - } - - size_t temp = 0; - size_t &bytes_transferred = ((bt == 0) ? temp : *bt); - - ssize_t n = 0; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - n = this->recv ((char*) buf + bytes_transferred, - len - bytes_transferred, - flags, - timeout); - - if (n < 0) - return -1; - else if (n == 0) - break; - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE_SSL_SOCK_Stream::recv_n (void *buf, int len, int flags) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_n"); - - if (flags != 0) - { - if ((flags | MSG_PEEK) != MSG_PEEK) - { - ACE_NOTSUP_RETURN (-1); - } - } - - ssize_t bytes_transferred = 0; - ssize_t n = 0; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - n = this->recv ((char*) buf + bytes_transferred, - len - bytes_transferred, - flags); - - if (n < 0) - return -1; - else if (n == 0) - break; - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE_SSL_SOCK_Stream::send_n (const void *buf, int len, int flags) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send_n"); - - // Send flags are unsupported in SSL - if (flags != 0) - { - ACE_NOTSUP_RETURN (-1); - } - - /* The following code mimics */ - size_t bytes_transferred = 0; - ssize_t n = 0; - - for (bytes_transferred = 0; - bytes_transferred < (size_t) len; - bytes_transferred += n) - { - n = this->send ((const char*) buf + bytes_transferred, - len - bytes_transferred, - flags); - if (n < 0) - return -1; - else if (n == 0) - break; - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE_SSL_SOCK_Stream::sendv_n (const iovec iov[], size_t iovcnt) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::sendv_n"); - - ssize_t bytes_sent = 0; - - for (size_t i = 0; i < iovcnt; ++i) - { - ssize_t result = this->send_n (iov[i].iov_base, - iov[i].iov_len); - - - if (result == -1) - { - // There is a subtle difference in behaviour depending on - // whether or not any data was sent. If no data was sent, - // then always return -1. Otherwise return bytes_sent. - // This gives the caller an opportunity to keep track of - // which data was actually sent. - if (bytes_sent > 0) - { - break; - } - else - { - return -1; - } - } - else - { - bytes_sent += result; - } - } - - return bytes_sent; -} - -ssize_t -ACE_SSL_SOCK_Stream::recvv_n (iovec iov[], size_t iovcnt) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recvv_n"); - - ssize_t bytes_read = 0; - - for (size_t i = 0; i < iovcnt; ++i) - { - ssize_t const result = this->recv_n (iov[i].iov_base, - iov[i].iov_len); - - if (result == -1) - { - // There is a subtle difference in behaviour depending on - // whether or not any data was read. If no data was read, - // then always return -1. Otherwise return bytes_read. - // This gives the caller an opportunity to keep track of - // which data was actually read. - if (bytes_read > 0) - { - break; - } - else - { - return -1; - } - } - else - { - bytes_read += result; - } - } - - return bytes_read; -} - -int -ACE_SSL_SOCK_Stream::get_remote_addr (ACE_Addr &addr) const -{ - // Some applications use get_remote_addr() as a way of determining - // whether or not a connection has been established. In SSL's case, - // the remote addr will be available once the TCP handshake has been - // complete. Despite that fact, the SSL connection may not have - // been completed. In such a case, a successful return from - // get_remote_addr() would be misleading. - - if (SSL_is_init_finished (this->ssl_)) - { - return this->ACE_SSL_SOCK::get_remote_addr (addr); - } - - if (this->get_handle () == ACE_INVALID_HANDLE) - { - errno = EBADF; - } - else - { - errno = ENOTCONN; - } - - return -1; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/SSL_SOCK_Stream.h b/deps/acelite/ace/SSL/SSL_SOCK_Stream.h deleted file mode 100644 index c9a54fe98..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK_Stream.h +++ /dev/null @@ -1,346 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file SSL_SOCK_Stream.h - * - * @author Ossama Othman - * @author Carlos O'Ryan - * @author John Heitmann - */ -//============================================================================= - - -#ifndef ACE_SSL_SOCK_STREAM_H -#define ACE_SSL_SOCK_STREAM_H - -#include /**/ "ace/pre.h" - -#include "SSL_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// This must be included before any include on LynxOS -#include "ace/os_include/os_stdio.h" - -#include - -#include "SSL_SOCK.h" -#include "SSL_Context.h" - -#include "ace/SOCK_Stream.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_SSL_SOCK_Stream - * - * @brief Defines methods in the ACE_SSL_SOCK_Stream abstraction. - * - * This class encapsulates the methods and functionality necessary to - * send and receive data over TLS/SSL. - * @par - * Since SSL is record-oriented, some additional steps must be taken - * to make the ACE_SSL_SOCK_Stream interact properly with the - * Reactor (if one is used) when performing non-blocking IO. In - * particular, if ::SSL_pending (ssl), where "ssl" is a pointer to the - * SSL data structure returned from ACE_SSL_SOCK_Stream::ssl(), - * returns a non-zero value then the event handler that calls the IO - * methods in this class should return a value greater than zero to - * force the Reactor to invoke the event handler before polling for - * additional events (e.g. blocking on select()). - * - * @note The user must currently ensure that only one thread services - * a given SSL session at any given time since underlying SSL - * implementations, such as OpenSSL, are not entirely - * thread-safe or reentrant. - */ -class ACE_SSL_Export ACE_SSL_SOCK_Stream : public ACE_SSL_SOCK -{ -public: - - /// Constructor - /** - * @param context Pointer to @c ACE_SSL_Context instance containing - * the OpenSSL @c SSL data structure to be associated - * with this @c ACE_SSL_SOCK_Stream. The @c SSL data - * structure will be copied to make it at least - * logically independent of the supplied @a context. - */ - ACE_SSL_SOCK_Stream (ACE_SSL_Context *context = - ACE_SSL_Context::instance ()); - - /// Destructor - ~ACE_SSL_SOCK_Stream (void); - - /// Send an n byte buffer to the ssl socket using the semantics of - /// send(3n). - /** - * ACE_SSL supports no flags for sending at this time. - */ - ssize_t send (const void *buf, - size_t n, - int flags) const; - - /// Recv an n byte buffer from the ssl socket using the semantics of - /// recv(3n). - /** - * ACE_SSL supports MSG_PEEK, but no other flags at this time. - */ - ssize_t recv (void *buf, - size_t n, - int flags) const; - - /// Send an n byte buffer to the ssl socket using the semantics of - /// write(2). - ssize_t send (const void *buf, - size_t n) const; - - /// Recv an n byte buffer from the ssl socket using the semantics of - /// read(2). - ssize_t recv (void *buf, - size_t n) const; - - /// Send an iovec of size n to the ssl socket. - /** - * Note that it is not possible to perform a "scattered" write with - * the underlying OpenSSL implementation. As such, the expected - * semantics are not fully reproduced with this implementation. - */ - ssize_t sendv (const iovec iov[], - size_t n, - const ACE_Time_Value *timeout = 0) const; - - /** - * Allows a client to read from a socket without having to provide a - * buffer to read. This method determines how much data is in the - * socket, allocates a buffer of this size, reads in the data, and - * returns the number of bytes read. The caller is responsible for - * deleting the member in the iov_base field of io_vec using - * delete [] io_vec->iov_base. - */ - ssize_t recvv (iovec *io_vec, - const ACE_Time_Value *timeout = 0) const; - - /** - * Wait to timeout amount of time to send up to n bytes into buf - * (uses the send() call). If send() times out -1 is returned with - * errno == ETIME. If it succeeds the number of bytes sent is - * returned. No flags are supported. - */ - ssize_t send (const void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) const; - - /** - * Wait up to timeout amount of time to receive up to n bytes into - * buf (uses the recv() call). If recv() times out -1 is returned - * with errno == ETIME. If it succeeds the number of bytes received - * is returned. MSG_PEEK is the only supported flag. - */ - ssize_t recv (void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) const; - - /** - * Wait to to timeout amount of time to send up to n bytes into - * buf (uses the send() call). If send() times out - * a -1 is returned with errno == ETIME. If it succeeds the - * number of bytes sent is returned. - */ - ssize_t send (const void *buf, - size_t n, - const ACE_Time_Value *timeout) const; - - /** - * Wait up to timeout amount of time to receive up to n bytes - * into buf (uses the recv() call). If recv() times - * out a -1 is returned with @c errno == ETIME. If it succeeds the - * number of bytes received is returned. - */ - ssize_t recv (void *buf, - size_t n, - const ACE_Time_Value *timeout) const; - - /// Send n varargs messages to the connected ssl socket. - ssize_t send (size_t n, - ...) const; - - /// Recv n varargs messages to the connected ssl socket. - ssize_t recv (size_t n, - ...) const; - - /// Send n bytes, keep trying until n are sent. - ssize_t send_n (const void *buf, int n) const; - - /// Recv n bytes, keep trying until n are received. - ssize_t recv_n (void *buf, int n) const; - - /** - * @note In the following four methods, only MSG_PEEK is supported - * for recv_n(), and no flags are supported for send_n(). - */ - //@{ - /// Send n bytes, keep trying until n are sent. - ssize_t send_n (const void *buf, int n, int flags) const; - - /// Recv n bytes, keep trying until n are sent. - ssize_t recv_n (void *buf, int n, int flags) const; - - /** - * Try to send exactly len bytes into buf (uses the send() call). - * If send() blocks for longer than timeout the number of bytes - * actually sent is returned with errno == ETIME. If a timeout does - * not occur, send_n() return len (i.e., the number of bytes - * requested to be sent). - */ - ssize_t send_n (const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred = 0) const; - - /** - * Try to send exactly len bytes into buf (uses the send() call). - * If send() blocks for longer than timeout the number of bytes - * actually sent is returned with errno == ETIME. If a timeout does - * not occur, send_n() return len (i.e., the number of bytes - * requested to be sent). - */ - ssize_t send_n (const void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred = 0) const; - - /** - * Try to receive exactly len bytes into buf (uses the recv() call). - * The ACE_Time_Value indicates how long to blocking trying to - * receive. If timeout == 0, the caller will block until action is - * possible, else will wait until the relative time specified in - * timeout elapses). If recv() blocks for longer than timeout the - * number of bytes actually read is returned with errno == ETIME. - * If a timeout does not occur, recv_n return len (i.e., the number - * of bytes requested to be read). - */ - ssize_t recv_n (void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred = 0) const; - - /** - * Try to receive exactly len bytes into buf (uses the recv() call). - * The ACE_Time_Value indicates how long to blocking trying to - * receive. If timeout == 0, the caller will block until action is - * possible, else will wait until the relative time specified in - * timeout elapses). If recv() blocks for longer than timeout the - * number of bytes actually read is returned with errno == ETIME. - * If a timeout does not occur, recv_n return len (i.e., the number - * of bytes requested to be read). - */ - ssize_t recv_n (void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred = 0) const; - //@} - - /** - * Send an iovec of size n to the connected socket. Will block - * until all bytes are sent or an error occurs. - */ - ssize_t sendv_n (const iovec iov[], - size_t n) const; - - /// Receive an iovec of size n to the connected socket. - ssize_t recvv_n (iovec iov[], - size_t n) const; - - - /** - * Selectively close endpoints. - */ - //@{ - /// Close down the reader. - int close_reader (void); - - /// Close down the writer. - int close_writer (void); - //@} - - ///Close down the socket. - int close (void); - - /// Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /// Overridden set_handle() method. - /** - * Only an ACE_SSL_SOCK_Acceptor or ACE_SSL_SOCK_Connector should - * access this method since some state in the underlying "ssl_" data - * structure is set during SSL connection establishment. - */ - void set_handle (ACE_HANDLE fd); - - /// Return a pointer to the underlying SSL structure. - SSL *ssl (void) const; - - /** - * Return the address of the remotely connected peer (if there is - * one), in the referenced . Returns 0 if successful, else - * -1. - * - * @note If the TCP connection has been completed but the SSL - * connection has not been completed yet, -1 will be - * returned. - */ - int get_remote_addr (ACE_Addr &) const; - - /// Return the underlying ACE_SOCK_Stream which ACE_SSL runs atop of. - ACE_SOCK_Stream & peer (void); - -protected: - - /// Underlying send() helper method common to all public send() - /// methods. - ssize_t send_i (const void *buf, - size_t n, - int flags) const; - - /// Underlying send() helper method common to all public send() - /// methods. - ssize_t recv_i (void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) const; - -private: - - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_SSL_SOCK_Stream &)) - ACE_UNIMPLEMENTED_FUNC (ACE_SSL_SOCK_Stream (const ACE_SSL_SOCK_Stream &)) - -protected: - - /// The SSL session. - SSL *ssl_; - - /// The stream which works under the ssl connection. - ACE_SOCK_Stream stream_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "SSL_SOCK_Stream.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SSL_SOCK_STREAM_H */ diff --git a/deps/acelite/ace/SSL/SSL_SOCK_Stream.inl b/deps/acelite/ace/SSL/SSL_SOCK_Stream.inl deleted file mode 100644 index 10ab1c2ff..000000000 --- a/deps/acelite/ace/SSL/SSL_SOCK_Stream.inl +++ /dev/null @@ -1,364 +0,0 @@ -// -*- C++ -*- -#include "ace/OS_NS_errno.h" -#include "ace/Truncate.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void -ACE_SSL_SOCK_Stream::set_handle (ACE_HANDLE fd) -{ - if (this->ssl_ == 0 || fd == ACE_INVALID_HANDLE) - { - this->ACE_SSL_SOCK::set_handle (ACE_INVALID_HANDLE); - return; - } - else - { - (void) ::SSL_set_fd (this->ssl_, (int) fd); - this->ACE_SSL_SOCK::set_handle (fd); - this->stream_.set_handle (fd); - } -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::send_i (const void *buf, - size_t n, - int flags) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send_i"); - - // NOTE: Caller must provide thread-synchronization. - - // No send flags are supported in SSL. - if (flags != 0) - { - ACE_NOTSUP_RETURN (-1); - } - - int const bytes_sent = ::SSL_write (this->ssl_, - static_cast (buf), - ACE_Utils::truncate_cast (n)); - - switch (::SSL_get_error (this->ssl_, bytes_sent)) - { - case SSL_ERROR_NONE: - return bytes_sent; - - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - errno = EWOULDBLOCK; - - return -1; - - case SSL_ERROR_ZERO_RETURN: - // The peer has notified us that it is shutting down via the SSL - // "close_notify" message so we need to shutdown, too. - (void) ::SSL_shutdown (this->ssl_); - - return bytes_sent; - - case SSL_ERROR_SYSCALL: - if (bytes_sent == 0) - // An EOF occured but the SSL "close_notify" message was not - // sent. This is a protocol error, but we ignore it. - return 0; - - // If not an EOF, then fall through to "default" case. - - // On some platforms (e.g. MS Windows) OpenSSL does not store - // the last error in errno so explicitly do so. - ACE_OS::set_errno_to_last_error (); - - break; - - default: - // Reset errno to prevent previous values (e.g. EWOULDBLOCK) - // from being associated with fatal SSL errors. - errno = 0; - - ACE_SSL_Context::report_error (); - - break; - } - - return -1; -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::send (const void *buf, - size_t n, - int flags) const -{ - return this->send_i (buf, n, flags); -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv_i (void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_i"); - - // NOTE: Caller must provide thread-synchronization. - - int bytes_read = 0; - ACE_HANDLE const handle = this->get_handle (); - - // Value for current I/O mode (blocking/non-blocking) - int val = 0; - - if (timeout != 0) - ACE::record_and_set_non_blocking_mode (handle, - val); - - // Only block to wait for I/O ready with a timeout if all on-hand data - // has been consumed. If there is remaining data in the SSL buffers - // the socket won't "select" even though SSL_read would complete. - // See "SSL and TLS" by Rescorla section 8.9 for more info. - bool peeking = false; - bool retry = false; - if (flags) - { - if (ACE_BIT_ENABLED (flags, MSG_PEEK)) - { - peeking = true; - } - else - { - ACE_NOTSUP_RETURN (-1); - } - } - - do - { - retry = false; - if (peeking) - { - bytes_read = ::SSL_peek (this->ssl_, - static_cast (buf), - ACE_Utils::truncate_cast (n)); - } - else - { - bytes_read = ::SSL_read (this->ssl_, - static_cast (buf), - ACE_Utils::truncate_cast (n)); - } - - int const status = ::SSL_get_error (this->ssl_, bytes_read); - int substat = 0; - switch (status) - { - case SSL_ERROR_NONE: - break; - - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - if (timeout == 0) - { - errno = EWOULDBLOCK; - bytes_read = -1; - break; - } - substat = ACE::handle_ready (handle, - timeout, - status == SSL_ERROR_WANT_READ, - status == SSL_ERROR_WANT_WRITE, - 0); - if (substat == 1) // Now ready to proceed - { - retry = true; - break; - } - bytes_read = -1; - if (substat == 0) - errno = ETIME; - break; - - case SSL_ERROR_ZERO_RETURN: - bytes_read = 0; - - // The peer has notified us that it is shutting down via the SSL - // "close_notify" message so we need to shutdown, too. - (void) ::SSL_shutdown (this->ssl_); - - break; - - case SSL_ERROR_SYSCALL: - if (bytes_read == 0) - // An EOF occured but the SSL "close_notify" message was not - // sent. This is a protocol error, but we ignore it. - break; - - // On some platforms (e.g. MS Windows) OpenSSL does not store - // the last error in errno so explicitly do so. - ACE_OS::set_errno_to_last_error (); - - break; - - default: - // Reset errno to prevent previous values (e.g. EWOULDBLOCK) - // from being associated with a fatal SSL error. - bytes_read = -1; - errno = 0; - - ACE_SSL_Context::report_error (); - - break; - } - } while (retry); - - if (timeout != 0) - ACE::restore_non_blocking_mode (handle, val); - return bytes_read; -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv (void *buf, - size_t n, - int flags) const -{ - return this->recv_i (buf, n, flags, 0); -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::send (const void *buf, - size_t n) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send"); - - return this->send_i (buf, n, 0); -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv (void *buf, - size_t n) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv"); - - return this->recv_i (buf, n, 0, 0); -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::send (const void *buf, - size_t len, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send"); - return this->send (buf, len, 0, timeout); -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv (void *buf, - size_t n, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv"); - return this->recv (buf, n, 0, timeout); -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv_n (void *buf, int buf_size) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_n"); - return this->recv_n (buf, buf_size, 0); -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv_n (void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_n"); - return this->recv_n (buf, len, 0, timeout, bytes_transferred); -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::send_n (const void *buf, int len) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send_n"); - return this->send_n (buf, len, 0); -} - -ACE_INLINE ssize_t -ACE_SSL_SOCK_Stream::send_n (const void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send_n"); - return this->send_n (buf, len, 0, timeout, bytes_transferred); -} - -ACE_INLINE int -ACE_SSL_SOCK_Stream::close_reader (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::close_reader"); - return this->stream_.close_reader (); -} - -ACE_INLINE int -ACE_SSL_SOCK_Stream::close_writer (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::close_writer"); - return this->stream_.close_writer (); -} - -ACE_INLINE int -ACE_SSL_SOCK_Stream::close (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::close"); - - if (this->ssl_ == 0 || this->get_handle () == ACE_INVALID_HANDLE) - return 0; // SSL_SOCK_Stream was never opened. - - // SSL_shutdown() returns 1 on successful shutdown of the SSL - // connection, not 0. - int const status = ::SSL_shutdown (this->ssl_); - - switch (::SSL_get_error (this->ssl_, status)) - { - case SSL_ERROR_NONE: - case SSL_ERROR_SYSCALL: // Ignore this error condition. - - // Reset the SSL object to allow another connection to be made - // using this ACE_SSL_SOCK_Stream instance. This prevents the - // previous SSL session state from being associated with the new - // SSL session/connection. - (void) ::SSL_clear (this->ssl_); - this->set_handle (ACE_INVALID_HANDLE); - return this->stream_.close (); - - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - errno = EWOULDBLOCK; - break; - - default: - ACE_SSL_Context::report_error (); - - ACE_Errno_Guard error (errno); // Save/restore errno - (void) this->stream_.close (); - - return -1; - } - - return -1; -} - -ACE_INLINE ACE_SOCK_Stream & -ACE_SSL_SOCK_Stream::peer (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::peer"); - return this->stream_; -} - -ACE_INLINE SSL * -ACE_SSL_SOCK_Stream::ssl (void) const -{ - return this->ssl_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SSL/ssl.mpc b/deps/acelite/ace/SSL/ssl.mpc deleted file mode 100644 index 707e4e504..000000000 --- a/deps/acelite/ace/SSL/ssl.mpc +++ /dev/null @@ -1,21 +0,0 @@ -// -*- MPC -*- -project(SSL) : acelib, ace_output, install, ace_openssl { - avoids += ace_for_tao - requires += ssl - sharedname = ACE_SSL - dynamicflags += ACE_SSL_BUILD_DLL - - specific { - install_dir = ace/SSL - } - - pkgconfig_files { - ACE_SSL.pc.in - } - - specific(gnuace) { - pkgconfig_variables += ACE_TLS_CPPFLAGS=$(PLATFORM_SSL_CPPFLAGS) - pkgconfig_variables += ACE_TLS_LDFLAGS=$(PLATFORM_SSL_LDFLAGS) - pkgconfig_variables += ACE_TLS_LIBS=$(PLATFORM_SSL_LIBS) - } -} diff --git a/deps/acelite/ace/SSL/ssl_for_tao.mpc b/deps/acelite/ace/SSL/ssl_for_tao.mpc deleted file mode 100644 index c89b8c0d5..000000000 --- a/deps/acelite/ace/SSL/ssl_for_tao.mpc +++ /dev/null @@ -1,43 +0,0 @@ -// -*- MPC -*- -project(SSL_FOR_TAO) : acelib, ace_output, install, ace_openssl { - requires += ssl ace_for_tao - sharedname = ACE_SSL_FOR_TAO - dynamicflags += ACE_SSL_BUILD_DLL - - Source_Files { - SSL_Context.cpp - SSL_SOCK.cpp - SSL_SOCK_Acceptor.cpp - SSL_SOCK_Connector.cpp - SSL_SOCK_Stream.cpp - } - - Header_Files { - SSL_Context.h - SSL_Export.h - SSL_SOCK.h - SSL_SOCK_Acceptor.h - SSL_SOCK_Connector.h - SSL_SOCK_Stream.h - sslconf.h - } - - Inline_Files { - SSL_SOCK.inl - SSL_SOCK_Acceptor.inl - SSL_SOCK_Connector.inl - SSL_Context.inl - SSL_SOCK_Stream.inl - } - - Template_Files { - } - - pkgconfig_files { - ACE_SSL.pc.in - } - - specific { - install_dir = ace/SSL - } -} diff --git a/deps/acelite/ace/SSL/sslconf.h b/deps/acelite/ace/SSL/sslconf.h deleted file mode 100644 index 2dfea912b..000000000 --- a/deps/acelite/ace/SSL/sslconf.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file sslconf.h - * - * @author Carlos O'Ryan - */ -//============================================================================= - - -#ifndef ACE_SSLCONF_H -#define ACE_SSLCONF_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_DEFAULT_SSL_CERT_FILE) -// Define a default CA certificate filename here if required e.g.: -// # ifdef WIN32 -// # define ACE_DEFAULT_SSL_CERT_FILE "cert.pem" -// # else -// # define ACE_DEFAULT_SSL_CERT_FILE "/etc/ssl/cert.pem" -// # endif /* WIN32 */ -#endif /* ACE_DEFAULT_SSL_CERT_FILE */ - -#if !defined (ACE_DEFAULT_SSL_CERT_DIR) -// Define a default CA certificate files directory here if required. e.g.: -// # ifdef WIN32 -// # define ACE_DEFAULT_SSL_CERT_DIR "certs" -// # else -// # define ACE_DEFAULT_SSL_CERT_DIR "/etc/ssl/certs" -// # endif /* WIN32 */ -#endif /* ACE_DEFAULT_SSL_CERT_DIR */ - -#if !defined (ACE_SSL_CERT_FILE_ENV) -#define ACE_SSL_CERT_FILE_ENV "SSL_CERT_FILE" -#endif /* ACE_SSL_CERT_FILE_ENV */ - -#if !defined (ACE_SSL_CERT_DIR_ENV) -#define ACE_SSL_CERT_DIR_ENV "SSL_CERT_DIR" -#endif /* ACE_SSL_CERT_DIR_ENV */ - -#if !defined (ACE_SSL_EGD_FILE_ENV) -#define ACE_SSL_EGD_FILE_ENV "SSL_EGD_FILE" -#endif /* ACE_SSL_EGD_FILE_ENV */ - -#if !defined (ACE_SSL_RAND_FILE_ENV) -#define ACE_SSL_RAND_FILE_ENV "SSL_RAND_FILE" -#endif /* ACE_SSL_RAND_FILE_ENV */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SSLCONF_H */ diff --git a/deps/acelite/ace/SString.cpp b/deps/acelite/ace/SString.cpp index 53a204ef0..1d678159c 100644 --- a/deps/acelite/ace/SString.cpp +++ b/deps/acelite/ace/SString.cpp @@ -1,7 +1,6 @@ #include "ace/Malloc_T.h" #include "ace/OS_Memory.h" #include "ace/SString.h" -#include "ace/Auto_Ptr.h" #include "ace/OS_NS_string.h" #include "ace/Numeric_Limits.h" @@ -63,9 +62,15 @@ ACE_NS_WString::char_rep (void) const { char *t = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (t, + static_cast(ACE_Allocator::instance()->malloc (sizeof (char) * (this->len_ + 1))), + 0); +#else ACE_NEW_RETURN (t, char[this->len_ + 1], 0); +#endif for (size_type i = 0; i < this->len_; ++i) // Note that this cast may lose data if wide chars are @@ -87,9 +92,15 @@ ACE_NS_WString::ushort_rep (void) const { ACE_UINT16 *t = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (t, + static_cast (ACE_Allocator::instance()->malloc(sizeof(ACE_UINT16) * (this->len_ + 1))), + 0); +#else ACE_NEW_RETURN (t, ACE_UINT16[this->len_ + 1], 0); +#endif for (size_type i = 0; i < this->len_; ++i) // Note that this cast may lose data if wide chars are diff --git a/deps/acelite/ace/SString.h b/deps/acelite/ace/SString.h index 2eb3e8b8b..1f4f6749e 100644 --- a/deps/acelite/ace/SString.h +++ b/deps/acelite/ace/SString.h @@ -4,7 +4,7 @@ /** * @file SString.h * - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) + * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) */ //============================================================================= @@ -56,7 +56,6 @@ template class ACE_Export ACE_String_Base_Const_Iterator; class ACE_Export ACE_NS_WString : public ACE_WString { public: - using ACE_WString::size_type; /// Default constructor. @@ -131,7 +130,6 @@ ACE_NS_WString operator + (const ACE_NS_WString &, class ACE_Export ACE_SString { public: - typedef ACE_Allocator::size_type size_type; /// No position constant @@ -156,11 +154,11 @@ public: /// Default destructor. ~ACE_SString (void); - /// Return the character in the string (doesn't perform + /// Return the slot'th character in the string (doesn't perform /// bounds checking). char operator [] (size_type slot) const; - /// Return the character by reference in the string + /// Return the slot'th character by reference in the string /// (doesn't perform bounds checking). char &operator [] (size_type slot); @@ -204,7 +202,7 @@ public: /// location that matches (will be >= pos), else npos. size_type find (const ACE_SString &str, size_type pos = 0) const; - /// Find starting at pos. Returns the slot of the first + /// Find @a s starting at pos. Returns the slot of the first /// location that matches (will be >= pos), else npos. size_type find (const char *s, size_type pos = 0) const; diff --git a/deps/acelite/ace/SString.inl b/deps/acelite/ace/SString.inl index be539758e..c5685c090 100644 --- a/deps/acelite/ace/SString.inl +++ b/deps/acelite/ace/SString.inl @@ -246,7 +246,11 @@ ACE_Auto_String_Free::ACE_Auto_String_Free (ACE_Auto_String_Free& rhs) ACE_INLINE void ACE_Auto_String_Free::reset (char* p) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (this->p_); +#else ACE_OS::free (this->p_); +#endif /* ACE_HAS_ALLOC_HOOKS */ this->p_ = p; } diff --git a/deps/acelite/ace/SStringfwd.h b/deps/acelite/ace/SStringfwd.h index b06a43bad..95aa9591c 100644 --- a/deps/acelite/ace/SStringfwd.h +++ b/deps/acelite/ace/SStringfwd.h @@ -6,7 +6,7 @@ * * Forward declarations and typedefs of ACE string types. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt * @author Nanbor Wang * @author Ossama Othman */ diff --git a/deps/acelite/ace/SUN_Proactor.h b/deps/acelite/ace/SUN_Proactor.h index 2d68fccf3..974fe9e1e 100644 --- a/deps/acelite/ace/SUN_Proactor.h +++ b/deps/acelite/ace/SUN_Proactor.h @@ -61,7 +61,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL */ class ACE_Export ACE_SUN_Proactor : public ACE_POSIX_AIOCB_Proactor { - public: virtual Proactor_Type get_impl_type (void); diff --git a/deps/acelite/ace/SV_Message.cpp b/deps/acelite/ace/SV_Message.cpp index 2cb104c6b..0e22199f2 100644 --- a/deps/acelite/ace/SV_Message.cpp +++ b/deps/acelite/ace/SV_Message.cpp @@ -1,6 +1,10 @@ // SV_Message.cpp #include "ace/SV_Message.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/SV_Message.inl" #endif /* __ACE_INLINE__ */ diff --git a/deps/acelite/ace/SV_Message_Queue.cpp b/deps/acelite/ace/SV_Message_Queue.cpp index 2dd9d349e..a57be50fb 100644 --- a/deps/acelite/ace/SV_Message_Queue.cpp +++ b/deps/acelite/ace/SV_Message_Queue.cpp @@ -1,5 +1,8 @@ #include "ace/SV_Message_Queue.h" #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SV_Message_Queue.inl" diff --git a/deps/acelite/ace/SV_Message_Queue.h b/deps/acelite/ace/SV_Message_Queue.h index c2db73205..e7cd28ae8 100644 --- a/deps/acelite/ace/SV_Message_Queue.h +++ b/deps/acelite/ace/SV_Message_Queue.h @@ -4,7 +4,7 @@ /** * @file SV_Message_Queue.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //=========================================================================== @@ -43,7 +43,6 @@ public: ACE_NOWAIT = IPC_NOWAIT }; - // = Initialization and termination methods. /// Open a message queue using the . ACE_SV_Message_Queue (void); ACE_SV_Message_Queue (key_t external_id, diff --git a/deps/acelite/ace/SV_Semaphore_Complex.cpp b/deps/acelite/ace/SV_Semaphore_Complex.cpp index d3e9c7d39..aa1a590bb 100644 --- a/deps/acelite/ace/SV_Semaphore_Complex.cpp +++ b/deps/acelite/ace/SV_Semaphore_Complex.cpp @@ -1,6 +1,9 @@ #include "ace/SV_Semaphore_Complex.h" #include "ace/Log_Category.h" #include "ace/OS_NS_Thread.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SV_Semaphore_Complex.inl" @@ -66,8 +69,10 @@ ACE_SV_Semaphore_Complex::open (key_t k, mode_t perms) { ACE_TRACE ("ACE_SV_Semaphore_Complex::open"); +#ifdef ACE_HAS_SYSV_IPC if (k == IPC_PRIVATE) return -1; +#endif this->key_ = k; @@ -116,7 +121,11 @@ ACE_SV_Semaphore_Complex::open (key_t k, int semval = ACE_SV_Semaphore_Simple::control (GETVAL, 0, 1); if (semval == -1) +#ifdef ACE_HAS_SYSV_IPC return this->init (); +#else + return -1; +#endif else if (semval == 0) { // We should initialize by doing a SETALL, but that would @@ -148,7 +157,11 @@ ACE_SV_Semaphore_Complex::open (key_t k, // Decrement the process counter. We don't need a lock to do this. if (ACE_OS::semop (this->internal_id_, &ACE_SV_Semaphore_Complex::op_open_[0], 1) < 0) +#ifdef ACE_HAS_SYSV_IPC return this->init (); +#else + return -1; +#endif return 0; } } @@ -177,8 +190,10 @@ ACE_SV_Semaphore_Complex::close (void) ACE_TRACE ("ACE_SV_Semaphore_Complex::close"); int semval; +#ifdef ACE_HAS_SYSV_IPC if (this->key_ == (key_t) - 1 || this->internal_id_ == -1) return -1; +#endif // The following semop() first gets a lock on the ACE_SV_Semaphore, // then increments [1] - the process number. @@ -203,7 +218,9 @@ ACE_SV_Semaphore_Complex::close (void) { int result = ACE_OS::semop (this->internal_id_, &ACE_SV_Semaphore_Complex::op_unlock_[0], 1); +#ifdef ACE_HAS_SYSV_IPC this->init (); +#endif return result; } } @@ -227,12 +244,14 @@ ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex (const char *name, { ACE_TRACE ("ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex"); - key_t key; + key_t key = ACE_DEFAULT_SEM_KEY; - if (name == 0) - key = ACE_DEFAULT_SEM_KEY; - else +#ifdef ACE_HAS_SYSV_IPC + if (name != 0) key = this->name_2_key (name); +#else + ACE_UNUSED_ARG (name); +#endif if (this->open (key, flags, initial_value, nsems, perms) == -1) ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_SV_Semaphore_Complex"))); @@ -248,7 +267,9 @@ ACE_SV_Semaphore_Complex::~ACE_SV_Semaphore_Complex (void) ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex (void) { ACE_TRACE ("ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex"); +#ifdef ACE_HAS_SYSV_IPC this->init (); +#endif } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/SV_Semaphore_Complex.h b/deps/acelite/ace/SV_Semaphore_Complex.h index 65d1ed5f8..5fa0dded2 100644 --- a/deps/acelite/ace/SV_Semaphore_Complex.h +++ b/deps/acelite/ace/SV_Semaphore_Complex.h @@ -4,7 +4,7 @@ /** * @file SV_Semaphore_Complex.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -58,7 +58,6 @@ public: ACE_OPEN = 0 }; - // = Initialization and termination methods. ACE_SV_Semaphore_Complex (void); ACE_SV_Semaphore_Complex (key_t key, short create = ACE_SV_Semaphore_Complex::ACE_CREATE, diff --git a/deps/acelite/ace/SV_Semaphore_Simple.cpp b/deps/acelite/ace/SV_Semaphore_Simple.cpp index 73bbdefe3..593065ec6 100644 --- a/deps/acelite/ace/SV_Semaphore_Simple.cpp +++ b/deps/acelite/ace/SV_Semaphore_Simple.cpp @@ -2,6 +2,9 @@ #include "ace/Log_Category.h" #include "ace/ACE.h" #include "ace/os_include/sys/os_sem.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SV_Semaphore_Simple.inl" @@ -39,6 +42,7 @@ ACE_SV_Semaphore_Simple::control (int cmd, } } +#ifdef ACE_HAS_SYSV_IPC int ACE_SV_Semaphore_Simple::init (key_t k, int i) { @@ -47,6 +51,7 @@ ACE_SV_Semaphore_Simple::init (key_t k, int i) this->internal_id_ = i; return 0; } +#endif // General ACE_SV_Semaphore operation. Increment or decrement by a // specific amount (positive or negative; amount can`t be zero). @@ -81,8 +86,10 @@ ACE_SV_Semaphore_Simple::open (key_t k, ACE_TRACE ("ACE_SV_Semaphore_Simple::open"); union semun ivalue; +#ifdef ACE_HAS_SYSV_IPC if (k == IPC_PRIVATE || k == static_cast (ACE_INVALID_SEM_KEY)) return -1; +#endif ivalue.val = initial_value; this->key_ = k; @@ -128,7 +135,12 @@ ACE_SV_Semaphore_Simple::name_2_key (const char *name) if (name == 0) { errno = EINVAL; +#ifdef ACE_HAS_SYSV_IPC return static_cast (ACE_INVALID_SEM_KEY); +#else + key_t ret = ACE_DEFAULT_SEM_KEY; + return ret; +#endif } // Basically "hash" the values in the . This won't @@ -139,7 +151,14 @@ ACE_SV_Semaphore_Simple::name_2_key (const char *name) # pragma warning(push) # pragma warning(disable : 4312) #endif /* defined (ACE_WIN32) && defined (_MSC_VER) */ - return (key_t)(intptr_t)ACE::crc32 (name); + +#ifdef ACE_HAS_SYSV_IPC + return (key_t) ACE::crc32 (name); +#else + key_t ret = ACE_DEFAULT_SEM_KEY; + return ret; +#endif + #if defined (ACE_WIN32) && defined (_MSC_VER) # pragma warning(pop) #endif /* defined (ACE_WIN32) && defined (_MSC_VER) */ @@ -157,12 +176,14 @@ ACE_SV_Semaphore_Simple::open (const char *name, { ACE_TRACE ("ACE_SV_Semaphore_Simple::open"); - key_t key; + key_t key = ACE_DEFAULT_SEM_KEY; - if (name == 0) - key = ACE_DEFAULT_SEM_KEY; - else +#ifdef ACE_HAS_SYSV_IPC + if (name != 0) key = this->name_2_key (name); +#else + ACE_UNUSED_ARG (name); +#endif return this->open (key, flags, initial_value, n, perms); } @@ -213,7 +234,9 @@ ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (void) : sem_number_ (0) { ACE_TRACE ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple"); +#ifdef ACE_HAS_SYSV_IPC this->init (); +#endif } // Remove all SV_Semaphores associated with a particular key. This @@ -227,7 +250,9 @@ ACE_SV_Semaphore_Simple::remove (void) const { ACE_TRACE ("ACE_SV_Semaphore_Simple::remove"); int const result = this->control (IPC_RMID); +#ifdef ACE_HAS_SYSV_IPC ((ACE_SV_Semaphore_Simple *) this)->init (); +#endif return result; } diff --git a/deps/acelite/ace/SV_Semaphore_Simple.h b/deps/acelite/ace/SV_Semaphore_Simple.h index 0a475c7e2..e64d16024 100644 --- a/deps/acelite/ace/SV_Semaphore_Simple.h +++ b/deps/acelite/ace/SV_Semaphore_Simple.h @@ -4,7 +4,7 @@ /** * @file SV_Semaphore_Simple.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -55,7 +55,6 @@ public: ACE_OPEN = 0 }; - // = Initialization and termination methods. ACE_SV_Semaphore_Simple (void); ACE_SV_Semaphore_Simple (key_t key, short flags = ACE_SV_Semaphore_Simple::ACE_CREATE, @@ -170,6 +169,7 @@ protected: /// Number of semaphores we're creating. int sem_number_; +#ifdef ACE_HAS_SYSV_IPC /** * Convert name to key This function is used internally to create * keys for the semaphores. A valid name contains letters and @@ -181,6 +181,8 @@ protected: */ int init (key_t k = static_cast (ACE_INVALID_SEM_KEY), int i = -1); +#endif + key_t name_2_key (const char *name); }; diff --git a/deps/acelite/ace/SV_Semaphore_Simple.inl b/deps/acelite/ace/SV_Semaphore_Simple.inl index fc91a85c7..b8d0b7037 100644 --- a/deps/acelite/ace/SV_Semaphore_Simple.inl +++ b/deps/acelite/ace/SV_Semaphore_Simple.inl @@ -40,7 +40,11 @@ ACE_INLINE int ACE_SV_Semaphore_Simple::close (void) { ACE_TRACE ("ACE_SV_Semaphore_Simple::close"); +#ifdef ACE_HAS_SYSV_IPC return this->init (); +#else + ACE_NOTSUP_RETURN (-1); +#endif } // General ACE_SV_Semaphore operation on an array of SV_Semaphores. diff --git a/deps/acelite/ace/SV_Shared_Memory.cpp b/deps/acelite/ace/SV_Shared_Memory.cpp index 366267aef..ef65d4976 100644 --- a/deps/acelite/ace/SV_Shared_Memory.cpp +++ b/deps/acelite/ace/SV_Shared_Memory.cpp @@ -1,5 +1,8 @@ #include "ace/SV_Shared_Memory.h" #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/SV_Shared_Memory.inl" diff --git a/deps/acelite/ace/SV_Shared_Memory.h b/deps/acelite/ace/SV_Shared_Memory.h index 4e57b26b2..6d8237d33 100644 --- a/deps/acelite/ace/SV_Shared_Memory.h +++ b/deps/acelite/ace/SV_Shared_Memory.h @@ -4,7 +4,7 @@ /** * @file SV_Shared_Memory.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -39,7 +39,6 @@ public: ACE_OPEN = 0 }; - // = Initialization and termination methods. ACE_SV_Shared_Memory (void); ACE_SV_Shared_Memory (key_t external_id, size_t size, diff --git a/deps/acelite/ace/Sample_History.cpp b/deps/acelite/ace/Sample_History.cpp index 484647796..7cebff07e 100644 --- a/deps/acelite/ace/Sample_History.cpp +++ b/deps/acelite/ace/Sample_History.cpp @@ -8,18 +8,30 @@ #include "ace/Log_Category.h" #include "ace/OS_Memory.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Sample_History::ACE_Sample_History (size_t max_samples) : max_samples_ (max_samples) , sample_count_ (0) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR(this->samples_, static_cast(ACE_Allocator::instance()->malloc(sizeof(ACE_UINT64) * this->max_samples_))); +#else ACE_NEW(this->samples_, ACE_UINT64[this->max_samples_]); +#endif /* ACE_HAS_ALLOC_HOOKS */ } ACE_Sample_History::~ACE_Sample_History (void) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(this->samples_); +#else delete[] this->samples_; +#endif /* ACE_HAS_ALLOC_HOOKS */ } void diff --git a/deps/acelite/ace/Sbrk_Memory_Pool.cpp b/deps/acelite/ace/Sbrk_Memory_Pool.cpp index 358857ba7..45dd167ac 100644 --- a/deps/acelite/ace/Sbrk_Memory_Pool.cpp +++ b/deps/acelite/ace/Sbrk_Memory_Pool.cpp @@ -1,7 +1,7 @@ #include "ace/OS_NS_unistd.h" #include "ace/Sbrk_Memory_Pool.h" #include "ace/Log_Category.h" - +#include "ace/Malloc_Base.h" #if !defined (ACE_LACKS_SBRK) diff --git a/deps/acelite/ace/Sbrk_Memory_Pool.h b/deps/acelite/ace/Sbrk_Memory_Pool.h index 0a9826b0b..ea435b11d 100644 --- a/deps/acelite/ace/Sbrk_Memory_Pool.h +++ b/deps/acelite/ace/Sbrk_Memory_Pool.h @@ -4,7 +4,7 @@ /** * @file Sbrk_Memory_Pool.h * - * @author Dougls C. Schmidt + * @author Dougls C. Schmidt * @author Prashant Jain */ //============================================================================= diff --git a/deps/acelite/ace/Sched_Params.h b/deps/acelite/ace/Sched_Params.h index c355fefc8..ba4967412 100644 --- a/deps/acelite/ace/Sched_Params.h +++ b/deps/acelite/ace/Sched_Params.h @@ -71,7 +71,6 @@ class ACE_Export ACE_Sched_Params public: typedef int Policy; - // = Initialization and termination methods. /// Constructor. ACE_Sched_Params (const Policy policy, const ACE_Sched_Priority priority, diff --git a/deps/acelite/ace/Select_Reactor.h b/deps/acelite/ace/Select_Reactor.h index b47569b96..4843d2e60 100644 --- a/deps/acelite/ace/Select_Reactor.h +++ b/deps/acelite/ace/Select_Reactor.h @@ -4,7 +4,7 @@ /** * @file Select_Reactor.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -46,7 +46,6 @@ template<> class ACE_Export ACE_Guard< ACE_Reactor_Token_T > { public: - // = Initialization and termination methods. ACE_Guard (ACE_Reactor_Token_T &) {} ACE_Guard (ACE_Reactor_Token_T &, int) {} ~ACE_Guard (void) {} diff --git a/deps/acelite/ace/Select_Reactor_Base.cpp b/deps/acelite/ace/Select_Reactor_Base.cpp index 022ff1d7b..592e95da6 100644 --- a/deps/acelite/ace/Select_Reactor_Base.cpp +++ b/deps/acelite/ace/Select_Reactor_Base.cpp @@ -12,21 +12,25 @@ #include "ace/Select_Reactor_Base.inl" #endif /* __ACE_INLINE__ */ -#ifndef ACE_WIN32 +#ifndef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP # include -#endif /* !ACE_WIN32 */ +#endif /* !ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE(ACE_Select_Reactor_Notify) +ACE_ALLOC_HOOK_DEFINE(ACE_Select_Reactor_Handler_Repository) +ACE_ALLOC_HOOK_DEFINE(ACE_Select_Reactor_Handler_Repository_Iterator) + template inline ACE_Event_Handler * ACE_SELECT_REACTOR_EVENT_HANDLER (iterator i) { -#ifdef ACE_WIN32 +#ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP return (*i).item (); #else return (*i); -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ } // Performs sanity checking on the ACE_HANDLE. @@ -35,14 +39,14 @@ bool ACE_Select_Reactor_Handler_Repository::invalid_handle (ACE_HANDLE handle) { ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::invalid_handle"); -#if defined (ACE_WIN32) +#if defined (ACE_SELECT_REACTOR_BASE_USES_HASH_MAP) // It's too expensive to perform more exhaustive validity checks on // Win32 due to the way that they implement SOCKET HANDLEs. if (handle == ACE_INVALID_HANDLE) -#else /* !ACE_WIN32 */ +#else /* !ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ if (handle < 0 || static_cast (handle) >= this->event_handlers_.size ()) -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ { errno = EINVAL; return true; @@ -57,13 +61,13 @@ bool ACE_Select_Reactor_Handler_Repository::handle_in_range (ACE_HANDLE handle) { ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::handle_in_range"); -#if defined (ACE_WIN32) +#if defined (ACE_SELECT_REACTOR_BASE_USES_HASH_MAP) // It's too expensive to perform more exhaustive validity checks on // Win32 due to the way that they implement SOCKET HANDLEs. if (handle != ACE_INVALID_HANDLE) -#else /* !ACE_WIN32 */ +#else /* !ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ if (handle >= 0 && handle < this->max_handlep1_) -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ { return true; } @@ -80,7 +84,7 @@ ACE_Select_Reactor_Handler_Repository::open (size_type size) { ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::open"); -#if defined (ACE_WIN32) +#if defined (ACE_SELECT_REACTOR_BASE_USES_HASH_MAP) if (this->event_handlers_.open (size) == -1) return -1; #else @@ -93,7 +97,7 @@ ACE_Select_Reactor_Handler_Repository::open (size_type size) static_cast (0)); this->max_handlep1_ = 0; -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ // Try to increase the number of handles if is greater than // the current limit. @@ -103,11 +107,10 @@ ACE_Select_Reactor_Handler_Repository::open (size_type size) // Initialize a repository of the appropriate . ACE_Select_Reactor_Handler_Repository::ACE_Select_Reactor_Handler_Repository (ACE_Select_Reactor_Impl &select_reactor) - : select_reactor_ (select_reactor), -#ifndef ACE_WIN32 - max_handlep1_ (0), -#endif /* !ACE_WIN32 */ - event_handlers_ () + : select_reactor_ (select_reactor) +#ifndef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP + , max_handlep1_ (0) +#endif /* !ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ { ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::ACE_Select_Reactor_Handler_Repository"); } @@ -116,7 +119,7 @@ int ACE_Select_Reactor_Handler_Repository::unbind_all (void) { // Unbind all of the s. -#ifdef ACE_WIN32 +#ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP map_type::iterator const end = this->event_handlers_.end (); for (map_type::iterator pos = this->event_handlers_.begin (); pos != end; @@ -148,7 +151,7 @@ ACE_Select_Reactor_Handler_Repository::unbind_all (void) ACE_Event_Handler::ALL_EVENTS_MASK); ++pos; } -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ return 0; } @@ -169,14 +172,14 @@ ACE_Select_Reactor_Handler_Repository::find_eh (ACE_HANDLE handle) map_type::iterator pos (this->event_handlers_.end ()); // this code assumes the handle is in range. -#if defined (ACE_WIN32) +#if defined (ACE_SELECT_REACTOR_BASE_USES_HASH_MAP) this->event_handlers_.find (handle, pos); #else map_type::iterator const tmp = &this->event_handlers_[handle]; if (*tmp != 0) pos = tmp; -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ return pos; } @@ -201,7 +204,7 @@ ACE_Select_Reactor_Handler_Repository::bind (ACE_HANDLE handle, // Is this handle already in the Reactor? bool existing_handle = false; -#if defined (ACE_WIN32) +#if defined (ACE_SELECT_REACTOR_BASE_USES_HASH_MAP) map_type::ENTRY * entry = 0; @@ -249,7 +252,7 @@ ACE_Select_Reactor_Handler_Repository::bind (ACE_HANDLE handle, if (this->max_handlep1_ < handle + 1) this->max_handlep1_ = handle + 1; -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ if (this->select_reactor_.is_suspended_i (handle)) { @@ -329,7 +332,7 @@ ACE_Select_Reactor_Handler_Repository::unbind ( if (!has_any_wait_mask && !has_any_suspend_mask) { -#if defined (ACE_WIN32) +#if defined (ACE_SELECT_REACTOR_BASE_USES_HASH_MAP) if (event_handler != 0 && this->event_handlers_.unbind (pos) == -1) return -1; // Should not happen! #else @@ -371,7 +374,7 @@ ACE_Select_Reactor_Handler_Repository::unbind ( ++this->max_handlep1_; } -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ // The handle has been completely removed. complete_removal = true; @@ -404,7 +407,7 @@ ACE_Select_Reactor_Handler_Repository_Iterator::ACE_Select_Reactor_Handler_Repos : rep_ (s), current_ (s->event_handlers_.begin ()) { -#ifndef ACE_WIN32 +#ifndef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP // Don't use ACE_Array_Base::end() since it may be larger than // event_handlers[max_handlep1_]. const_base_iterator const end = @@ -440,7 +443,7 @@ ACE_Select_Reactor_Handler_Repository_Iterator::next ( bool ACE_Select_Reactor_Handler_Repository_Iterator::advance (void) { -#ifdef ACE_WIN32 +#ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP // No need to explicitly limit search to "current" to // max_handlep1_ range. const_base_iterator const end = this->rep_->event_handlers_.end (); @@ -449,18 +452,18 @@ ACE_Select_Reactor_Handler_Repository_Iterator::advance (void) // event_handlers[max_handlep1_]. const_base_iterator const end = &this->rep_->event_handlers_[this->rep_->max_handlep1 ()]; -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ if (this->current_ != end) ++this->current_; -#ifndef ACE_WIN32 +#ifndef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP // Advance to the next element containing a non-zero event handler. // There's no need to do this for the Windows case since the hash // map will only contain non-zero event handlers. while (this->current_ != end && (*(this->current_) == 0)) ++this->current_; -#endif /* !ACE_WIN32 */ +#endif /* !ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ return this->current_ != end; } @@ -475,12 +478,12 @@ ACE_Select_Reactor_Handler_Repository_Iterator::dump (void) const ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("rep_ = %u"), this->rep_)); -# ifdef ACE_WIN32 +# ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("current_ = "))); this->current_.dump (); # else ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("current_ = %@"), this->current_)); -# endif /* ACE_WIN32 */ +# endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ } @@ -491,13 +494,13 @@ ACE_Select_Reactor_Handler_Repository::dump (void) const #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::dump"); -# ifdef ACE_WIN32 +# ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP # define ACE_HANDLE_FORMAT_SPECIFIER ACE_TEXT("%@") # define ACE_MAX_HANDLEP1_FORMAT_SPECIFIER ACE_TEXT("%u") # else # define ACE_HANDLE_FORMAT_SPECIFIER ACE_TEXT("%d") # define ACE_MAX_HANDLEP1_FORMAT_SPECIFIER ACE_TEXT("%d") -# endif /* ACE_WIN32 */ +# endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACELIB_DEBUG ((LM_DEBUG, @@ -525,8 +528,6 @@ ACE_Select_Reactor_Handler_Repository::dump (void) const #endif /* ACE_HAS_DUMP */ } -ACE_ALLOC_HOOK_DEFINE(ACE_Select_Reactor_Handler_Repository_Iterator) - ACE_Select_Reactor_Notify::ACE_Select_Reactor_Notify (void) : select_reactor_ (0) , max_notify_iterations_ (-1) @@ -608,9 +609,16 @@ ACE_Select_Reactor_Notify::open (ACE_Reactor_Impl *r, if (this->notification_pipe_.open () == -1) return -1; -#if defined (F_SETFD) - ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1); - ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1); +#if defined (F_SETFD) && !defined (ACE_LACKS_FCNTL) + if (ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1) == -1) + { + return -1; + } + + if (ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1) == -1) + { + return -1; + } #endif /* F_SETFD */ #if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) @@ -618,6 +626,13 @@ ACE_Select_Reactor_Notify::open (ACE_Reactor_Impl *r, { return -1; } + +# if defined (ACE_LACKS_LISTEN) && defined (ACE_LACKS_SOCKETPAIR) \ + && !defined (ACE_HAS_STREAM_PIPES) + if (ACE::set_flags (this->notification_pipe_.write_handle (), + ACE_NONBLOCK) == -1) + return -1; +# endif #endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ // There seems to be a Win32 bug with this... Set this into @@ -904,7 +919,6 @@ ACE_Select_Reactor_Notify::read_notify_pipe (ACE_HANDLE handle, return -1; } - return 1; } diff --git a/deps/acelite/ace/Select_Reactor_Base.h b/deps/acelite/ace/Select_Reactor_Base.h index 364f4d0f5..58440ea6b 100644 --- a/deps/acelite/ace/Select_Reactor_Base.h +++ b/deps/acelite/ace/Select_Reactor_Base.h @@ -4,7 +4,7 @@ /** * @file Select_Reactor_Base.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -28,14 +28,18 @@ # include "ace/Notification_Queue.h" #endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ -#ifdef ACE_WIN32 +#if defined (ACE_WIN32) || defined (ACE_MQX) +# define ACE_SELECT_REACTOR_BASE_USES_HASH_MAP +#endif + +#ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP # include "ace/Null_Mutex.h" # include "ace/Hash_Map_Manager_T.h" # include "ace/Functor.h" /* For ACE_Hash */ # include /* For std::equal_to<> */ #else # include "ace/Array_Base.h" -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ #if !defined (ACE_DISABLE_NOTIFY_PIPE_DEFAULT) # define ACE_DISABLE_NOTIFY_PIPE_DEFAULT 0 @@ -135,7 +139,6 @@ public: /// Destructor. virtual ~ACE_Select_Reactor_Notify (void); - // = Initialization and termination methods. /// Initialize. virtual int open (ACE_Reactor_Impl *, ACE_Timer_Queue * = 0, @@ -289,7 +292,7 @@ public: typedef ACE_Event_Handler * value_type; // = The mapping from to . -#ifdef ACE_WIN32 +#ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP /** * The NT version implements this via a hash map * @c ACE_Event_Handler*. Since NT implements @c ACE_HANDLE @@ -311,11 +314,10 @@ public: */ typedef ACE_Array_Base map_type; typedef ACE_HANDLE max_handlep1_type; -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ typedef map_type::size_type size_type; - // = Initialization and termination methods. /// Default "do-nothing" constructor. ACE_Select_Reactor_Handler_Repository (ACE_Select_Reactor_Impl &); @@ -395,11 +397,11 @@ private: /// Reference to our @c Select_Reactor. ACE_Select_Reactor_Impl &select_reactor_; -#ifndef ACE_WIN32 +#ifndef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP /// The highest currently active handle, plus 1 (ranges between 0 and /// @c max_size_. max_handlep1_type max_handlep1_; -#endif /* !ACE_WIN32 */ +#endif /* !ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ /// Underlying table of event handlers. map_type event_handlers_; @@ -417,7 +419,6 @@ public: typedef ACE_Select_Reactor_Handler_Repository::map_type::const_iterator const_base_iterator; - // = Initialization method. explicit ACE_Select_Reactor_Handler_Repository_Iterator ( ACE_Select_Reactor_Handler_Repository const * s); @@ -587,14 +588,13 @@ protected: /// Controls/access whether the notify handler should renew the /// Select_Reactor's token or not. - int supress_notify_renew (void); - void supress_notify_renew (int sr); + bool supress_notify_renew (void); + void supress_notify_renew (bool sr); private: - /// Determine whether we should renew Select_Reactor's token after handling /// the notification message. - int supress_renew_; + bool supress_renew_; /// Deny access since member-wise won't work... ACE_Select_Reactor_Impl (const ACE_Select_Reactor_Impl &); diff --git a/deps/acelite/ace/Select_Reactor_Base.inl b/deps/acelite/ace/Select_Reactor_Base.inl index 3993e9ff7..370b74f25 100644 --- a/deps/acelite/ace/Select_Reactor_Base.inl +++ b/deps/acelite/ace/Select_Reactor_Base.inl @@ -6,21 +6,21 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Select_Reactor_Handler_Repository::size_type ACE_Select_Reactor_Handler_Repository::size (void) const { -#ifdef ACE_WIN32 +#ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP return this->event_handlers_.total_size (); #else return this->event_handlers_.size (); -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ } ACE_INLINE ACE_Select_Reactor_Handler_Repository::max_handlep1_type ACE_Select_Reactor_Handler_Repository::max_handlep1 (void) const { -#ifdef ACE_WIN32 +#ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP return this->event_handlers_.current_size (); #else return this->max_handlep1_; -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ } ACE_INLINE int @@ -50,11 +50,11 @@ ACE_Select_Reactor_Handler_Repository::find (ACE_HANDLE handle) if (pos != this->event_handlers_.end ()) { -#ifdef ACE_WIN32 +#ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP eh = (*pos).item (); #else eh = *pos; -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ } } // Don't bother setting errno. It isn't used in the select()-based @@ -72,12 +72,12 @@ ACE_Select_Reactor_Handler_Repository::find (ACE_HANDLE handle) ACE_INLINE bool ACE_Select_Reactor_Handler_Repository_Iterator::done (void) const { -#ifdef ACE_WIN32 +#ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP return this->current_ == this->rep_->event_handlers_.end (); #else return this->current_ == (this->rep_->event_handlers_.begin () + this->rep_->max_handlep1 ()); -#endif /* ACE_WIN32 */ +#endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */ } // ------------------------------------------------------------------ @@ -123,9 +123,10 @@ ACE_Select_Reactor_Impl::ACE_Select_Reactor_Impl (bool ms) , delete_signal_handler_ (false) , delete_notify_handler_ (false) , initialized_ (false) - , restart_ (0) + , restart_ (false) , requeue_position_ (-1) // Requeue at end of waiters by default. - , state_changed_ (0) + , owner_ (ACE_OS::NULL_thread) + , state_changed_ (false) , mask_signals_ (ms) , supress_renew_ (0) { @@ -134,14 +135,14 @@ ACE_Select_Reactor_Impl::ACE_Select_Reactor_Impl (bool ms) # pragma warning (pop) #endif -ACE_INLINE int +ACE_INLINE bool ACE_Select_Reactor_Impl::supress_notify_renew (void) { return this->supress_renew_; } ACE_INLINE void -ACE_Select_Reactor_Impl::supress_notify_renew (int sr) +ACE_Select_Reactor_Impl::supress_notify_renew (bool sr) { this->supress_renew_ = sr; } diff --git a/deps/acelite/ace/Select_Reactor_T.cpp b/deps/acelite/ace/Select_Reactor_T.cpp index 1c70e7a4d..937dfaf91 100644 --- a/deps/acelite/ace/Select_Reactor_T.cpp +++ b/deps/acelite/ace/Select_Reactor_T.cpp @@ -32,7 +32,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Select_Reactor_T) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Select_Reactor_T) template int ACE_Select_Reactor_T::any_ready @@ -190,7 +190,7 @@ ACE_Select_Reactor_T::renew (void) { ACE_TRACE ("ACE_Select_Reactor_T::renew"); #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - if (this->supress_notify_renew () == 0) + if (!this->supress_notify_renew ()) this->token_.renew (this->requeue_position_); #endif /* defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) */ } @@ -1364,7 +1364,7 @@ ACE_Select_Reactor_T::dispatch (dispatch_set, active_handle_count, other_handlers_dispatched) == -1) - // State has changed or a serious failure has occured, so exit + // State has changed or a serious failure has occurred, so exit // loop. break; diff --git a/deps/acelite/ace/Select_Reactor_T.h b/deps/acelite/ace/Select_Reactor_T.h index c27f62211..1e30923f4 100644 --- a/deps/acelite/ace/Select_Reactor_T.h +++ b/deps/acelite/ace/Select_Reactor_T.h @@ -4,7 +4,7 @@ /** * @file Select_Reactor_T.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -53,9 +53,6 @@ template class ACE_Select_Reactor_T : public ACE_Select_Reactor_Impl { public: - - // = Initialization and termination methods. - /// If @a disable_notify_pipe is non-0 then the reactor will /// not create a notification pipe, which will save two I/O handles /// but will elide the notify() feature. If @a mask_signals is @@ -220,7 +217,6 @@ public: ACE_Reactor_Mask mask); #if defined (ACE_WIN32) - // Originally this interface was available for all platforms, but // because ACE_HANDLE is an int on non-Win32 platforms, compilers // are not able to tell the difference between @@ -231,7 +227,6 @@ public: /// Not implemented. virtual int register_handler (ACE_Event_Handler *event_handler, ACE_HANDLE event_handle = ACE_INVALID_HANDLE); - #endif /* ACE_WIN32 */ /// Not implemented. @@ -432,9 +427,9 @@ public: /** * Set the maximum number of times that the - * method will iterate and + * ACE_Select_Reactor_Notify::handle_input() method will iterate and * dispatch the ACE_Event_Handlers that are passed in via the - * notify pipe before breaking out of its loop. By default, + * notify pipe before breaking out of its recv loop. By default, * this is set to -1, which means "iterate until the pipe is empty." * Setting this to a value like "1 or 2" will increase "fairness" * (and thus prevent starvation) at the expense of slightly higher @@ -444,9 +439,9 @@ public: /** * Get the maximum number of times that the - * method will iterate and + * ACE_Select_Reactor_Notify::handle_input() method will iterate and * dispatch the ACE_Event_Handlers that are passed in via the - * notify pipe before breaking out of its loop. + * notify pipe before breaking out of its recv loop. */ virtual int max_notify_iterations (void); diff --git a/deps/acelite/ace/Select_Reactor_T.inl b/deps/acelite/ace/Select_Reactor_T.inl index be6192c55..7200933a4 100644 --- a/deps/acelite/ace/Select_Reactor_T.inl +++ b/deps/acelite/ace/Select_Reactor_T.inl @@ -70,7 +70,6 @@ ACE_Select_Reactor_T::register_handler (int signum, } #if defined (ACE_WIN32) - template ACE_INLINE int ACE_Select_Reactor_T::register_handler (ACE_Event_Handler *, @@ -79,7 +78,6 @@ ACE_Select_Reactor_T::register_handler (ACE_Event_Hand // Don't have an implementation for this yet... ACE_NOTSUP_RETURN (-1); } - #endif /* ACE_WIN32 */ template diff --git a/deps/acelite/ace/Semaphore.cpp b/deps/acelite/ace/Semaphore.cpp index 062c0cd15..dcbac24fc 100644 --- a/deps/acelite/ace/Semaphore.cpp +++ b/deps/acelite/ace/Semaphore.cpp @@ -6,6 +6,9 @@ #include "ace/Log_Category.h" #include "ace/ACE.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Semaphore.h b/deps/acelite/ace/Semaphore.h index 6320b0eb5..a8fc282fa 100644 --- a/deps/acelite/ace/Semaphore.h +++ b/deps/acelite/ace/Semaphore.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -34,7 +34,6 @@ class ACE_Time_Value; class ACE_Export ACE_Semaphore { public: - // = Initialization and termination. /// Initialize the semaphore, with initial value of "count". ACE_Semaphore (unsigned int count = 1, // By default make this unlocked. int type = USYNC_THREAD, diff --git a/deps/acelite/ace/Service_Config.cpp b/deps/acelite/ace/Service_Config.cpp index 516bcf082..193e54ab8 100644 --- a/deps/acelite/ace/Service_Config.cpp +++ b/deps/acelite/ace/Service_Config.cpp @@ -22,6 +22,9 @@ #include "ace/Log_Category.h" #include "ace/ACE.h" +#ifdef ACE_HAS_TSS_EMULATION +#include "ace/Object_Manager.h" +#endif ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -106,7 +109,7 @@ ACE_Service_Config_Guard::ACE_Service_Config_Guard (ACE_Service_Gestalt * psg) if (ACE::debug ()) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE (%P|%t) - SCG:") - ACE_TEXT (" - config=%@ repo=%@ superceded by repo=%@\n"), + ACE_TEXT (" - config=%@ repo=%@ superseded by repo=%@\n"), this, this->saved_.get (), this->saved_->repo_, @@ -536,11 +539,12 @@ ACE_Service_Config::reconfigure (void) { #if !defined (ACE_NLOGGING) time_t t = ACE_OS::time (0); -#endif /* ! ACE_NLOGGING */ + if (ACE::debug ()) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("beginning reconfiguration at %s"), ACE_OS::ctime (&t))); +#endif /* ! ACE_NLOGGING */ } if (ACE_Service_Config::process_directives () == -1) ACELIB_ERROR ((LM_ERROR, diff --git a/deps/acelite/ace/Service_Config.h b/deps/acelite/ace/Service_Config.h index e821eed61..ac9d44df6 100644 --- a/deps/acelite/ace/Service_Config.h +++ b/deps/acelite/ace/Service_Config.h @@ -4,7 +4,7 @@ /** * @file Service_Config.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //==================================================================== @@ -252,19 +252,19 @@ public: * The ACE_Service_Config uses the Monostate pattern. Therefore, * you can only have one of these instantiated per-process. It * represents the process-wide collection of services, which is - * typicaly shared among all other configurable entities. The only + * typically shared among all other configurable entities. The only * ACE_Service_Config instance is registered with and owned by the * ACE_Object_Manager. * * By contrast, the ACE_Service_Gestalt represents the collection - * of services, pertaining to a configurable entity. Typicaly, a + * of services, pertaining to a configurable entity. Typically, a * "configurable entity" is an instance, which owns an instance of - * ACE_Service_Gestalt in order to ensure full controll over the + * ACE_Service_Gestalt in order to ensure full control over the * services it needs. * * Another facet of ACE_Service_Config is that for a given thread, * it provides access to its current, process-global - * ACE_Service_Gestalt instance through its curent() method. + * ACE_Service_Gestalt instance through its current() method. * * @note The signal_handler_ static member is allocated by the * ACE_Object_Manager. The ACE_Service_Config constructor @@ -290,9 +290,6 @@ class ACE_Export ACE_Service_Config ACE_Threading_Helper threadkey_; public: - - // = Initialization and termination methods. - /** * Initialize the Service Repository. Note that initialising @a * signum to a negative number will prevent a signal handler being @@ -716,7 +713,7 @@ private: * @brief A guard class, designed to be instantiated on the stack. * * Instantiating it with a specific configuration ensures any references to - * ACE_Service_Config::instance(), even when occuring in static constructors, + * ACE_Service_Config::instance(), even when occurring in static constructors, * will allways access the designated configuration instance. * This comes very handy when a dynamic service also registers any static * services of its own and their static factories. diff --git a/deps/acelite/ace/Service_Gestalt.cpp b/deps/acelite/ace/Service_Gestalt.cpp index 919875096..6bc653bf2 100644 --- a/deps/acelite/ace/Service_Gestalt.cpp +++ b/deps/acelite/ace/Service_Gestalt.cpp @@ -132,15 +132,25 @@ Processed_Static_Svc (const ACE_Static_Svc_Descriptor *assd) :name_(0), assd_(assd) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_NORETURN (name_, static_cast(ACE_Allocator::instance()->malloc (sizeof(ACE_TCHAR) * (ACE_OS::strlen(assd->name_)+1)))); +#else ACE_NEW_NORETURN (name_, ACE_TCHAR[ACE_OS::strlen(assd->name_)+1]); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_OS::strcpy(name_,assd->name_); } ACE_Service_Gestalt::Processed_Static_Svc::~Processed_Static_Svc (void) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(name_); +#else delete [] name_; +#endif /* ACE_HAS_ALLOC_HOOKS */ } +ACE_ALLOC_HOOK_DEFINE(ACE_Service_Gestalt::Processed_Static_Svc) + void ACE_Service_Gestalt::intrusive_add_ref (ACE_Service_Gestalt* g) { @@ -348,7 +358,7 @@ ACE_Service_Gestalt::add_processed_static_svc /// associates a service object with the Gestalt and makes the /// resource (a Service Object) local to the repository. This is but /// the first step in using such SO. The next is the - /// "initialization" step. It is typicaly done through a "static" + /// "initialization" step. It is typically done through a "static" /// service configuration directive. /// /// In contrast a "dynamic" directive, when processed through the @@ -779,10 +789,6 @@ ACE_Service_Gestalt::process_directives_i (ACE_Svc_Conf_Param *param) : param->source.directive)); #endif - // AC 970827 Skip the heap check because yacc allocates a buffer - // here which will be reported as a memory leak for some reason. - ACE_NO_HEAP_CHECK - // Were we called in the context of the current instance? ACE_ASSERT (this == param->config); diff --git a/deps/acelite/ace/Service_Gestalt.h b/deps/acelite/ace/Service_Gestalt.h index 7df9a5e4d..0a4d9b158 100644 --- a/deps/acelite/ace/Service_Gestalt.h +++ b/deps/acelite/ace/Service_Gestalt.h @@ -20,7 +20,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Auto_Ptr.h" #include "ace/SString.h" #include "ace/Unbounded_Queue.h" #include "ace/Unbounded_Set.h" @@ -264,9 +263,9 @@ public: #if (ACE_USES_CLASSIC_SVC_CONF == 1) /// Dynamically link the shared object file and retrieve a pointer to /// the designated shared object in this file. Also account for the - /// possiblity to have static services registered when loading the DLL, by - /// ensuring that the dynamic sevice is registered before any of its - /// subordibnate static services. Thus avoiding any finalization order + /// possibility to have static services registered when loading the DLL, by + /// ensuring that the dynamic service is registered before any of its + /// subordinate static services. Thus avoiding any finalization order /// problems. int initialize (const ACE_Service_Type_Factory *, const ACE_TCHAR *parameters); @@ -322,6 +321,7 @@ public: ~Processed_Static_Svc (void); ACE_TCHAR * name_; const ACE_Static_Svc_Descriptor *assd_; + ACE_ALLOC_HOOK_DECLARE; }; /// Get the current ACE_Service_Repository held by this object. diff --git a/deps/acelite/ace/Service_Manager.cpp b/deps/acelite/ace/Service_Manager.cpp index e53edba3a..547648ea5 100644 --- a/deps/acelite/ace/Service_Manager.cpp +++ b/deps/acelite/ace/Service_Manager.cpp @@ -78,11 +78,11 @@ ACE_Service_Manager::info (ACE_TCHAR **strp, size_t length) const return -1; } - ACE_OS::sprintf (buf, - ACE_TEXT ("%d/%s %s"), - sa.get_port_number (), - ACE_TEXT ("tcp"), - ACE_TEXT ("# lists all services in the daemon\n")); + ACE_OS::snprintf (buf, BUFSIZ, + ACE_TEXT ("%d/%s %s"), + sa.get_port_number (), + ACE_TEXT ("tcp"), + ACE_TEXT ("# lists all services in the daemon\n")); if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) { diff --git a/deps/acelite/ace/Service_Manager.h b/deps/acelite/ace/Service_Manager.h index 6573c8588..c8f941669 100644 --- a/deps/acelite/ace/Service_Manager.h +++ b/deps/acelite/ace/Service_Manager.h @@ -4,7 +4,7 @@ /** * @file Service_Manager.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -50,13 +50,15 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Service_Manager : public ACE_Service_Object { public: - // = Initialization and termination hooks. /// Constructor. ACE_Service_Manager (void); /// Destructor. virtual ~ACE_Service_Manager (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: // = Perform the various meta-services. @@ -80,9 +82,6 @@ protected: /// Dump the state of an object. void dump (void) const; - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - protected: int open (const ACE_INET_Addr &sia); diff --git a/deps/acelite/ace/Service_Object.cpp b/deps/acelite/ace/Service_Object.cpp index fc01e29b7..a16b9af04 100644 --- a/deps/acelite/ace/Service_Object.cpp +++ b/deps/acelite/ace/Service_Object.cpp @@ -1,6 +1,9 @@ #include "ace/config-all.h" #include "ace/Service_Object.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (__ACE_INLINE__) #include "ace/Service_Object.inl" @@ -27,11 +30,11 @@ ACE_Service_Type::dump (void) const ACE_TRACE ("ACE_Service_Type::dump"); #endif /* ACE_HAS_DUMP */ - // Using printf, since the log facility may not have been // initialized yet. Using a "//" prefix, in case the executable // happens to be a code generator and the output gets embedded in // the generated C++ code. +#ifndef ACE_LACKS_STDERR ACE_OS::fprintf(stderr, "// [ST] dump, this=%p, name=%s, type=%p, so=%p, active=%d\n", static_cast (this), @@ -39,7 +42,7 @@ ACE_Service_Type::dump (void) const static_cast (this->type_), (this->type_ != 0) ? this->type_->object () : 0, this->active_); - +#endif } ACE_Service_Type::ACE_Service_Type (const ACE_TCHAR *n, @@ -75,7 +78,11 @@ ACE_Service_Type::~ACE_Service_Type (void) ACE_TRACE ("ACE_Service_Type::~ACE_Service_Type"); this->fini (); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(const_cast (this->name_)); +#else delete [] const_cast (this->name_); +#endif /* ACE_HAS_ALLOC_HOOKS */ } int @@ -161,7 +168,12 @@ ACE_Service_Type::name (const ACE_TCHAR *n) { ACE_TRACE ("ACE_Service_Type::name"); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(const_cast (this->name_)); +#else delete [] const_cast (this->name_); +#endif /* ACE_HAS_ALLOC_HOOKS */ + this->name_ = ACE::strnew (n); } diff --git a/deps/acelite/ace/Service_Object.h b/deps/acelite/ace/Service_Object.h index ac66d3c45..0fdbc13b9 100644 --- a/deps/acelite/ace/Service_Object.h +++ b/deps/acelite/ace/Service_Object.h @@ -4,7 +4,7 @@ /** * @file Service_Object.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -44,7 +44,6 @@ class ACE_Export ACE_Service_Object public ACE_Shared_Object { public: - // = Initialization and termination methods. /// Constructor. ACE_Service_Object (ACE_Reactor * = 0); @@ -56,6 +55,9 @@ public: /// Re-enable a previously suspended service. virtual int resume (void); + + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; }; // Forward decl. @@ -89,7 +91,6 @@ public: INVALID_TYPE = -1 }; - // = Initialization and termination methods. ACE_Service_Type (const ACE_TCHAR *n, ACE_Service_Type_Impl *o, const ACE_DLL &dll, @@ -165,7 +166,6 @@ private: class ACE_Export ACE_Service_Object_Ptr { public: - // = Initialization and termination methods. /// Acquire ownership of the @a so. ACE_Service_Object_Ptr (ACE_Service_Object *so); diff --git a/deps/acelite/ace/Service_Repository.cpp b/deps/acelite/ace/Service_Repository.cpp index 4850cc631..bb0755853 100644 --- a/deps/acelite/ace/Service_Repository.cpp +++ b/deps/acelite/ace/Service_Repository.cpp @@ -114,7 +114,7 @@ int ACE_Service_Repository::fini (void) { ACE_TRACE ("ACE_Service_Repository::fini"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); + ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_, -1); int retval = 0; // Do not be tempted to use the prefix decrement operator. Use @@ -209,7 +209,7 @@ int ACE_Service_Repository::close (void) { ACE_TRACE ("ACE_Service_Repository::close"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); + ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_, -1); #ifndef ACE_NLOGGING if(ACE::debug ()) @@ -275,25 +275,21 @@ ACE_Service_Repository::find_i (const ACE_TCHAR name[], bool ignore_suspended) const { ACE_TRACE ("ACE_Service_Repository::find_i"); - size_t i = 0; - array_type::const_iterator element = this->service_array_.end (); + array_type::const_iterator iter; - for (i = 0; i < this->service_array_.size(); i++) + for (iter = this->service_array_.begin(); iter != this->service_array_.end(); ++iter) { - array_type::const_iterator iter = this->service_array_.find (i); - if (iter != this->service_array_.end () - && (*iter).second != 0 // skip any empty slots + if ((*iter).second != 0 // skip any empty slots && ACE_OS::strcmp (name, (*iter).second->name ()) == 0) { - element = iter; break; } } - if (element != this->service_array_.end ()) + if (iter != this->service_array_.end ()) { - slot = i; - if ((*element).second->fini_called ()) + slot = (*iter).first; + if ((*iter).second->fini_called ()) { if (srp != 0) *srp = 0; @@ -301,10 +297,10 @@ ACE_Service_Repository::find_i (const ACE_TCHAR name[], } if (srp != 0) - *srp = (*element).second; + *srp = (*iter).second; if (ignore_suspended - && (*element).second->active () == 0) + && (*iter).second->active () == 0) return -2; return 0; @@ -384,7 +380,7 @@ ACE_Service_Repository::find (const ACE_TCHAR name[], bool ignore_suspended) const { ACE_TRACE ("ACE_Service_Repository::find"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); + ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_, -1); size_t ignore_location = 0; return this->find_i (name, ignore_location, srp, ignore_suspended); } @@ -406,10 +402,8 @@ ACE_Service_Repository::insert (const ACE_Service_Type *sr) // storage { // @TODO: Do we need a recursive mutex here? - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, - ace_mon, - this->lock_, - -1)); + ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, + ace_mon, this->lock_, -1); return_value = find_i (sr->name (), i, &s, false); @@ -463,7 +457,7 @@ ACE_Service_Repository::resume (const ACE_TCHAR name[], const ACE_Service_Type **srp) { ACE_TRACE ("ACE_Service_Repository::resume"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); + ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_, -1); size_t i = 0; if (-1 == this->find_i (name, i, srp, 0)) @@ -479,7 +473,7 @@ ACE_Service_Repository::suspend (const ACE_TCHAR name[], const ACE_Service_Type **srp) { ACE_TRACE ("ACE_Service_Repository::suspend"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); + ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_, -1); size_t i = 0; if (-1 == this->find_i (name, i, srp, 0)) return -1; @@ -497,7 +491,7 @@ ACE_Service_Repository::remove (const ACE_TCHAR name[], ACE_Service_Type **ps) ACE_TRACE ("ACE_Service_Repository::remove"); ACE_Service_Type *s = 0; { - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); + ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_, -1); // Not found!? if (this->remove_i (name, &s) == -1) diff --git a/deps/acelite/ace/Service_Repository.h b/deps/acelite/ace/Service_Repository.h index 4352c540a..241e796d6 100644 --- a/deps/acelite/ace/Service_Repository.h +++ b/deps/acelite/ace/Service_Repository.h @@ -4,7 +4,7 @@ /** * @file Service_Repository.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -20,8 +20,10 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Default_Constants.h" -#include "ace/Recursive_Thread_Mutex.h" +#include "ace/Synch_Traits.h" #include "ace/Array_Map.h" +#include "ace/Malloc_Base.h" +#include "ace/Recursive_Thread_Mutex.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -54,7 +56,6 @@ public: DEFAULT_SIZE = ACE_DEFAULT_SERVICE_REPOSITORY_SIZE }; - // = Initialization and termination methods. /// Initialize the repository. ACE_Service_Repository (size_t size = DEFAULT_SIZE); @@ -130,6 +131,9 @@ public: /// Dump the state of an object. void dump (void) const; + /// Returns a reference to the lock used by the ACE_Service_Repository + ACE_SYNCH_RECURSIVE_MUTEX &lock (void) const; + /// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE; @@ -185,7 +189,11 @@ protected: const ACE_DLL &adll); /// The typedef of the array used to store the services. - typedef ACE_Array_Map array_type; +#if defined (ACE_HAS_ALLOC_HOOKS) + typedef ACE_Array_Map, ACE_Allocator_Std_Adapter > > array_type; +#else + typedef ACE_Array_Map array_type; +#endif /* ACE_HAS_ALLOC_HOOKS */ /// Contains all the configured services. array_type service_array_; @@ -196,10 +204,8 @@ protected: /// Must delete the @c svc_rep_ if true. static bool delete_svc_rep_; -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - /// Synchronization variable for the MT_SAFE Repository - mutable ACE_Recursive_Thread_Mutex lock_; -#endif /* ACE_MT_SAFE */ + /// Synchronization variable for the ACE_Service_Repository. + mutable ACE_SYNCH_RECURSIVE_MUTEX lock_; }; /** @@ -213,7 +219,6 @@ protected: class ACE_Export ACE_Service_Repository_Iterator { public: - // = Initialization and termination methods. /// Constructor initializes the iterator. ACE_Service_Repository_Iterator (ACE_Service_Repository &sr, bool ignored_suspended = true); diff --git a/deps/acelite/ace/Service_Repository.inl b/deps/acelite/ace/Service_Repository.inl index dbe09731f..9cbd38821 100644 --- a/deps/acelite/ace/Service_Repository.inl +++ b/deps/acelite/ace/Service_Repository.inl @@ -19,6 +19,12 @@ ACE_Service_Repository::current_size (void) const return this->service_array_.size (); } +ACE_INLINE ACE_SYNCH_RECURSIVE_MUTEX& +ACE_Service_Repository::lock (void) const +{ + return this->lock_; +} + ACE_INLINE int ACE_Service_Repository_Iterator::done (void) const { diff --git a/deps/acelite/ace/Service_Types.cpp b/deps/acelite/ace/Service_Types.cpp index 94986aaa9..1d835685e 100644 --- a/deps/acelite/ace/Service_Types.cpp +++ b/deps/acelite/ace/Service_Types.cpp @@ -46,7 +46,11 @@ ACE_Service_Type_Impl::~ACE_Service_Type_Impl (void) // It's ok to call this, even though we may have already deleted it // in the fini() method since it would then be NULL. +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(const_cast (this->name_)); +#else delete [] const_cast (this->name_); +#endif /* ACE_HAS_ALLOC_HOOKS */ } int @@ -54,7 +58,11 @@ ACE_Service_Type_Impl::fini (void) const { ACE_TRACE ("ACE_Service_Type_Impl::fini"); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free(const_cast (this->name_)); +#else delete [] const_cast (this->name_); +#endif /* ACE_HAS_ALLOC_HOOKS */ (const_cast (this))->name_ = 0; if (ACE_BIT_ENABLED (this->flags_, @@ -259,10 +267,10 @@ ACE_Module_Type::info (ACE_TCHAR **str, size_t len) const ACE_TRACE ("ACE_Module_Type::info"); ACE_TCHAR buf[BUFSIZ]; - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s"), - this->name (), - ACE_TEXT ("# ACE_Module\n")); + ACE_OS::snprintf (buf, BUFSIZ, + ACE_TEXT ("%s\t %s"), + this->name (), + ACE_TEXT ("# ACE_Module\n")); if (*str == 0 && (*str = ACE_OS::strdup (buf)) == 0) return -1; @@ -349,10 +357,10 @@ ACE_Stream_Type::info (ACE_TCHAR **str, size_t len) const ACE_TRACE ("ACE_Stream_Type::info"); ACE_TCHAR buf[BUFSIZ]; - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s"), - this->name (), - ACE_TEXT ("# STREAM\n")); + ACE_OS::snprintf (buf, BUFSIZ, + ACE_TEXT ("%s\t %s"), + this->name (), + ACE_TEXT ("# STREAM\n")); if (*str == 0 && (*str = ACE_OS::strdup (buf)) == 0) return -1; diff --git a/deps/acelite/ace/Service_Types.h b/deps/acelite/ace/Service_Types.h index 83dba34e1..998cf16ed 100644 --- a/deps/acelite/ace/Service_Types.h +++ b/deps/acelite/ace/Service_Types.h @@ -4,7 +4,7 @@ /** * @file Service_Types.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -37,7 +37,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Service_Type_Impl { public: - // = Initialization and termination methods. ACE_Service_Type_Impl (void *object, const ACE_TCHAR *s_name, u_int flags = 0, @@ -102,7 +101,6 @@ protected: class ACE_Export ACE_Service_Object_Type : public ACE_Service_Type_Impl { public: - // = Initialization method. ACE_Service_Object_Type (void *so, const ACE_TCHAR *name, u_int flags = 0, @@ -132,7 +130,6 @@ private: class ACE_Export ACE_Module_Type : public ACE_Service_Type_Impl { public: - // = Initialization method. ACE_Module_Type (void *m, // Really an ACE_Module *. const ACE_TCHAR *identifier, u_int flags = 0, @@ -173,7 +170,6 @@ private: class ACE_Export ACE_Stream_Type : public ACE_Service_Type_Impl { public: - // = Initialization method. ACE_Stream_Type (void *s, // Really an ACE_Stream *. const ACE_TCHAR *identifier, u_int flags = 0, diff --git a/deps/acelite/ace/Shared_Memory_MM.cpp b/deps/acelite/ace/Shared_Memory_MM.cpp index 6aa03ee2c..c465fe0b1 100644 --- a/deps/acelite/ace/Shared_Memory_MM.cpp +++ b/deps/acelite/ace/Shared_Memory_MM.cpp @@ -1,5 +1,9 @@ #include "ace/Shared_Memory_MM.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/Shared_Memory_MM.inl" #endif /* __ACE_INLINE__ */ diff --git a/deps/acelite/ace/Shared_Memory_MM.h b/deps/acelite/ace/Shared_Memory_MM.h index 26503997d..b0751136c 100644 --- a/deps/acelite/ace/Shared_Memory_MM.h +++ b/deps/acelite/ace/Shared_Memory_MM.h @@ -4,7 +4,7 @@ /** * @file Shared_Memory_MM.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -35,7 +35,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Shared_Memory_MM : public ACE_Shared_Memory { public: - // = Initialization and termination methods. /// Default constructor. ACE_Shared_Memory_MM (void); diff --git a/deps/acelite/ace/Shared_Memory_Pool.cpp b/deps/acelite/ace/Shared_Memory_Pool.cpp index a77275fed..845f595ad 100644 --- a/deps/acelite/ace/Shared_Memory_Pool.cpp +++ b/deps/acelite/ace/Shared_Memory_Pool.cpp @@ -38,6 +38,11 @@ int ACE_Shared_Memory_Pool::in_use (ACE_OFF_T &offset, size_t &counter) { +#ifndef ACE_HAS_SYSV_IPC + ACE_UNUSED_ARG (offset); + ACE_UNUSED_ARG (counter); + ACE_NOTSUP_RETURN (-1); +#else offset = 0; SHM_TABLE *st = reinterpret_cast (this->base_addr_); shmid_ds buf; @@ -54,8 +59,8 @@ ACE_Shared_Memory_Pool::in_use (ACE_OFF_T &offset, offset += buf.shm_segsz; // ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) segment size = %d, offset = %d\n"), buf.shm_segsz, offset)); } - return 0; +#endif } int @@ -63,6 +68,12 @@ ACE_Shared_Memory_Pool::find_seg (const void* const searchPtr, ACE_OFF_T &offset, size_t &counter) { +#ifndef ACE_HAS_SYSV_IPC + ACE_UNUSED_ARG (searchPtr); + ACE_UNUSED_ARG (offset); + ACE_UNUSED_ARG (counter); + ACE_NOTSUP_RETURN (-1); +#else offset = 0; SHM_TABLE *st = reinterpret_cast (this->base_addr_); shmid_ds buf; @@ -92,6 +103,7 @@ ACE_Shared_Memory_Pool::find_seg (const void* const searchPtr, } return 0; +#endif } int @@ -111,7 +123,7 @@ ACE_Shared_Memory_Pool::commit_backing_store_name (size_t rounded_bytes, "exceeded max number of segments = %d, base = %u, offset = %u\n", counter, this->base_addr_, - offset), + static_cast(offset)), -1); else { @@ -232,16 +244,22 @@ ACE_Shared_Memory_Pool::ACE_Shared_Memory_Pool ( this->segment_size_ = options->segment_size_; } +#ifndef ACE_HAS_SYSV_IPC + ACE_UNUSED_ARG (backing_store_name); +#else if (backing_store_name) { // Convert the string into a number that is used as the segment // key. - int segment_key; + int segment_key = 0; +#if !defined (ACE_LACKS_SSCANF) int result = ::sscanf (ACE_TEXT_ALWAYS_CHAR (backing_store_name), "%d", &segment_key); - +#else + int result = 0; +#endif /* ACE_LACKS_SSCANF */ if (result == 0 || result == EOF) // The conversion to a number failed so hash with crc32 // ACE::crc32 is also used in . @@ -257,6 +275,7 @@ ACE_Shared_Memory_Pool::ACE_Shared_Memory_Pool ( } else this->base_shm_key_ = ACE_DEFAULT_SHM_KEY; +#endif // ACE_HAS_SYSV_IPC if (this->signal_handler_.register_handler (SIGSEGV, this) == -1) ACELIB_ERROR ((LM_ERROR, @@ -365,7 +384,9 @@ ACE_Shared_Memory_Pool::init_acquire (size_t nbytes, counter < this->max_segments_; counter++) { +#ifdef ACE_HAS_SYSV_IPC st[counter].key_ = this->base_shm_key_ + counter; +#endif st[counter].shmid_ = 0; st[counter].used_ = 0; } diff --git a/deps/acelite/ace/Shared_Memory_Pool.h b/deps/acelite/ace/Shared_Memory_Pool.h index 23b5e90f3..d8872f18b 100644 --- a/deps/acelite/ace/Shared_Memory_Pool.h +++ b/deps/acelite/ace/Shared_Memory_Pool.h @@ -4,7 +4,7 @@ /** * @file Shared_Memory_Pool.h * - * @author Dougls C. Schmidt + * @author Dougls C. Schmidt * @author Prashant Jain */ //============================================================================= diff --git a/deps/acelite/ace/Shared_Memory_SV.cpp b/deps/acelite/ace/Shared_Memory_SV.cpp index 0b2b5d089..1a7e10b40 100644 --- a/deps/acelite/ace/Shared_Memory_SV.cpp +++ b/deps/acelite/ace/Shared_Memory_SV.cpp @@ -4,6 +4,9 @@ #include "ace/Shared_Memory_SV.inl" #endif /* __ACE_INLINE__ */ +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Shared_Memory_SV.h b/deps/acelite/ace/Shared_Memory_SV.h index 9dca88717..a36f1a196 100644 --- a/deps/acelite/ace/Shared_Memory_SV.h +++ b/deps/acelite/ace/Shared_Memory_SV.h @@ -4,7 +4,7 @@ /** * @file Shared_Memory_SV.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -41,7 +41,6 @@ public: ACE_OPEN = 0 }; - // = Initialization and termination methods. ACE_Shared_Memory_SV (void); ACE_Shared_Memory_SV (key_t id, size_t length, diff --git a/deps/acelite/ace/Shared_Object.h b/deps/acelite/ace/Shared_Object.h index 4749f28da..6497f292e 100644 --- a/deps/acelite/ace/Shared_Object.h +++ b/deps/acelite/ace/Shared_Object.h @@ -4,7 +4,7 @@ /** * @file Shared_Object.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -46,7 +46,6 @@ public: /// Returns information on a service object. virtual int info (ACE_TCHAR **info_string, size_t length = 0) const; - }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Sig_Adapter.cpp b/deps/acelite/ace/Sig_Adapter.cpp index bc6b39ed1..18a5cc9b9 100644 --- a/deps/acelite/ace/Sig_Adapter.cpp +++ b/deps/acelite/ace/Sig_Adapter.cpp @@ -34,6 +34,8 @@ ACE_Sig_Adapter::~ACE_Sig_Adapter () { } +ACE_ALLOC_HOOK_DEFINE(ACE_Sig_Adapter) + int ACE_Sig_Adapter::sigkey (void) { diff --git a/deps/acelite/ace/Sig_Adapter.h b/deps/acelite/ace/Sig_Adapter.h index 23be40055..bb0f791a0 100644 --- a/deps/acelite/ace/Sig_Adapter.h +++ b/deps/acelite/ace/Sig_Adapter.h @@ -4,7 +4,7 @@ /** * @file Sig_Adapter.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -45,6 +45,8 @@ public: /// Called by the to dispatch the signal handler. virtual int handle_signal (int, siginfo_t *, ucontext_t *); + ACE_ALLOC_HOOK_DECLARE; + private: /// Key for this signal handler (used to remove it). int sigkey_; diff --git a/deps/acelite/ace/Sig_Handler.cpp b/deps/acelite/ace/Sig_Handler.cpp index 54c76e03b..e91de0b4f 100644 --- a/deps/acelite/ace/Sig_Handler.cpp +++ b/deps/acelite/ace/Sig_Handler.cpp @@ -10,8 +10,6 @@ #include "ace/Sig_Handler.inl" #endif /* __ACE_INLINE__ */ - - #if defined (ACE_HAS_SIG_C_FUNC) extern "C" void @@ -38,16 +36,14 @@ ace_sig_handlers_dispatch (int signum, siginfo_t *info, ucontext_t *context) #define ace_signal_handlers_dispatcher ACE_SignalHandler(ACE_Sig_Handlers::dispatch) #endif /* ACE_HAS_SIG_C_FUNC */ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL -// Array of Event_Handlers that will handle the signals. +/// Array of Event_Handlers that will handle the signals. ACE_Event_Handler *ACE_Sig_Handler::signal_handlers_[ACE_NSIG]; -// Remembers if a signal has occurred. +/// Remembers if a signal has occurred. sig_atomic_t ACE_Sig_Handler::sig_pending_ = 0; - ACE_ALLOC_HOOK_DEFINE(ACE_Sig_Handler) ACE_Sig_Handler::~ACE_Sig_Handler (void) @@ -133,10 +129,9 @@ ACE_Sig_Handler::handler (int signum, return ACE_Sig_Handler::handler_i (signum, new_sh); } -// Register an ACE_Event_Handler along with the corresponding SIGNUM. -// This method does NOT acquire any locks, so it can be called from a -// signal handler. - +/// Register an ACE_Event_Handler along with the corresponding SIGNUM. +/// This method does NOT acquire any locks, so it can be called from a +/// signal handler. int ACE_Sig_Handler::register_handler_i (int signum, ACE_Event_Handler *new_sh, @@ -171,10 +166,9 @@ ACE_Sig_Handler::register_handler_i (int signum, return -1; } -// Register an ACE_Event_Handler along with the corresponding SIGNUM. -// This method acquires a lock, so it can't be called from a signal -// handler, e.g., . - +/// Register an ACE_Event_Handler along with the corresponding SIGNUM. +/// This method acquires a lock, so it can't be called from a signal +/// handler, e.g., . int ACE_Sig_Handler::register_handler (int signum, ACE_Event_Handler *new_sh, @@ -222,8 +216,7 @@ ACE_Sig_Handler::remove_handler_i (int signum, return new_disp->register_action (signum, old_disp); } -// Remove an ACE_Event_Handler. - +/// Remove an ACE_Event_Handler. int ACE_Sig_Handler::remove_handler (int signum, ACE_Sig_Action *new_disp, @@ -242,9 +235,8 @@ ACE_Sig_Handler::remove_handler (int signum, return -1; } -// Master dispatcher function that gets called by a signal handler and -// dispatches one handler... - +/// Master dispatcher function that gets called by a signal handler and +/// dispatches one handler... void ACE_Sig_Handler::dispatch (int signum, siginfo_t *siginfo, @@ -287,13 +279,13 @@ ACE_Sig_Handler::dispatch (int signum, // from compiling... #define ACE_MAX_SIGNAL_HANDLERS ((size_t) 20) -// Keeps track of the id that uniquely identifies each registered -// signal handler. This id can be used to cancel a timer via the -// method. +/// Keeps track of the id that uniquely identifies each registered +/// signal handler. This id can be used to cancel a timer via the +/// method. int ACE_Sig_Handlers::sigkey_ = 0; -// If this is true then a 3rd party library has registered a -// handler... +/// If this is true then a 3rd party library has registered a +/// handler... bool ACE_Sig_Handlers::third_party_sig_handler_ = false; // Make life easier by defining typedefs... @@ -339,9 +331,8 @@ ACE_Sig_Handlers::dump (void) const #endif /* ACE_HAS_DUMP */ } -// This is the method that does all the dirty work... The basic -// structure of this method was devised by Detlef Becker. - +/// This is the method that does all the dirty work... The basic +/// structure of this method was devised by Detlef Becker. int ACE_Sig_Handlers::register_handler (int signum, ACE_Event_Handler *new_sh, @@ -404,10 +395,10 @@ ACE_Sig_Handlers::register_handler (int signum, ACE_Sig_Adapter (new_sh, ++ACE_Sig_Handlers::sigkey_), -1); + // Add the ACE signal handler to the set of handlers for this // signal (make sure it goes before the external one if there is // one of these). - int result = ACE_Sig_Handlers_Set::instance (signum)->insert (ace_sig_adapter); if (result == -1) @@ -467,11 +458,10 @@ ACE_Sig_Handlers::register_handler (int signum, return -1; } -// Remove the ACE_Event_Handler currently associated with . -// Install the new disposition (if given) and return the previous -// disposition (if desired by the caller). Returns 0 on success and -// -1 if is invalid. - +/// Remove the ACE_Event_Handler currently associated with @a signum. +/// Install the new disposition (if given) and return the previous +/// disposition (if desired by the caller). Returns 0 on success and +// -1 if @a signum is invalid. int ACE_Sig_Handlers::remove_handler (int signum, ACE_Sig_Action *new_disp, @@ -492,7 +482,6 @@ ACE_Sig_Handlers::remove_handler (int signum, ACE_SIG_HANDLERS_ITERATOR handler_iterator (*handler_set); // Iterate through the set of handlers for this signal. - for (ACE_Event_Handler **eh; handler_iterator.next (eh) != 0; ) @@ -503,7 +492,6 @@ ACE_Sig_Handlers::remove_handler (int signum, // Remove the handler if (1) its key matches the key we've // been told to remove or (2) if we've been told to remove // *all* handlers (i.e., == -1). - if (sh->sigkey () == sigkey || sigkey == -1) { handler_set->remove (*eh); @@ -516,7 +504,6 @@ ACE_Sig_Handlers::remove_handler (int signum, // If there are no more handlers left for a signal then // register the new disposition or restore the default // disposition. - ACE_Sig_Action sa (SIG_DFL, (sigset_t *) 0); if (new_disp == 0) @@ -530,9 +517,8 @@ ACE_Sig_Handlers::remove_handler (int signum, return -1; } -// Master dispatcher function that gets called by a signal handler and -// dispatches *all* the handlers... - +/// Master dispatcher function that gets called by a signal handler and +/// dispatches *all* the handlers... void ACE_Sig_Handlers::dispatch (int signum, siginfo_t *siginfo, @@ -571,10 +557,9 @@ ACE_Sig_Handlers::dispatch (int signum, } } -// Return the first item in the list of handlers. Note that this will -// trivially provide the same behavior as the ACE_Sig_Handler -// version if there is only 1 handler registered! - +/// Return the first item in the list of handlers. Note that this will +/// trivially provide the same behavior as the ACE_Sig_Handler +/// version if there is only 1 handler registered! ACE_Event_Handler * ACE_Sig_Handlers::handler (int signum) { @@ -587,12 +572,11 @@ ACE_Sig_Handlers::handler (int signum) return *eh; } -// The following is a strange bit of logic that tries to give the same -// semantics as what happens in ACE_Sig_Handler when we replace the -// current signal handler with a new one. Note that if there is only -// one signal handler the behavior will be identical. If there is -// more than one handler then things get weird... - +/// The following is a strange bit of logic that tries to give the same +/// semantics as what happens in ACE_Sig_Handler when we replace the +/// current signal handler with a new one. Note that if there is only +/// one signal handler the behavior will be identical. If there is +/// more than one handler then things get weird... ACE_Event_Handler * ACE_Sig_Handlers::handler (int signum, ACE_Event_Handler *new_sh) { diff --git a/deps/acelite/ace/Sig_Handler.h b/deps/acelite/ace/Sig_Handler.h index cf6467390..1bd2a66d4 100644 --- a/deps/acelite/ace/Sig_Handler.h +++ b/deps/acelite/ace/Sig_Handler.h @@ -4,7 +4,7 @@ /** * @file Sig_Handler.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -195,7 +195,7 @@ public: // = Set/get the handler associated with a particular signal. - /// Return the head of the list of s associated with + /// Return the head of the list of ACE_Sig_Handlers associated with /// SIGNUM. virtual ACE_Event_Handler *handler (int signum); @@ -209,7 +209,7 @@ public: /** * Callback routine registered with sigaction(2) that dispatches the - * method of all the pre-registered + * handle_signal() method of all the pre-registered * ACE_Event_Handlers for @a signum */ static void dispatch (int signum, siginfo_t *, ucontext_t *); diff --git a/deps/acelite/ace/Signal.cpp b/deps/acelite/ace/Signal.cpp index b8434592d..b04b80042 100644 --- a/deps/acelite/ace/Signal.cpp +++ b/deps/acelite/ace/Signal.cpp @@ -1,6 +1,10 @@ #include "ace/Signal.h" // #include "ace/Log_Category.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/Signal.inl" #endif /* __ACE_INLINE__ */ diff --git a/deps/acelite/ace/Signal.h b/deps/acelite/ace/Signal.h index 924369d47..416722eb8 100644 --- a/deps/acelite/ace/Signal.h +++ b/deps/acelite/ace/Signal.h @@ -4,7 +4,7 @@ /** * @file Signal.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -97,7 +97,6 @@ private: class ACE_Export ACE_Sig_Action { public: - // = Initialization methods. /// Default constructor. Initializes everything to 0. ACE_Sig_Action (void); @@ -153,8 +152,12 @@ public: sigset_t *sigmask = 0, int flags = 0); - /// Copy constructor. - ACE_Sig_Action (const ACE_Sig_Action &s); +#if defined (ACE_HAS_CPP11) + ACE_Sig_Action (const ACE_Sig_Action&) = default; + ACE_Sig_Action (ACE_Sig_Action&&) = default; + ACE_Sig_Action& operator = (ACE_Sig_Action const &) = default; + ACE_Sig_Action &operator = (ACE_Sig_Action&&) = default; +#endif /* ACE_HAS_CPP11 */ /// Default dtor. ~ACE_Sig_Action (void); @@ -219,7 +222,6 @@ private: class ACE_Export ACE_Sig_Guard { public: - // = Initialization and termination methods. /// This is kind of conditional Guard, needed when guard should be /// activated only when a specific condition met. When condition == /// true (default), Guard is activated diff --git a/deps/acelite/ace/Signal.inl b/deps/acelite/ace/Signal.inl index ff2f52403..64ac6c049 100644 --- a/deps/acelite/ace/Signal.inl +++ b/deps/acelite/ace/Signal.inl @@ -168,14 +168,6 @@ ACE_Sig_Action::operator struct sigaction * () return &this->sa_; } -ACE_INLINE -ACE_Sig_Action::ACE_Sig_Action (const ACE_Sig_Action &s) - // : sa_ () -{ - ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action"); - *this = s; // structure copy. -} - ACE_INLINE int ACE_Sig_Action::register_action (int signum, ACE_Sig_Action *oaction) { diff --git a/deps/acelite/ace/Singleton.cpp b/deps/acelite/ace/Singleton.cpp index 89dc15432..52ca2b53d 100644 --- a/deps/acelite/ace/Singleton.cpp +++ b/deps/acelite/ace/Singleton.cpp @@ -19,6 +19,13 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Singleton) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Unmanaged_Singleton) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_TSS_Singleton) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Unmanaged_TSS_Singleton) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_DLL_Singleton_T) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_DLL_Singleton_Adapter_T) + template void ACE_Singleton::dump (void) { @@ -76,7 +83,12 @@ ACE_Singleton::instance (void) // Obtain a lock from the ACE_Object_Manager. The pointer // is static, so we only obtain one per ACE_Singleton // instantiation. +#if defined(ACE_FACE_SAFETY_BASE) + static ACE_LOCK the_lock; + static ACE_LOCK *lock = &the_lock; +#else /* ACE_FACE_SAFETY_BASE */ static ACE_LOCK *lock = 0; +#endif /* ACE_FACE_SAFETY_BASE */ if (ACE_Object_Manager::get_singleton_lock (lock) != 0) // Failed to acquire the lock! return 0; @@ -89,8 +101,11 @@ ACE_Singleton::instance (void) ACE_NEW_RETURN (singleton, (ACE_Singleton), 0); // Register for destruction with ACE_Object_Manager. +#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE == 0) ACE_Object_Manager::at_exit (singleton, 0, typeid (TYPE).name ()); -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) +#else + ACE_Object_Manager::at_exit (singleton, &lock, + typeid (TYPE).name ()); } #endif /* ACE_MT_SAFE */ } @@ -100,11 +115,21 @@ ACE_Singleton::instance (void) } template void -ACE_Singleton::cleanup (void *) +ACE_Singleton::cleanup (void *param) { ACE_Object_Manager::remove_at_exit (this); delete this; ACE_Singleton::instance_i () = 0; + +#if !defined ACE_MT_SAFE || ACE_MT_SAFE == 0 || defined ACE_FACE_SAFETY_BASE + ACE_UNUSED_ARG (param); +#else + if (param) + { + ACE_LOCK **lock = static_cast (param); + *lock = 0; + } +#endif } template void @@ -188,7 +213,12 @@ ACE_Unmanaged_Singleton::instance (void) // Obtain a lock from the ACE_Object_Manager. The pointer // is static, so we only obtain one per // ACE_Unmanaged_Singleton instantiation. +#if defined(ACE_FACE_SAFETY_BASE) + static ACE_LOCK the_lock; + static ACE_LOCK *lock = &the_lock; +#else /* ACE_FACE_SAFETY_BASE */ static ACE_LOCK *lock = 0; +#endif /* ACE_FACE_SAFETY_BASE */ if (ACE_Object_Manager::get_singleton_lock (lock) != 0) // Failed to acquire the lock! return 0; @@ -276,7 +306,12 @@ ACE_TSS_Singleton::instance (void) // Obtain a lock from the ACE_Object_Manager. The pointer // is static, so we only obtain one per ACE_Singleton instantiation. +#if defined(ACE_FACE_SAFETY_BASE) + static ACE_LOCK the_lock; + static ACE_LOCK *lock = &the_lock; +#else /* ACE_FACE_SAFETY_BASE */ static ACE_LOCK *lock = 0; +#endif /* ACE_FACE_SAFETY_BASE */ if (ACE_Object_Manager::get_singleton_lock (lock) != 0) // Failed to acquire the lock! return 0; @@ -367,7 +402,12 @@ ACE_Unmanaged_TSS_Singleton::instance (void) // Obtain a lock from the ACE_Object_Manager. The pointer // is static, so we only obtain one per // ACE_Unmanaged_Singleton instantiation. +#if defined(ACE_FACE_SAFETY_BASE) + static ACE_LOCK the_lock; + static ACE_LOCK *lock = &the_lock; +#else /* ACE_FACE_SAFETY_BASE */ static ACE_LOCK *lock = 0; +#endif /* ACE_FACE_SAFETY_BASE */ if (ACE_Object_Manager::get_singleton_lock (lock) != 0) // Failed to acquire the lock! return 0; @@ -474,7 +514,12 @@ ACE_DLL_Singleton_T::instance (void) // Obtain a lock from the ACE_Object_Manager. The pointer // is static, so we only obtain one per // ACE_Unmanaged_Singleton instantiation. +#if defined(ACE_FACE_SAFETY_BASE) + static ACE_LOCK the_lock; + static ACE_LOCK *lock = &the_lock; +#else /* ACE_FACE_SAFETY_BASE */ static ACE_LOCK *lock = 0; +#endif /* ACE_FACE_SAFETY_BASE */ if (ACE_Object_Manager::get_singleton_lock (lock) != 0) // Failed to acquire the lock! return 0; diff --git a/deps/acelite/ace/Singleton.h b/deps/acelite/ace/Singleton.h index aac7f787e..d0cd95f4a 100644 --- a/deps/acelite/ace/Singleton.h +++ b/deps/acelite/ace/Singleton.h @@ -7,7 +7,7 @@ * @brief * * @author Tim Harrison - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt * @author Chris Lahey * @author Rich Christy * @author David Levine @@ -90,6 +90,9 @@ public: /// Dump the state of the object. static void dump (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /// Default constructor. ACE_Singleton (void); @@ -136,6 +139,9 @@ public: /// Dump the state of the object. static void dump (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /// Default constructor. ACE_Unmanaged_Singleton (void); @@ -181,6 +187,9 @@ public: /// Dump the state of the object. static void dump (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /// Default constructor. ACE_TSS_Singleton (void); @@ -226,6 +235,9 @@ public: /// Dump the state of the object. static void dump (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /// Default constructor. ACE_Unmanaged_TSS_Singleton (void); @@ -284,6 +296,9 @@ public: const ACE_TCHAR *name (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /// Default constructor. ACE_DLL_Singleton_T (void); @@ -308,6 +323,9 @@ class ACE_DLL_Singleton_Adapter_T : public TYPE { public: const ACE_TCHAR *dll_name (void); + + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Sock_Connect.cpp b/deps/acelite/ace/Sock_Connect.cpp index 2b10ecd24..43606fa2f 100644 --- a/deps/acelite/ace/Sock_Connect.cpp +++ b/deps/acelite/ace/Sock_Connect.cpp @@ -213,7 +213,11 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, return -1; else ACE_OS::memcpy ((char *) &ip_addr.sin_addr.s_addr, +# ifdef ACE_HOSTENT_H_ADDR + (char *) hp->ACE_HOSTENT_H_ADDR, +# else (char *) hp->h_addr, +# endif hp->h_length); } else @@ -336,6 +340,28 @@ ACE::get_fqdn (ACE_INET_Addr const & addr, char hostname[], size_t len) { +#ifndef ACE_LACKS_GETNAMEINFO + + const socklen_t addr_size = +# ifdef ACE_HAS_IPV6 + (addr.get_type () == PF_INET6) ? sizeof (sockaddr_in6) : +# endif + sizeof (sockaddr_in); + + if (ACE_OS::getnameinfo ((const sockaddr *) addr.get_addr (), + addr_size, hostname, + static_cast (len), + 0, 0, NI_NAMEREQD) != 0) + return -1; + + if (ACE::debug ()) + ACELIB_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) - ACE::get_fqdn, ") + ACE_TEXT ("canonical host name is %C\n"), + hostname)); + + return 0; +#else // below, ACE_LACKS_GETNAMEINFO int h_error; // Not the same as errno! hostent hentry; ACE_HOSTENT_DATA buf; @@ -349,7 +375,7 @@ ACE::get_fqdn (ACE_INET_Addr const & addr, ip_addr_size = sizeof sock_addr->sin_addr; ip_addr = (char*) &sock_addr->sin_addr; } -#ifdef ACE_HAS_IPV6 +# ifdef ACE_HAS_IPV6 else { sockaddr_in6 * sock_addr = @@ -358,7 +384,7 @@ ACE::get_fqdn (ACE_INET_Addr const & addr, ip_addr_size = sizeof sock_addr->sin6_addr; ip_addr = (char*) &sock_addr->sin6_addr; } -#endif /* ACE_HAS_IPV6 */ +# endif /* ACE_HAS_IPV6 */ // get the host entry for the address in question hostent * const hp = ACE_OS::gethostbyaddr_r (ip_addr, @@ -434,6 +460,7 @@ ACE::get_fqdn (ACE_INET_Addr const & addr, } return 0; +#endif /* ACE_LACKS_GETNAMEINFO */ } #if defined (ACE_WIN32) @@ -1220,7 +1247,7 @@ ACE::get_ip_interfaces (size_t &count, ACE_INET_Addr *&addrs) #endif /* !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) && !defined (ACE_HAS_RTEMS) && !defined (__Lynx__) */ } -# if defined (ACE_HAS_IPV6) +# if defined (ACE_HAS_IPV6) && !defined (ACE_LACKS_FSCANF) // Retrieve IPv6 local interfaces by scanning /proc/net/if_inet6 if // it exists. If we cannot open it then ignore possible IPv6 // interfaces, we did our best;-) @@ -1246,12 +1273,12 @@ ACE::get_ip_interfaces (size_t &count, ACE_INET_Addr *&addrs) // resolve the resulting text using getaddrinfo(). const char* ip_fmt = "%s:%s:%s:%s:%s:%s:%s:%s%%%d"; - ACE_OS::sprintf (s_ipaddr, - ip_fmt, - addr_p[0], addr_p[1], addr_p[2], addr_p[3], - addr_p[4], addr_p[5], addr_p[6], addr_p[7], scopeid); + ACE_OS::snprintf (s_ipaddr, 64, ip_fmt, + addr_p[0], addr_p[1], addr_p[2], addr_p[3], + addr_p[4], addr_p[5], addr_p[6], addr_p[7], + scopeid); - error = getaddrinfo (s_ipaddr, 0, &hints, &res0); + error = ACE_OS::getaddrinfo (s_ipaddr, 0, &hints, &res0); if (error) continue; @@ -1261,12 +1288,12 @@ ACE::get_ip_interfaces (size_t &count, ACE_INET_Addr *&addrs) addrs[count].set(reinterpret_cast (res0->ai_addr), res0->ai_addrlen); ++count; } - freeaddrinfo (res0); + ACE_OS::freeaddrinfo (res0); } ACE_OS::fclose (fp); } -# endif /* ACE_HAS_IPV6 */ +# endif /* ACE_HAS_IPV6 && !ACE_LACKS_FSCANF */ return 0; #else @@ -1318,7 +1345,13 @@ return 0; struct ifconf ifcfg; size_t ifreq_size = num_ifs * sizeof (struct ifreq); - struct ifreq *p_ifs = (struct ifreq *) ACE_OS::malloc (ifreq_size); + struct ifreq *p_ifs; + +#if defined (ACE_HAS_ALLOC_HOOKS) + p_ifs = (struct IFREQ *)ACE_Allocator::instance()->malloc (ifreq_size); +#else + p_ifs = (struct ifreq *) ACE_OS::malloc (ifreq_size); +#endif /* ACE_HAS_ALLOC_HOOKS */ if (!p_ifs) { @@ -1336,7 +1369,12 @@ return 0; SIOCGIFCONF_CMD, (caddr_t) &ifcfg) == -1) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (ifcfg.ifc_req); +#else ACE_OS::free (ifcfg.ifc_req); +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACELIB_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE::count_interfaces:") @@ -1359,9 +1397,9 @@ return 0; break; ++if_count; -#if !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) && !defined (ACE_HAS_RTEMS) && !defined (__Lynx__) +# if !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) && !defined (ACE_HAS_RTEMS) && !defined (__Lynx__) ++p_ifs; -#else +# else if (p_ifs->ifr_addr.sa_len <= sizeof (struct sockaddr)) { ++p_ifs; @@ -1371,10 +1409,14 @@ return 0; p_ifs = (struct ifreq *) (p_ifs->ifr_addr.sa_len + (caddr_t) &p_ifs->ifr_addr); } -#endif /* !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) && !defined (ACE_HAS_RTEMS) && !defined (__Lynx__)*/ +# endif /* !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) && !defined (ACE_HAS_RTEMS) && !defined (__Lynx__) */ } - ACE_OS::free (ifcfg.ifc_req); +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance()->free (ifcfg.ifc_req); +#else + ACE_OS::free (ifcfg.ifc_req); +#endif /* ACE_HAS_ALLOC_HOOKS */ # if defined (ACE_HAS_IPV6) FILE* fp = 0; @@ -1388,7 +1430,7 @@ return 0; } ACE_OS::fclose (fp); } -# endif /* ACE_HAS_IPV6 */ +# endif /* ACE_HAS_IPV6 && !ACE_LACKS_FSCANF */ how_many = if_count; return 0; @@ -1433,7 +1475,7 @@ ip_check (int &ipvn_enabled, int pf) #if defined (ACE_WIN32) // as of the release of Windows 2008, even hosts that have IPv6 interfaces disabled // will still permit the creation of a PF_INET6 socket, thus rendering the socket - // creation test inconsistent. The reccommended solution is to get the list of + // creation test inconsistent. The recommended solution is to get the list of // endpoint addresses and see if any match the desired family. ACE_INET_Addr *if_addrs = 0; size_t if_cnt = 0; diff --git a/deps/acelite/ace/Stack_Trace.cpp b/deps/acelite/ace/Stack_Trace.cpp index 9836a0e1f..d4be21962 100644 --- a/deps/acelite/ace/Stack_Trace.cpp +++ b/deps/acelite/ace/Stack_Trace.cpp @@ -28,6 +28,8 @@ #include "ace/OS_NS_string.h" #include "ace/OS_NS_stdio.h" +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + /* This is ugly, simply because it's very platform-specific. */ @@ -55,7 +57,16 @@ determine_starting_frame (ssize_t initial_frame, ssize_t offset) return ACE_MAX( initial_frame + offset, static_cast(0)); } -#if (defined(__GLIBC__) || defined(ACE_HAS_EXECINFO_H)) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) +#if defined(ACE_FACE_SAFETY_BASE) && !defined(ACE_FACE_DEV) +void +ACE_Stack_Trace::generate_trace (ssize_t starting_frame_offset, size_t num_frames) +{ + ACE_UNUSED_ARG (starting_frame_offset); + ACE_UNUSED_ARG (num_frames); + ACE_OS::strcpy (&this->buf_[0], UNABLE_TO_GET_TRACE); +} + +#elif (defined(__GLIBC__) || defined(ACE_HAS_EXECINFO_H)) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) // This is the code for glibc # include @@ -652,6 +663,22 @@ cs_operate(int (*func)(struct frame_state const *, void *), void *usrarg, fs.sf.AddrFrame.Mode = AddrModeFlat; fs.sf.AddrBStore.Mode = AddrModeFlat; fs.sf.AddrStack.Mode = AddrModeFlat; +# elif defined (_M_ARM) + DWORD machine = IMAGE_FILE_MACHINE_ARM; + fs.sf.AddrPC.Offset = c.Pc; + fs.sf.AddrFrame.Offset = c.R11; + fs.sf.AddrStack.Offset = c.Sp; + fs.sf.AddrPC.Mode = AddrModeFlat; + fs.sf.AddrFrame.Mode = AddrModeFlat; + fs.sf.AddrStack.Mode = AddrModeFlat; +# elif defined (_M_ARM64) + DWORD machine = IMAGE_FILE_MACHINE_ARM64; + fs.sf.AddrPC.Offset = c.Pc; + fs.sf.AddrFrame.Offset = c.Fp; + fs.sf.AddrStack.Offset = c.Sp; + fs.sf.AddrPC.Mode = AddrModeFlat; + fs.sf.AddrFrame.Mode = AddrModeFlat; + fs.sf.AddrStack.Mode = AddrModeFlat; # endif fs.pSym = (PSYMBOL_INFO) GlobalAlloc (GMEM_FIXED, @@ -724,3 +751,4 @@ ACE_Stack_Trace::generate_trace (ssize_t, size_t) } #endif +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Stack_Trace.h b/deps/acelite/ace/Stack_Trace.h index f3f91e09e..14cdcc012 100644 --- a/deps/acelite/ace/Stack_Trace.h +++ b/deps/acelite/ace/Stack_Trace.h @@ -23,6 +23,8 @@ # define ACE_STACK_TRACE_SYMBUFSIZ 4096 # endif +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + /** * @class ACE_Stack_Trace * @@ -100,6 +102,8 @@ private: void generate_trace (ssize_t starting_frame_offset, size_t num_frames); }; +ACE_END_VERSIONED_NAMESPACE_DECL + #include /**/ "ace/post.h" #endif /* ACE_STACK_TRACE_H */ diff --git a/deps/acelite/ace/Static_Object_Lock.h b/deps/acelite/ace/Static_Object_Lock.h index 50db45171..fc167062f 100644 --- a/deps/acelite/ace/Static_Object_Lock.h +++ b/deps/acelite/ace/Static_Object_Lock.h @@ -51,26 +51,5 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ -// hack to get around errors while compiling using split-cpp -#if defined (ACE_HAS_THREADS) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -# if defined (ACE_IS_SPLITTING) -typedef ACE_Cleanup_Adapter ACE_Static_Object_Lock_Type; - -# if defined (__GNUC__) -// With g++, suppress the warning that this is unused. -static ACE_Static_Object_Lock_Type *ACE_Static_Object_Lock_lock __attribute__ ((unused)) = 0; -# else -static ACE_Static_Object_Lock_Type *ACE_Static_Object_Lock_lock = 0; -# endif /* __GNUC__ */ - -# endif /* ACE_IS_SPLITTING */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - #include /**/ "ace/post.h" #endif /* ACE_STATIC_OBJECT_LOCK_H */ diff --git a/deps/acelite/ace/Stats.cpp b/deps/acelite/ace/Stats.cpp index 82bddb5cd..b47c4857f 100644 --- a/deps/acelite/ace/Stats.cpp +++ b/deps/acelite/ace/Stats.cpp @@ -217,13 +217,13 @@ ACE_Stats::print_summary (const u_int precision, // Build a format string, in case the C library doesn't support %*u. ACE_TCHAR format[32]; if (tmp_precision == 0) - ACE_OS::sprintf (format, ACE_TEXT ("%%%d"), tmp_precision); + ACE_OS::snprintf (format, 32, ACE_TEXT ("%%%d"), tmp_precision); else - ACE_OS::sprintf (format, ACE_TEXT ("%%d.%%0%du"), tmp_precision); + ACE_OS::snprintf (format, 32, ACE_TEXT ("%%d.%%0%du"), tmp_precision); ACE_Stats_Value u (tmp_precision); ((ACE_Stats *) this)->mean (u, scale_factor); - ACE_OS::sprintf (mean_string, format, u.whole (), u.fractional ()); + ACE_OS::snprintf (mean_string, 128, format, u.whole (), u.fractional ()); ACE_Stats_Value sd (tmp_precision); if (((ACE_Stats *) this)->std_dev (sd, scale_factor)) @@ -235,7 +235,8 @@ ACE_Stats::print_summary (const u_int precision, { success = 1; } - ACE_OS::sprintf (std_dev_string, format, sd.whole (), sd.fractional ()); + ACE_OS::snprintf (std_dev_string, 128, format, sd.whole (), + sd.fractional ()); ACE_Stats_Value minimum (tmp_precision), maximum (tmp_precision); if (min_ != 0) @@ -248,10 +249,10 @@ ACE_Stats::print_summary (const u_int precision, const ACE_UINT64 m (max_); quotient (m, scale_factor, maximum); } - ACE_OS::sprintf (min_string, format, - minimum.whole (), minimum.fractional ()); - ACE_OS::sprintf (max_string, format, - maximum.whole (), maximum.fractional ()); + ACE_OS::snprintf (min_string, 128, format, + minimum.whole (), minimum.fractional ()); + ACE_OS::snprintf (max_string, 128, format, + maximum.whole (), maximum.fractional ()); } if (success == 1) diff --git a/deps/acelite/ace/Stats.h b/deps/acelite/ace/Stats.h index 34962e48d..e3f16fdd5 100644 --- a/deps/acelite/ace/Stats.h +++ b/deps/acelite/ace/Stats.h @@ -165,7 +165,13 @@ public: */ int print_summary (const u_int precision, const ACE_UINT32 scale_factor = 1, - FILE * = stdout) const; + FILE * +#ifdef ACE_LACKS_STDOUT + = 0 +#else + = stdout +#endif + ) const; /// Initialize internal state. void reset (void); diff --git a/deps/acelite/ace/Strategies_T.cpp b/deps/acelite/ace/Strategies_T.cpp index f42a74a3b..723bc1e27 100644 --- a/deps/acelite/ace/Strategies_T.cpp +++ b/deps/acelite/ace/Strategies_T.cpp @@ -436,7 +436,7 @@ ACE_Process_Strategy::activate_svc_handler (SVC_HANDLER *svc_handle // If is non-0 then we won't create zombies. switch (ACE::fork (ACE_TEXT ("child"), this->flags_)) { - case -1: + case static_cast(-1): { ACE_Errno_Guard error (errno); svc_handler->close (); @@ -1489,16 +1489,15 @@ ACE_NOOP_Concurrency_Strategy::activate_svc_handler (SVC_HANDLER *, return 0; } - -ACE_ALLOC_HOOK_DEFINE(ACE_Creation_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Singleton_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_DLL_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Concurrency_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Connect_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Process_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Accept_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Creation_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Singleton_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_DLL_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Concurrency_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Reactive_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Thread_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Process_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tca(ACE_Accept_Strategy) +ACE_ALLOC_HOOK_DEFINE_Tco(ACE_Connect_Strategy) ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Strategies_T.h b/deps/acelite/ace/Strategies_T.h index 7b405e2b4..c505b4137 100644 --- a/deps/acelite/ace/Strategies_T.h +++ b/deps/acelite/ace/Strategies_T.h @@ -4,7 +4,7 @@ /** * @file Strategies_T.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -82,14 +82,11 @@ template class ACE_Creation_Strategy { public: - // Useful STL-style traits. typedef typename SVC_HANDLER::addr_type addr_type; typedef SVC_HANDLER handler_type; typedef typename SVC_HANDLER::stream_type stream_type; - // = Initialization and termination methods. - /// Default constructor. ACE_Creation_Strategy (ACE_Thread_Manager * = 0, ACE_Reactor * = ACE_Reactor::instance ()); @@ -139,11 +136,9 @@ template class ACE_Singleton_Strategy : public ACE_Creation_Strategy { public: - // Useful STL-style traits. typedef ACE_Creation_Strategy base_type; - // = Initialization and termination methods. ACE_Singleton_Strategy (SVC_HANDLER * = 0, ACE_Thread_Manager * = 0); int open (SVC_HANDLER *, @@ -496,14 +491,12 @@ template class ACE_Accept_Strategy { public: - // Useful STL-style traits. typedef ACE_PEER_ACCEPTOR_ADDR addr_type; typedef ACE_PEER_ACCEPTOR acceptor_type; typedef SVC_HANDLER handler_type; typedef typename SVC_HANDLER::stream_type stream_type; - // = Initialization and termination methods. /// Default constructor. ACE_Accept_Strategy (ACE_Reactor *reactor = ACE_Reactor::instance ()); @@ -563,14 +556,12 @@ template class ACE_Connect_Strategy { public: - // Useful STL-style traits. typedef ACE_PEER_CONNECTOR_ADDR addr_type; typedef ACE_PEER_CONNECTOR connector_type; typedef SVC_HANDLER handler_type; typedef typename SVC_HANDLER::stream_type stream_type; - // = Initialization and termination methods. /// Default constructor. ACE_Connect_Strategy (void); @@ -629,14 +620,11 @@ template class ACE_Scheduling_Strategy { public: - // Useful STL-style traits. typedef typename SVC_HANDLER::addr_type addr_type; typedef SVC_HANDLER handler_type; typedef typename SVC_HANDLER::stream_type stream_type; - // = Initialization and termination methods. - /// Constructor ACE_Scheduling_Strategy (SVC_HANDLER * = 0); @@ -669,11 +657,9 @@ class ACE_Schedule_All_Reactive_Strategy : public ACE_Scheduling_Strategy { public: - // Useful STL-style traits. typedef ACE_Scheduling_Strategy base_type; - // = Initialization and termination methods. /// Constructor ACE_Schedule_All_Reactive_Strategy (SVC_HANDLER * = 0); @@ -708,11 +694,9 @@ class ACE_Schedule_All_Threaded_Strategy : public ACE_Scheduling_Strategy { public: - // Useful STL-style traits. typedef ACE_Scheduling_Strategy base_type; - // = Initialization and termination methods. /// Constructor ACE_Schedule_All_Threaded_Strategy (SVC_HANDLER * = 0); diff --git a/deps/acelite/ace/Stream.cpp b/deps/acelite/ace/Stream.cpp index a9d7ee6ad..47315c401 100644 --- a/deps/acelite/ace/Stream.cpp +++ b/deps/acelite/ace/Stream.cpp @@ -19,7 +19,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Stream) +ACE_ALLOC_HOOK_DEFINE_Tyc(ACE_Stream) // Give some idea of what the heck is going on in a stream! diff --git a/deps/acelite/ace/Stream.h b/deps/acelite/ace/Stream.h index de0aed8af..181d35139 100644 --- a/deps/acelite/ace/Stream.h +++ b/deps/acelite/ace/Stream.h @@ -4,7 +4,7 @@ /** * @file Stream.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -210,7 +210,6 @@ template class ACE_Stream_Iterator { public: - // = Initialization method. ACE_Stream_Iterator (const ACE_Stream &sr); // = Iteration methods. diff --git a/deps/acelite/ace/Stream_Modules.cpp b/deps/acelite/ace/Stream_Modules.cpp index 0dec9baa9..4533d1b37 100644 --- a/deps/acelite/ace/Stream_Modules.cpp +++ b/deps/acelite/ace/Stream_Modules.cpp @@ -11,7 +11,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Stream_Head) +ACE_ALLOC_HOOK_DEFINE_Tyc(ACE_Stream_Head) template ACE_Stream_Head::ACE_Stream_Head (void) @@ -151,7 +151,7 @@ ACE_Stream_Head::fini (void) return 0; } -ACE_ALLOC_HOOK_DEFINE(ACE_Stream_Tail) +ACE_ALLOC_HOOK_DEFINE_Tyc(ACE_Stream_Tail) template ACE_Stream_Tail::ACE_Stream_Tail (void) @@ -295,7 +295,7 @@ ACE_Stream_Tail::fini (void) return 0; } -ACE_ALLOC_HOOK_DEFINE(ACE_Thru_Task) +ACE_ALLOC_HOOK_DEFINE_Tyc(ACE_Thru_Task) template ACE_Thru_Task::ACE_Thru_Task (void) diff --git a/deps/acelite/ace/Stream_Modules.h b/deps/acelite/ace/Stream_Modules.h index 86432727a..1760e3b89 100644 --- a/deps/acelite/ace/Stream_Modules.h +++ b/deps/acelite/ace/Stream_Modules.h @@ -4,7 +4,7 @@ /** * @file Stream_Modules.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/String_Base.cpp b/deps/acelite/ace/String_Base.cpp index 758009b26..b12d8c4ca 100644 --- a/deps/acelite/ace/String_Base.cpp +++ b/deps/acelite/ace/String_Base.cpp @@ -4,7 +4,6 @@ #include "ace/ACE.h" #include "ace/Malloc_Base.h" #include "ace/String_Base.h" -#include "ace/Auto_Ptr.h" #include "ace/OS_NS_string.h" #include // For std::swap<> @@ -15,7 +14,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_String_Base) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_String_Base) template ACE_CHAR_T ACE_String_Base::NULL_String_ = 0; @@ -371,7 +370,11 @@ ACE_String_Base::rep (void) const ACE_TRACE ("ACE_String_Base::rep"); ACE_CHAR_T *new_string; +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (new_string, static_cast(ACE_Allocator::instance()->malloc(sizeof(ACE_CHAR_T) * (this->len_ + 1))), 0); +#else ACE_NEW_RETURN (new_string, ACE_CHAR_T[this->len_ + 1], 0); +#endif ACE_OS::strsncpy (new_string, this->rep_, this->len_+1); return new_string; diff --git a/deps/acelite/ace/String_Base.h b/deps/acelite/ace/String_Base.h index 0c8af1147..8005c34b7 100644 --- a/deps/acelite/ace/String_Base.h +++ b/deps/acelite/ace/String_Base.h @@ -4,7 +4,7 @@ /** * @file String_Base.h * - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) + * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) * @author Nanbor Wang */ //============================================================================= diff --git a/deps/acelite/ace/String_Base_Const.h b/deps/acelite/ace/String_Base_Const.h index 3fce9f408..a3e6fc108 100644 --- a/deps/acelite/ace/String_Base_Const.h +++ b/deps/acelite/ace/String_Base_Const.h @@ -20,7 +20,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -35,13 +34,11 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_String_Base_Const { public: - typedef ACE_Allocator::size_type size_type; /// Constant that denotes case where no such character position /// exists. static size_type const npos; - }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Svc_Conf_Lexer.cpp b/deps/acelite/ace/Svc_Conf_Lexer.cpp index 434527ae4..08d2f65d7 100644 --- a/deps/acelite/ace/Svc_Conf_Lexer.cpp +++ b/deps/acelite/ace/Svc_Conf_Lexer.cpp @@ -84,6 +84,8 @@ struct ace_yy_buffer_state #endif /* ACE_USES_WCHAR */ } + ACE_ALLOC_HOOK_DECLARE; + // Input related char input_[ACE_YY_CONVERSION_SPACE]; size_t index_; @@ -102,6 +104,8 @@ struct ace_yy_buffer_state #endif /* ACE_USES_WCHAR */ }; +ACE_ALLOC_HOOK_DEFINE(ace_yy_buffer_state) + // ****************************************************************** // Global functions // ****************************************************************** @@ -242,7 +246,9 @@ ACE_Svc_Conf_Lexer::input (ACE_Svc_Conf_Param* param, } else { +#ifndef ACE_LACKS_STDERR ACE_OS::fprintf (stderr, "ERROR: input in scanner failed\n"); +#endif ACE_OS::exit (2); } } diff --git a/deps/acelite/ace/Svc_Conf_Param.h b/deps/acelite/ace/Svc_Conf_Param.h index f3039167d..4b03076bb 100644 --- a/deps/acelite/ace/Svc_Conf_Param.h +++ b/deps/acelite/ace/Svc_Conf_Param.h @@ -45,7 +45,7 @@ extern void ace_yy_delete_buffer (ace_yy_buffer_state *buffer); * This class retains the state for a given parse/scan. It primarily * makes it possible to hold the static object lock in the scanner * for as short a period of time as possible. The resulting finer - * grained locking prevents deadlocks from occuring when scanning a + * grained locking prevents deadlocks from occurring when scanning a * `svc.conf' file and activating an ACE_Task, for example, as a * result of processing the directives in that file. */ diff --git a/deps/acelite/ace/Svc_Conf_y.cpp b/deps/acelite/ace/Svc_Conf_y.cpp index 04c4f4e1e..333682808 100644 --- a/deps/acelite/ace/Svc_Conf_y.cpp +++ b/deps/acelite/ace/Svc_Conf_y.cpp @@ -1901,7 +1901,7 @@ ace_yyreturn: ace_yystos[*ace_yyssp], ace_yyvsp); YYPOPSTACK (1); } -#ifndef ace_yyoverflow +#if defined ace_yyoverflow && !defined ACE_LACKS_FREE if (ace_yyss != ace_yyssa) YYSTACK_FREE (ace_yyss); #endif diff --git a/deps/acelite/ace/Svc_Handler.h b/deps/acelite/ace/Svc_Handler.h index ab893b7ed..15ef09f79 100644 --- a/deps/acelite/ace/Svc_Handler.h +++ b/deps/acelite/ace/Svc_Handler.h @@ -4,7 +4,7 @@ /** * @file Svc_Handler.h * - * @author Douglas Schmidt + * @author Douglas Schmidt * @author Irfan Pyarali */ //============================================================================= @@ -69,7 +69,6 @@ template class ACE_Svc_Handler : public ACE_Task { public: - // Useful STL-style traits. typedef typename PEER_STREAM::PEER_ADDR addr_type; typedef PEER_STREAM stream_type; @@ -280,7 +279,6 @@ template class ACE_Buffered_Svc_Handler : public ACE_Svc_Handler { public: - // = Initialization and termination methods. /** * Constructor initializes the @a thr_mgr and @a mq by passing them * down to the ACE_Task base class. The @a reactor is passed to diff --git a/deps/acelite/ace/Synch.h b/deps/acelite/ace/Synch.h index 6a6bf7942..112f36460 100644 --- a/deps/acelite/ace/Synch.h +++ b/deps/acelite/ace/Synch.h @@ -6,7 +6,7 @@ * * Wrapper Facades for various synchronization mechanisms. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/Synch_Options.cpp b/deps/acelite/ace/Synch_Options.cpp index 3e17a65ba..91f5cd1f8 100644 --- a/deps/acelite/ace/Synch_Options.cpp +++ b/deps/acelite/ace/Synch_Options.cpp @@ -3,6 +3,10 @@ #include "ace/Global_Macros.h" #include "ace/config-all.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE (ACE_Synch_Options) @@ -44,11 +48,12 @@ ACE_Synch_Options::set (unsigned long options, this->options_ = options; this->timeout_ = timeout; - // Whoa, possible dependence on static initialization here. This - // function is called during initialization of the statics above. - // But, ACE_Time_Value::zero is a static object. Very fortunately, - // its bits have a value of 0. - if (this->timeout_ != ACE_Time_Value::zero) + /* + * Not using ACE_Time_Value::zero because of possible static init order + * dependence. It would work fine because the memory would all zeros anyways, + * but ubsan complains about it. + */ + if (timeout_ != ACE_Time_Value(0)) ACE_SET_BITS (this->options_, ACE_Synch_Options::USE_TIMEOUT); this->arg_ = arg; diff --git a/deps/acelite/ace/Synch_Options.h b/deps/acelite/ace/Synch_Options.h index c3651202f..171f1e24c 100644 --- a/deps/acelite/ace/Synch_Options.h +++ b/deps/acelite/ace/Synch_Options.h @@ -4,7 +4,7 @@ /** * @file Synch_Options.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/Synch_Traits.h b/deps/acelite/ace/Synch_Traits.h index e73399faa..3a4c52dd1 100644 --- a/deps/acelite/ace/Synch_Traits.h +++ b/deps/acelite/ace/Synch_Traits.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/TLI.cpp b/deps/acelite/ace/TLI.cpp index 310f85ce8..2c101d827 100644 --- a/deps/acelite/ace/TLI.cpp +++ b/deps/acelite/ace/TLI.cpp @@ -49,7 +49,6 @@ ACE_TLI::ACE_TLI (void) { delete [] this->so_opt_req.opt.buf; this->so_opt_req.opt.buf = 0; - return; } #endif /* ACE_HAS_SVR4_TLI */ } diff --git a/deps/acelite/ace/TLI.h b/deps/acelite/ace/TLI.h index 6a4403479..2f0695b1d 100644 --- a/deps/acelite/ace/TLI.h +++ b/deps/acelite/ace/TLI.h @@ -53,7 +53,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_TLI : public ACE_IPC_SAP { public: - // = Initialization and termination methods. /// Initialize a TLI endpoint. ACE_HANDLE open (const char device[], int oflag = O_RDWR, diff --git a/deps/acelite/ace/TLI_Acceptor.h b/deps/acelite/ace/TLI_Acceptor.h index 47e122530..506fbab0a 100644 --- a/deps/acelite/ace/TLI_Acceptor.h +++ b/deps/acelite/ace/TLI_Acceptor.h @@ -45,7 +45,6 @@ class ACE_Export ACE_TLI_Acceptor : public ACE_TLI public: friend class ACE_Request_Queue; - // = Initialization and termination methods. /// Default constructor. ACE_TLI_Acceptor (void); diff --git a/deps/acelite/ace/TLI_Connector.h b/deps/acelite/ace/TLI_Connector.h index b90fb2a0a..16fbe687e 100644 --- a/deps/acelite/ace/TLI_Connector.h +++ b/deps/acelite/ace/TLI_Connector.h @@ -33,7 +33,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_TLI_Connector { public: - // = Initialization methods. /// Default constructor. ACE_TLI_Connector (void); diff --git a/deps/acelite/ace/TLI_Stream.h b/deps/acelite/ace/TLI_Stream.h index acbc4c3d7..a323b7888 100644 --- a/deps/acelite/ace/TLI_Stream.h +++ b/deps/acelite/ace/TLI_Stream.h @@ -40,7 +40,6 @@ public: friend class ACE_TLI_Acceptor; friend class ACE_TLI_Connector; - // = Initialization and termination methods. /// Default constructor. ACE_TLI_Stream (void); diff --git a/deps/acelite/ace/TP_Reactor.cpp b/deps/acelite/ace/TP_Reactor.cpp index 62d8bd378..f1bb31bf9 100644 --- a/deps/acelite/ace/TP_Reactor.cpp +++ b/deps/acelite/ace/TP_Reactor.cpp @@ -100,7 +100,7 @@ ACE_TP_Reactor::ACE_TP_Reactor (ACE_Sig_Handler *sh, : ACE_Select_Reactor (sh, tq, ACE_DISABLE_NOTIFY_PIPE_DEFAULT, 0, mask_signals, s_queue) { ACE_TRACE ("ACE_TP_Reactor::ACE_TP_Reactor"); - this->supress_notify_renew (1); + this->supress_notify_renew (true); } ACE_TP_Reactor::ACE_TP_Reactor (size_t max_number_of_handles, @@ -112,7 +112,7 @@ ACE_TP_Reactor::ACE_TP_Reactor (size_t max_number_of_handles, : ACE_Select_Reactor (max_number_of_handles, restart, sh, tq, ACE_DISABLE_NOTIFY_PIPE_DEFAULT, 0, mask_signals, s_queue) { ACE_TRACE ("ACE_TP_Reactor::ACE_TP_Reactor"); - this->supress_notify_renew (1); + this->supress_notify_renew (true); } int @@ -315,7 +315,7 @@ int ACE_TP_Reactor::handle_notify_events (int & /*event_count*/, ACE_TP_Token_Guard &guard) { - // Get the handle on which notify calls could have occured + // Get the handle on which notify calls could have occurred ACE_HANDLE notify_handle = this->get_notify_handle (); int result = 0; diff --git a/deps/acelite/ace/TP_Reactor.h b/deps/acelite/ace/TP_Reactor.h index 15384c0eb..c9be2cf15 100644 --- a/deps/acelite/ace/TP_Reactor.h +++ b/deps/acelite/ace/TP_Reactor.h @@ -132,7 +132,6 @@ private: /// hasn't got the token (and hence the thread) and a value of true /// vice-versa. bool owner_; - }; /** diff --git a/deps/acelite/ace/TSS_Adapter.cpp b/deps/acelite/ace/TSS_Adapter.cpp index 0383a7ea8..ee1f55fdc 100644 --- a/deps/acelite/ace/TSS_Adapter.cpp +++ b/deps/acelite/ace/TSS_Adapter.cpp @@ -3,11 +3,15 @@ * * Originally in Synch.cpp * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ #include "ace/TSS_Adapter.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_TSS_Adapter::ACE_TSS_Adapter (void *object, ACE_THR_DEST f) @@ -16,6 +20,8 @@ ACE_TSS_Adapter::ACE_TSS_Adapter (void *object, ACE_THR_DEST f) { } +ACE_ALLOC_HOOK_DEFINE(ACE_TSS_Adapter); + void ACE_TSS_Adapter::cleanup (void) { diff --git a/deps/acelite/ace/TSS_Adapter.h b/deps/acelite/ace/TSS_Adapter.h index 664e59f6d..376f51792 100644 --- a/deps/acelite/ace/TSS_Adapter.h +++ b/deps/acelite/ace/TSS_Adapter.h @@ -6,7 +6,7 @@ * * Originally in Synch.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -43,6 +43,8 @@ public: /// Perform the cleanup operation. void cleanup (void); + ACE_ALLOC_HOOK_DECLARE; + //private: /// The real TS object. diff --git a/deps/acelite/ace/TSS_T.cpp b/deps/acelite/ace/TSS_T.cpp index ae55188ab..bee8257b0 100644 --- a/deps/acelite/ace/TSS_T.cpp +++ b/deps/acelite/ace/TSS_T.cpp @@ -15,6 +15,9 @@ #include "ace/Log_Category.h" #include "ace/Guard_T.h" #include "ace/OS_NS_stdio.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if defined (ACE_HAS_THR_C_DEST) # include "ace/TSS_Adapter.h" @@ -22,7 +25,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_TSS) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_TSS) #if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) # if defined (ACE_HAS_THR_C_DEST) @@ -43,7 +46,13 @@ ACE_TSS::~ACE_TSS (void) # else TYPE *ts_obj = this->ts_value (); this->ts_value (0); +# if !defined ACE_HAS_LYNXOS_178 || defined ACE_HAS_TSS_EMULATION + // A bug in LynxOS-178 causes pthread_setspecific (called from ts_value(0) + // above) to call the cleanup function, so we need to avoid calling it here. ACE_TSS::cleanup (ts_obj); +# else + ACE_UNUSED_ARG (ts_obj); +# endif # endif /* ACE_HAS_THR_C_DEST */ ACE_OS::thr_key_detach (this->key_); @@ -152,7 +161,7 @@ ACE_TSS::ACE_TSS (TYPE *ts_obj) ACE_TEXT ("ACE_Thread::keycreate() failed!"), ACE_TEXT ("ACE_TSS::ACE_TSS"), MB_OK); -#else +#elif !defined (ACE_LACKS_VA_FUNCTIONS) ACE_OS::fprintf (stderr, "ACE_Thread::keycreate() failed!"); #endif /* ACE_HAS_WINCE */ @@ -330,7 +339,7 @@ ACE_TSS::ts_object (TYPE *new_ts_obj) return ts_obj; } -ACE_ALLOC_HOOK_DEFINE(ACE_TSS_Guard) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_TSS_Guard) template void ACE_TSS_Guard::dump (void) const diff --git a/deps/acelite/ace/TSS_T.h b/deps/acelite/ace/TSS_T.h index 412cfaee3..d3097d544 100644 --- a/deps/acelite/ace/TSS_T.h +++ b/deps/acelite/ace/TSS_T.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== @@ -22,7 +22,7 @@ // This should probably go somewhere else, but it's only used here and // in Thread_Manager. -// Note there is no ACE_TSS_SET because one would typicaly do +// Note there is no ACE_TSS_SET because one would typically do // 'ACE_TSS_GET()->xyz_ = value', so the macro would have been too // complicated. # if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) @@ -168,8 +168,8 @@ public: /// Dump the state of an object. void dump (void) const; - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; protected: /// Actually implements the code that retrieves the object from diff --git a/deps/acelite/ace/TTY_IO.cpp b/deps/acelite/ace/TTY_IO.cpp index c9e14e966..53c56badd 100644 --- a/deps/acelite/ace/TTY_IO.cpp +++ b/deps/acelite/ace/TTY_IO.cpp @@ -242,16 +242,24 @@ int ACE_TTY_IO::control (Control_Mode cmd, Serial_Params *arg) const { devpar.c_cflag |= PARENB; devpar.c_cflag |= PARODD; + devpar.c_iflag &= ~IGNPAR; + devpar.c_iflag |= INPCK | PARMRK; } else if (ACE_OS::strcasecmp (arg->paritymode, ACE_TTY_IO_EVEN) == 0) { devpar.c_cflag |= PARENB; devpar.c_cflag &= ~PARODD; + devpar.c_iflag &= ~IGNPAR; + devpar.c_iflag |= INPCK | PARMRK; } else if (ACE_OS::strcasecmp (arg->paritymode, ACE_TTY_IO_NONE) == 0) - devpar.c_cflag &= ~PARENB; + { + devpar.c_cflag &= ~PARENB; + } else - return -1; + { + return -1; + } } else { @@ -291,7 +299,6 @@ int ACE_TTY_IO::control (Control_Mode cmd, Serial_Params *arg) const devpar.c_cflag |= CLOCAL; #endif /* CLOCAL */ - devpar.c_iflag = IGNPAR | INPCK; if (arg->databits < 8) devpar.c_iflag |= ISTRIP; diff --git a/deps/acelite/ace/TTY_IO.h b/deps/acelite/ace/TTY_IO.h index fcc6ac54b..860184d7d 100644 --- a/deps/acelite/ace/TTY_IO.h +++ b/deps/acelite/ace/TTY_IO.h @@ -4,7 +4,7 @@ /** * @file TTY_IO.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/Task.cpp b/deps/acelite/ace/Task.cpp index 210fe72b1..17acc652f 100644 --- a/deps/acelite/ace/Task.cpp +++ b/deps/acelite/ace/Task.cpp @@ -5,6 +5,7 @@ #include "ace/Task.inl" #endif /* __ACE_INLINE__ */ +#include "ace/OS_NS_string.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -13,8 +14,13 @@ ACE_Task_Base::ACE_Task_Base (ACE_Thread_Manager *thr_man) thr_mgr_ (thr_man), flags_ (0), grp_id_ (-1) +#if !(defined (ACE_TANDEM_T1248_PTHREADS) || defined (ACE_THREAD_T_IS_A_STRUCT)) ,last_thread_id_ (0) +#endif /* ! ACE_TANDEM_T1248_PTHREADS || ACE_THREAD_T_IS_A_STRUCT */ { +#if defined (ACE_TANDEM_T1248_PTHREADS) || defined (ACE_THREAD_T_IS_A_STRUCT) + ACE_OS::memset( &this->last_thread_id_, '\0', sizeof( this->last_thread_id_ )); +#endif /* ACE_TANDEM_T1248_PTHREADS || ACE_THREAD_T_IS_A_STRUCT */ } ACE_Task_Base::~ACE_Task_Base (void) @@ -125,10 +131,14 @@ ACE_Task_Base::activate (long flags, return 1; // Already active. else { - if (this->thr_count_ > 0 && this->grp_id_ != -1) + if ((this->thr_count_ > 0 || grp_id == -1) && + this->grp_id_ != -1) // If we're joining an existing group of threads then make - // sure to use its group id. + // sure to (re)use its group id. grp_id = this->grp_id_; + else if (grp_id != -1) + // make sure to reset the cached grp_id + this->grp_id_ = -1; this->thr_count_ += n_threads; } @@ -182,11 +192,11 @@ ACE_Task_Base::activate (long flags, if (this->grp_id_ == -1) this->grp_id_ = grp_spawned; -#if defined(ACE_TANDEM_T1248_PTHREADS) +#if defined(ACE_TANDEM_T1248_PTHREADS) || defined (ACE_THREAD_T_IS_A_STRUCT) ACE_OS::memcpy( &this->last_thread_id_, '\0', sizeof(this->last_thread_id_)); #else this->last_thread_id_ = 0; // Reset to prevent inadvertant match on ID -#endif /* defined (ACE_TANDEM_T1248_PTHREADS) */ +#endif /* ACE_TANDEM_T1248_PTHREADS || ACE_THREAD_T_IS_A_STRUCT */ return 0; @@ -254,9 +264,10 @@ ACE_Task_Base::svc_run (void *args) t->thr_mgr ()->at_exit (t, ACE_Task_Base::cleanup, 0); #endif /* ACE_HAS_SIG_C_FUNC */ + ACE_THR_FUNC_RETURN status; // Call the Task's svc() hook method. int const svc_status = t->svc (); - ACE_THR_FUNC_RETURN status; + #if defined (ACE_HAS_INTEGRAL_TYPE_THR_FUNC_RETURN) // Reinterpret case between integral types is not mentioned in the C++ spec status = static_cast (svc_status); diff --git a/deps/acelite/ace/Task.h b/deps/acelite/ace/Task.h index c6ff29003..51218fe04 100644 --- a/deps/acelite/ace/Task.h +++ b/deps/acelite/ace/Task.h @@ -4,7 +4,7 @@ /** * @file Task.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -64,15 +64,12 @@ namespace ACE_Task_Flags class ACE_Export ACE_Task_Base : public ACE_Service_Object { public: - // = Initialization and termination methods. /// Constructor. ACE_Task_Base (ACE_Thread_Manager * = 0); /// Destructor. virtual ~ACE_Task_Base (void); - // = Initialization and termination hooks. - // These methods should be overridden by subclasses if you'd like to // provide -specific initialization and termination behavior. diff --git a/deps/acelite/ace/Task_Ex_T.cpp b/deps/acelite/ace/Task_Ex_T.cpp index 255374391..801c433ab 100644 --- a/deps/acelite/ace/Task_Ex_T.cpp +++ b/deps/acelite/ace/Task_Ex_T.cpp @@ -14,9 +14,14 @@ #include "ace/Task_Ex_T.inl" #endif /* __ACE_INLINE__ */ +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tycc (ACE_Task_Ex) + template void ACE_Task_Ex::dump (void) const { diff --git a/deps/acelite/ace/Task_T.cpp b/deps/acelite/ace/Task_T.cpp index 4d8d5b011..b28dd2cce 100644 --- a/deps/acelite/ace/Task_T.cpp +++ b/deps/acelite/ace/Task_T.cpp @@ -16,6 +16,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tyc(ACE_Task) + template void ACE_Task::dump (void) const { diff --git a/deps/acelite/ace/Task_T.h b/deps/acelite/ace/Task_T.h index 8c5800802..696117558 100644 --- a/deps/acelite/ace/Task_T.h +++ b/deps/acelite/ace/Task_T.h @@ -4,7 +4,7 @@ /** * @file Task_T.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/Task_T.inl b/deps/acelite/ace/Task_T.inl index ee73c57d0..99de01add 100644 --- a/deps/acelite/ace/Task_T.inl +++ b/deps/acelite/ace/Task_T.inl @@ -34,10 +34,10 @@ ACE_Task::ungetq (ACE_Message_Block *mb, ACE_Time_Va } template ACE_INLINE int -ACE_Task::flush (u_long flag) +ACE_Task::flush (u_long f) { ACE_TRACE ("ACE_Task::flush"); - if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL)) + if (ACE_BIT_ENABLED (f, ACE_Task_Flags::ACE_FLUSHALL)) return this->msg_queue_ != 0 && this->msg_queue_->close (); else return -1; // Note, need to be more careful about what we free... diff --git a/deps/acelite/ace/Thread.h b/deps/acelite/ace/Thread.h index b7fc1fb4c..6290de52e 100644 --- a/deps/acelite/ace/Thread.h +++ b/deps/acelite/ace/Thread.h @@ -4,7 +4,7 @@ /** * @file Thread.h * - * @author Douglas Schmidt + * @author Douglas Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/Thread_Adapter.cpp b/deps/acelite/ace/Thread_Adapter.cpp index ca9749eab..905eefddc 100644 --- a/deps/acelite/ace/Thread_Adapter.cpp +++ b/deps/acelite/ace/Thread_Adapter.cpp @@ -42,6 +42,8 @@ ACE_Thread_Adapter::~ACE_Thread_Adapter (void) { } +ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Adapter); + ACE_THR_FUNC_RETURN ACE_Thread_Adapter::invoke (void) { diff --git a/deps/acelite/ace/Thread_Adapter.h b/deps/acelite/ace/Thread_Adapter.h index a01bd0c45..660f120e6 100644 --- a/deps/acelite/ace/Thread_Adapter.h +++ b/deps/acelite/ace/Thread_Adapter.h @@ -67,6 +67,8 @@ public: /// Accessor for the optional ACE_Thread_Manager. ACE_Thread_Manager *thr_mgr (void); + ACE_ALLOC_HOOK_DECLARE; + protected: /// Ensure that this object must be allocated on the heap. ~ACE_Thread_Adapter (void); diff --git a/deps/acelite/ace/Thread_Exit.cpp b/deps/acelite/ace/Thread_Exit.cpp index fea5f5c1f..0d35cdba2 100644 --- a/deps/acelite/ace/Thread_Exit.cpp +++ b/deps/acelite/ace/Thread_Exit.cpp @@ -90,6 +90,8 @@ ACE_Thread_Exit::~ACE_Thread_Exit (void) ACE_OS_TRACE ("ACE_Thread_Exit::~ACE_Thread_Exit"); } +ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Exit) + ACE_Thread_Exit_Maybe::ACE_Thread_Exit_Maybe (int flag) : instance_ (0) { diff --git a/deps/acelite/ace/Thread_Exit.h b/deps/acelite/ace/Thread_Exit.h index 51425d001..a6ac6516c 100644 --- a/deps/acelite/ace/Thread_Exit.h +++ b/deps/acelite/ace/Thread_Exit.h @@ -57,6 +57,8 @@ public: /// singleton. static void cleanup (void *instance); + ACE_ALLOC_HOOK_DECLARE; + private: /// Automatically add/remove the thread from the /// ACE_Thread_Manager. diff --git a/deps/acelite/ace/Thread_Manager.cpp b/deps/acelite/ace/Thread_Manager.cpp index 6e2da7db3..172e4a43a 100644 --- a/deps/acelite/ace/Thread_Manager.cpp +++ b/deps/acelite/ace/Thread_Manager.cpp @@ -25,6 +25,8 @@ ACE_At_Thread_Exit_Func::~ACE_At_Thread_Exit_Func (void) this->do_apply (); } +ACE_ALLOC_HOOK_DEFINE(ACE_At_Thread_Exit_Func) + void ACE_At_Thread_Exit_Func::apply (void) { @@ -368,6 +370,9 @@ ACE_Thread_Manager::ACE_Thread_Manager (size_t prealloc, #endif /* ACE_HAS_THREADS */ , thread_desc_freelist_ (ACE_FREE_LIST_WITH_POOL, prealloc, lwm, hwm, inc) +#if defined (ACE_HAS_THREADS) && defined (ACE_LACKS_PTHREAD_JOIN) + , join_cond_ (this->lock_) +#endif { ACE_TRACE ("ACE_Thread_Manager::ACE_Thread_Manager"); } @@ -384,6 +389,9 @@ ACE_Thread_Manager::ACE_Thread_Manager (const ACE_Condition_Attributes &attribut #endif /* ACE_HAS_THREADS */ , thread_desc_freelist_ (ACE_FREE_LIST_WITH_POOL, prealloc, lwm, hwm, inc) +#if defined (ACE_HAS_THREADS) && defined (ACE_LACKS_PTHREAD_JOIN) + , join_cond_ (this->lock_) +#endif { #if !defined (ACE_HAS_THREADS) ACE_UNUSED_ARG (attributes); @@ -580,7 +588,11 @@ ACE_Thread_Manager::spawn_i (ACE_THR_FUNC func, // Create a new thread running . *Must* be called with the // held... // Get a "new" Thread Descriptor from the freelist. +#if defined (ACE_HAS_CPP11) std::unique_ptr new_thr_desc (this->thread_desc_freelist_.remove ()); +#else + auto_ptr new_thr_desc (this->thread_desc_freelist_.remove ()); +#endif /* ACE_HAS_CPP11 */ // Reset thread descriptor status new_thr_desc->reset (this); @@ -607,7 +619,11 @@ ACE_Thread_Manager::spawn_i (ACE_THR_FUNC func, flags), -1); # endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ +#if defined ACE_HAS_CPP11 std::unique_ptr auto_thread_args (static_cast (thread_args)); +#else + auto_ptr auto_thread_args (static_cast (thread_args)); +#endif ACE_TRACE ("ACE_Thread_Manager::spawn_i"); ACE_hthread_t thr_handle; @@ -993,6 +1009,40 @@ int ACE_Thread_Manager::join_thr (ACE_Thread_Descriptor *td, int) { ACE_TRACE ("ACE_Thread_Manager::join_thr"); + +#if defined (ACE_HAS_THREADS) && defined (ACE_LACKS_PTHREAD_JOIN) + ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); + + if (ACE_BIT_DISABLED (td->flags_, THR_DETACHED | THR_DAEMON) + || ACE_BIT_ENABLED (td->flags_, THR_JOINABLE)) + { + if (td->terminated_) + return 0; + ACE_SET_BITS (td->thr_state_, ACE_THR_JOINING); + } + else + { + errno = EINVAL; + return -1; + } + + const ACE_thread_t waiting_id = td->thr_id_; + + while (true) + { + if (this->join_cond_.wait () == -1) + return -1; + + bool found = false; + for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); + !iter.done () && !found; iter.advance ()) + if (ACE_OS::thr_equal (iter.next ()->thr_id_, waiting_id)) + found = true; + if (!found) + break; + } + +#else int const result = ACE_Thread::join (td->thr_handle_); if (result != 0) { @@ -1003,6 +1053,7 @@ ACE_Thread_Manager::join_thr (ACE_Thread_Descriptor *td, int) errno = result; return -1; } +#endif // ACE_HAS_THREADS && ACE_LACKS_PTHREAD_JOIN return 0; } @@ -1446,10 +1497,12 @@ ACE_Thread_Manager::join (ACE_thread_t tid, ACE_THR_FUNC_RETURN *status) if (ACE_OS::thr_equal (biter.next ()->thr_id_, tid)) { ACE_Thread_Descriptor_Base *tdbl = biter.advance_and_remove (false); +#ifndef ACE_LACKS_PTHREAD_JOIN if (ACE_Thread::join (tdbl->thr_handle_, status) == -1) { return -1; } +#endif delete tdbl; // return immediately if we've found the thread we want to join. @@ -1458,9 +1511,8 @@ ACE_Thread_Manager::join (ACE_thread_t tid, ACE_THR_FUNC_RETURN *status) } #endif /* !ACE_HAS_VXTHREADS */ - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) + typedef ACE_Double_Linked_List_Iterator iter_t; + for (iter_t iter (this->thr_list_); !iter.done (); iter.advance ()) { // If threads are created as THR_DETACHED or THR_DAEMON, we // can't help much. @@ -1470,7 +1522,7 @@ ACE_Thread_Manager::join (ACE_thread_t tid, ACE_THR_FUNC_RETURN *status) { tdb = *iter.next (); ACE_SET_BITS (iter.next ()->thr_state_, ACE_THR_JOINING); - found = 1; + found = true; break; } } @@ -1478,10 +1530,31 @@ ACE_Thread_Manager::join (ACE_thread_t tid, ACE_THR_FUNC_RETURN *status) if (!found) return -1; // Didn't find the thread we want or the thread is not joinable. + +#if defined (ACE_HAS_THREADS) && defined (ACE_LACKS_PTHREAD_JOIN) + ACE_UNUSED_ARG (status); // not currently supported without pthread_join + + while (found) + { + if (this->join_cond_.wait () == -1) + return -1; + + found = false; + for (iter_t iter (this->thr_list_); !iter.done () && !found; iter.advance ()) + if (ACE_OS::thr_equal (iter.next ()->thr_id_, tid) && + (ACE_BIT_DISABLED (iter.next ()->flags_, THR_DETACHED | THR_DAEMON) + || ACE_BIT_ENABLED (iter.next ()->flags_, THR_JOINABLE))) + found = true; + } + +#endif // ACE_HAS_THREADS && ACE_LACKS_PTHREAD_JOIN + } +#ifndef ACE_LACKS_PTHREAD_JOIN if (ACE_Thread::join (tdb.thr_handle_, status) == -1) return -1; +#endif return 0; } @@ -1513,9 +1586,8 @@ ACE_Thread_Manager::wait_grp (int grp_id) -1); #endif /* !ACE_HAS_VXTHREADS */ - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) + typedef ACE_Double_Linked_List_Iterator iter_t; + for (iter_t iter (this->thr_list_); !iter.done (); iter.advance ()) { // If threads are created as THR_DETACHED or THR_DAEMON, we // can't help much. @@ -1543,6 +1615,28 @@ ACE_Thread_Manager::wait_grp (int grp_id) } } #endif /* !ACE_HAS_VXTHREADS */ + +#if defined (ACE_HAS_THREADS) && defined (ACE_LACKS_PTHREAD_JOIN) + + while (copy_count) + { + if (this->join_cond_.wait () == -1) + { + delete[] copy_table; + return -1; + } + + copy_count = 0; + for (iter_t iter (this->thr_list_); !iter.done () && !copy_count; iter.advance ()) + if (iter.next ()->grp_id_ == grp_id && + ACE_BIT_ENABLED (iter.next ()->thr_state_, ACE_THR_JOINING) && + (ACE_BIT_DISABLED (iter.next ()->flags_, + THR_DETACHED | THR_DAEMON) + || ACE_BIT_ENABLED (iter.next ()->flags_, THR_JOINABLE))) + ++copy_count; + } + +#endif // ACE_HAS_THREADS && ACE_LACKS_PTHREAD_JOIN } // Now actually join() with all the threads in this group. @@ -1602,6 +1696,10 @@ ACE_Thread_Manager::exit (ACE_THR_FUNC_RETURN status, bool do_thread_exit) // @@ We call Thread_Descriptor terminate this realize the cleanup // process itself. td->terminate(); + +#if defined (ACE_HAS_THREADS) && defined (ACE_LACKS_PTHREAD_JOIN) + this->join_cond_.broadcast (); +#endif } } @@ -1700,11 +1798,12 @@ ACE_Thread_Manager::wait (const ACE_Time_Value *timeout, while ((item = term_thr_list_copy.delete_head ()) != 0) { +#ifndef ACE_LACKS_PTHREAD_JOIN if (ACE_BIT_DISABLED (item->flags_, THR_DETACHED | THR_DAEMON) || ACE_BIT_ENABLED (item->flags_, THR_JOINABLE)) // Detached handles shouldn't reached here. (void) ACE_Thread::join (item->thr_handle_); - +#endif delete item; } @@ -1777,9 +1876,8 @@ ACE_Thread_Manager::wait_task (ACE_Task_Base *task) -1); #endif /* !ACE_HAS_VXTHREADS */ - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) + typedef ACE_Double_Linked_List_Iterator iter_t; + for (iter_t iter (this->thr_list_); !iter.done (); iter.advance ()) { // If threads are created as THR_DETACHED or THR_DAEMON, we // can't wait on them here. @@ -1789,6 +1887,14 @@ ACE_Thread_Manager::wait_task (ACE_Task_Base *task) || ACE_BIT_ENABLED (iter.next ()->flags_, THR_JOINABLE))) { +# ifdef ACE_LACKS_PTHREAD_JOIN + if (ACE_OS::thr_equal (iter.next ()->thr_id_, ACE_OS::thr_self ())) + { + errno = EDEADLK; + delete[] copy_table; + return -1; + } +# endif ACE_SET_BITS (iter.next ()->thr_state_, ACE_THR_JOINING); copy_table[copy_count++] = *iter.next (); @@ -1804,11 +1910,35 @@ ACE_Thread_Manager::wait_task (ACE_Task_Base *task) if (titer.next ()->task_ == task) { ACE_Thread_Descriptor_Base *tdb = titer.advance_and_remove (false); +# ifndef ACE_LACKS_PTHREAD_JOIN copy_table[copy_count++] = *tdb; +# endif delete tdb; } } #endif /* !ACE_HAS_VXTHREADS */ + +#if defined (ACE_HAS_THREADS) && defined (ACE_LACKS_PTHREAD_JOIN) + + while (copy_count) + { + if (this->join_cond_.wait () == -1) + { + delete[] copy_table; + return -1; + } + + copy_count = 0; + for (iter_t iter (this->thr_list_); !iter.done () && !copy_count; iter.advance ()) + if (iter.next ()->task_ == task && + ACE_BIT_ENABLED (iter.next ()->thr_state_, ACE_THR_JOINING) && + (ACE_BIT_DISABLED (iter.next ()->flags_, + THR_DETACHED | THR_DAEMON) + || ACE_BIT_ENABLED (iter.next ()->flags_, THR_JOINABLE))) + ++copy_count; + } + +#endif // ACE_HAS_THREADS && ACE_LACKS_PTHREAD_JOIN } // Now to do the actual work @@ -2244,4 +2374,6 @@ ACE_Thread_Manager::get_grp (ACE_Task_Base *task, int &grp_id) return 0; } +ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Descriptor_Base); + ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Thread_Manager.h b/deps/acelite/ace/Thread_Manager.h index f83a1d6c4..c169d0e15 100644 --- a/deps/acelite/ace/Thread_Manager.h +++ b/deps/acelite/ace/Thread_Manager.h @@ -4,7 +4,7 @@ /** * @file Thread_Manager.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -137,6 +137,8 @@ public: virtual ~ACE_At_Thread_Exit_Func (void); + ACE_ALLOC_HOOK_DECLARE; + protected: /// The object to be cleanup void *object_; @@ -192,6 +194,8 @@ public: /// ACE_Task_Base associated with this thread.; ACE_Task_Base *task (void) const; + ACE_ALLOC_HOOK_DECLARE; + protected: /// Reset this base thread descriptor. void reset (void); @@ -222,7 +226,7 @@ protected: * @class ACE_Thread_Descriptor * * @brief Information for controlling threads that run under the control - * of the . + * of the Thread_Manager. */ class ACE_Export ACE_Thread_Descriptor : public ACE_Thread_Descriptor_Base { @@ -231,7 +235,6 @@ class ACE_Export ACE_Thread_Descriptor : public ACE_Thread_Descriptor_Base friend class ACE_Double_Linked_List; friend class ACE_Double_Linked_List_Iterator; public: - // = Initialization method. ACE_Thread_Descriptor (void); // = Accessor methods. @@ -271,7 +274,7 @@ public: * "cleanup_hook" function; the first parameter is the object (or * array) to be destroyed. Returns 0 on success, non-zero on * failure: -1 if virtual memory is exhausted or 1 if the object (or - * arrayt) had already been registered. + * array) had already been registered. */ int at_exit (void *object, ACE_CLEANUP_FUNC cleanup_hook, @@ -300,6 +303,13 @@ public: void set_next (ACE_Thread_Descriptor *td); ACE_Thread_Descriptor *get_next (void) const; +protected: + /// Run the AT_Thread_Exit hooks. + void do_at_exit (void); + + /// Terminate realize the cleanup process to thread termination + void terminate (void); + private: /// Reset this thread descriptor. void reset (ACE_Thread_Manager *tm); @@ -313,12 +323,7 @@ private: void at_push (ACE_At_Thread_Exit* cleanup, bool is_owner = false); - /// Run the AT_Thread_Exit hooks. - void do_at_exit (void); - - /// Terminate realize the cleanup process to thread termination - void terminate (void); - +private: /// Thread_Descriptor is the ownership of ACE_Log_Msg if log_msg_!=0 /// This can occur because ACE_TSS_cleanup was executed before terminate. ACE_Log_Msg *log_msg_; @@ -336,7 +341,7 @@ private: #endif /// Pointer to an ACE_Thread_Manager or NULL if there's no - /// ACE_Thread_Manager> + /// ACE_Thread_Manager ACE_Thread_Manager* tm_; /// Registration lock to prevent premature removal of thread descriptor. @@ -383,7 +388,7 @@ class ACE_Export ACE_Thread_Manager public: friend class ACE_Thread_Control; - // Allow ACE_THread_Exit to register the global TSS instance object. + // Allow ACE_Thread_Exit to register the global TSS instance object. friend class ACE_Thread_Exit; friend class ACE_Thread_Descriptor; @@ -899,7 +904,7 @@ public: int kill_task (ACE_Task_Base *task, int signum); /** - * Cancel all threads in an ACE_Task. If is non-0, + * Cancel all threads in an ACE_Task. If @a async_cancel is non-0, * then asynchronously cancel these threads if the OS platform * supports cancellation. Otherwise, perform a "cooperative" * cancellation. @@ -1031,7 +1036,7 @@ public: int get_grp (ACE_Task_Base *task, int &grp_id); /// Return a count of the current number of threads active in the - /// . + /// Thread_Manager. size_t count_threads (void) const; /// Get the state of the thread. Returns false if the thread is not @@ -1065,7 +1070,7 @@ public: * second parameter to the "cleanup_hook" function; the first * parameter is the object (or array) to be destroyed. * "cleanup_hook", for example, may delete the object (or array). - * If == 0, the will _NOT_ get cleanup at + * If @a cleanup_hook == 0, the @a object will _NOT_ get cleanup at * thread exit. You can use this to cancel the previously added * at_exit. */ @@ -1117,12 +1122,12 @@ protected: /// Run the registered hooks when the thread exits. void run_thread_exit_hooks (int i); - /// Locate the index of the table slot occupied by . Returns - /// -1 if is not in the table doesn't contain . + /// Locate the index of the table slot occupied by @a t_id. Returns + /// -1 if @a t_id is not in the table doesn't contain @a t_id. ACE_Thread_Descriptor *find_thread (ACE_thread_t t_id); - /// Locate the index of the table slot occupied by . Returns - /// -1 if is not in the table doesn't contain . + /// Locate the index of the table slot occupied by @a h_id. Returns + /// -1 if @a h_id is not in the table doesn't contain @a h_id. ACE_Thread_Descriptor *find_hthread (ACE_hthread_t h_id); /** @@ -1201,7 +1206,7 @@ protected: int cancel_thr (ACE_Thread_Descriptor *td, int async_cancel = 0); - /// Register a thread as terminated and put it into the . + /// Register a thread as terminated and put it into the terminated_thr_list_. int register_as_terminated (ACE_Thread_Descriptor *td); /// Setting the static ACE_TSS_TYPE (ACE_Thread_Exit) *thr_exit_ pointer. @@ -1232,7 +1237,7 @@ protected: // = ACE_Thread_Mutex and condition variable for synchronizing termination. #if defined (ACE_HAS_THREADS) - /// Serialize access to the . + /// Serialize access to the zero_cond_. ACE_Thread_Mutex lock_; /// Keep track of when there are no more threads. @@ -1241,6 +1246,10 @@ protected: ACE_Locked_Free_List thread_desc_freelist_; +#if defined (ACE_HAS_THREADS) && defined (ACE_LACKS_PTHREAD_JOIN) + ACE_Condition_Thread_Mutex join_cond_; +#endif + private: #if ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) /// Pointer to a process-wide ACE_Thread_Manager. diff --git a/deps/acelite/ace/Thread_Mutex.cpp b/deps/acelite/ace/Thread_Mutex.cpp index 6b8851865..b51505f7b 100644 --- a/deps/acelite/ace/Thread_Mutex.cpp +++ b/deps/acelite/ace/Thread_Mutex.cpp @@ -3,7 +3,7 @@ * * Originally in Synch.cpp * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ #include "ace/Thread_Mutex.h" diff --git a/deps/acelite/ace/Thread_Mutex.h b/deps/acelite/ace/Thread_Mutex.h index ff20fb938..9270aa68a 100644 --- a/deps/acelite/ace/Thread_Mutex.h +++ b/deps/acelite/ace/Thread_Mutex.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/Thread_Semaphore.cpp b/deps/acelite/ace/Thread_Semaphore.cpp index 395997506..1fa0bf178 100644 --- a/deps/acelite/ace/Thread_Semaphore.cpp +++ b/deps/acelite/ace/Thread_Semaphore.cpp @@ -3,13 +3,17 @@ * * Originally in Synch.cpp * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ #include "ace/Thread_Semaphore.h" #if defined (ACE_HAS_THREADS) +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/Thread_Semaphore.inl" #endif /* __ACE_INLINE__ */ @@ -21,6 +25,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Semaphore) + void ACE_Thread_Semaphore::dump (void) const { diff --git a/deps/acelite/ace/Thread_Semaphore.h b/deps/acelite/ace/Thread_Semaphore.h index 634eccc1c..c59e25ba9 100644 --- a/deps/acelite/ace/Thread_Semaphore.h +++ b/deps/acelite/ace/Thread_Semaphore.h @@ -6,7 +6,7 @@ * * Moved from Synch.h. * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //========================================================================== diff --git a/deps/acelite/ace/Time_Policy.h b/deps/acelite/ace/Time_Policy.h index 01bef1364..29ffa7d4a 100644 --- a/deps/acelite/ace/Time_Policy.h +++ b/deps/acelite/ace/Time_Policy.h @@ -116,8 +116,12 @@ public: /// Set delegate void set_delegate (ACE_Dynamic_Time_Policy_Base const * delegate); - /// Copy policy - ACE_Delegating_Time_Policy& operator =(ACE_Delegating_Time_Policy const & pol); +#if defined (ACE_HAS_CPP11) + ACE_Delegating_Time_Policy (const ACE_Delegating_Time_Policy&) = default; + ACE_Delegating_Time_Policy (ACE_Delegating_Time_Policy&&) = default; + ACE_Delegating_Time_Policy& operator = (ACE_Delegating_Time_Policy const &) = default; + ACE_Delegating_Time_Policy &operator = (ACE_Delegating_Time_Policy&&) = default; +#endif /* ACE_HAS_CPP11 */ /// Noop. Just here to satisfy backwards compatibility demands. void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void)); diff --git a/deps/acelite/ace/Time_Policy.inl b/deps/acelite/ace/Time_Policy.inl index 59650b8e1..8ecea8224 100644 --- a/deps/acelite/ace/Time_Policy.inl +++ b/deps/acelite/ace/Time_Policy.inl @@ -82,11 +82,4 @@ ACE_Delegating_Time_Policy::set_delegate (ACE_Dynamic_Time_Policy_Base const * d } } -ACE_INLINE ACE_Delegating_Time_Policy& -ACE_Delegating_Time_Policy::operator =(ACE_Delegating_Time_Policy const & pol) -{ - this->delegate_ = pol.delegate_; - return *this; -} - ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Time_Value.cpp b/deps/acelite/ace/Time_Value.cpp index 2ceada87f..77c151e13 100644 --- a/deps/acelite/ace/Time_Value.cpp +++ b/deps/acelite/ace/Time_Value.cpp @@ -1,5 +1,9 @@ #include "ace/Time_Value.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/Time_Value.inl" #endif /* __ACE_INLINE__ */ @@ -14,6 +18,8 @@ # include #endif /* ACE_HAS_CPP98_IOSTREAMS */ +#include + #ifdef ACE_HAS_CPP11 # include #endif /* ACE_HAS_CPP11 */ @@ -170,52 +176,30 @@ ACE_Time_Value::dump (void) const void ACE_Time_Value::normalize (bool saturate) { - // // ACE_OS_TRACE ("ACE_Time_Value::normalize"); - // From Hans Rohnert... + // ACE_OS_TRACE ("ACE_Time_Value::normalize"); + if (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS || + this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS) + { + time_t const sec = std::abs(this->tv_.tv_usec) / ACE_ONE_SECOND_IN_USECS * (this->tv_.tv_usec > 0 ? 1 : -1); + suseconds_t const usec = static_cast (this->tv_.tv_usec - sec * ACE_ONE_SECOND_IN_USECS); - if (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS) - { - /*! \todo This loop needs some optimization. - */ - if (!saturate) // keep the conditionnal expression outside the while loop to minimize performance cost - do - { - ++this->tv_.tv_sec; - this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS; - } - while (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS); + if (saturate && this->tv_.tv_sec > 0 && sec > 0 && + ACE_Numeric_Limits::max() - this->tv_.tv_sec < sec) + { + this->tv_.tv_sec = ACE_Numeric_Limits::max(); + this->tv_.tv_usec = ACE_ONE_SECOND_IN_USECS - 1; + } + else if (saturate && this->tv_.tv_sec < 0 && sec < 0 && + ACE_Numeric_Limits::min() - this->tv_.tv_sec > sec) + { + this->tv_.tv_sec = ACE_Numeric_Limits::min(); + this->tv_.tv_usec = -ACE_ONE_SECOND_IN_USECS + 1; + } else - do - if (this->tv_.tv_sec < ACE_Numeric_Limits::max()) - { - ++this->tv_.tv_sec; - this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS; - } - else - this->tv_.tv_usec = ACE_ONE_SECOND_IN_USECS - 1; - while (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS); - } - else if (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS) - { - /*! \todo This loop needs some optimization. - */ - if (!saturate) - do - { - --this->tv_.tv_sec; - this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS; - } - while (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS); - else - do - if (this->tv_.tv_sec > ACE_Numeric_Limits::min()) - { - --this->tv_.tv_sec; - this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS; - } - else - this->tv_.tv_usec = -ACE_ONE_SECOND_IN_USECS + 1; - while (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS); + { + this->tv_.tv_sec += sec; + this->tv_.tv_usec = usec; + } } if (this->tv_.tv_sec >= 1 && this->tv_.tv_usec < 0) @@ -333,7 +317,7 @@ ACE_Time_Value::operator *= (double d) #ifdef ACE_HAS_CPP98_IOSTREAMS ostream &operator<<(ostream &o, const ACE_Time_Value &v) { - char oldFiller = o.fill (); + char const oldFiller = o.fill (); o.fill ('0'); const timeval *tv = v; if (tv->tv_sec) @@ -341,9 +325,9 @@ ostream &operator<<(ostream &o, const ACE_Time_Value &v) o << tv->tv_sec; if (tv->tv_usec) #ifdef ACE_HAS_CPP11 - o << '.' << std::setw (6) << std::abs (tv->tv_usec); + o << '.' << std::setw (6) << std::labs (tv->tv_usec); #else - o << '.' << std::setw (6) << ACE_STD_NAMESPACE::abs (tv->tv_usec); + o << '.' << std::setw (6) << ACE_STD_NAMESPACE::labs (tv->tv_usec); #endif } else if (tv->tv_usec < 0) diff --git a/deps/acelite/ace/Time_Value.h b/deps/acelite/ace/Time_Value.h index c17023f76..4c295c739 100644 --- a/deps/acelite/ace/Time_Value.h +++ b/deps/acelite/ace/Time_Value.h @@ -4,7 +4,7 @@ /** * @file Time_Value.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -53,7 +53,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Time_Value { public: - /// Constant "0". static const ACE_Time_Value zero; @@ -67,8 +66,6 @@ public: */ static const ACE_Time_Value max_time; - // = Initialization methods. - /// Default Constructor. ACE_Time_Value (void); @@ -84,6 +81,9 @@ public: explicit ACE_Time_Value (const timespec_t &t); #if defined (ACE_HAS_CPP11) + ACE_Time_Value (const ACE_Time_Value&) = default; + ACE_Time_Value (ACE_Time_Value&&) = default; + /// Construct the ACE_Time_Value object from a chrono duration. template< class Rep, class Period > explicit ACE_Time_Value (const std::chrono::duration& duration) @@ -95,6 +95,9 @@ public: /// Destructor virtual ~ACE_Time_Value (); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + # if defined (ACE_WIN32) /// Construct the ACE_Time_Value object from a Win32 FILETIME explicit ACE_Time_Value (const FILETIME &ft); @@ -261,8 +264,11 @@ public: /// Add @a tv to this. ACE_Time_Value &operator += (time_t tv); +#if defined (ACE_HAS_CPP11) /// Assign @a tv to this - ACE_Time_Value &operator = (const ACE_Time_Value &tv); + ACE_Time_Value &operator = (const ACE_Time_Value &) = default; + ACE_Time_Value &operator = (ACE_Time_Value &&) = default; +#endif /* ACE_HAS_CPP11 */ /// Assign @a tv to this ACE_Time_Value &operator = (time_t tv); diff --git a/deps/acelite/ace/Time_Value.inl b/deps/acelite/ace/Time_Value.inl index a4b095033..581e34865 100644 --- a/deps/acelite/ace/Time_Value.inl +++ b/deps/acelite/ace/Time_Value.inl @@ -70,10 +70,22 @@ ACE_INLINE void ACE_Time_Value::set (double d) { // ACE_OS_TRACE ("ACE_Time_Value::set"); - time_t l = (time_t) d; - this->tv_.tv_sec = l; - this->tv_.tv_usec = (suseconds_t) ((d - (double) l) * ACE_ONE_SECOND_IN_USECS + .5); - this->normalize (); + if (d < ACE_Numeric_Limits::min()) + { + this->tv_.tv_sec = ACE_Numeric_Limits::min(); + this->tv_.tv_usec = -ACE_ONE_SECOND_IN_USECS + 1; + } + else if (d > ACE_Numeric_Limits::max()) + { + this->tv_.tv_sec = ACE_Numeric_Limits::max(); + this->tv_.tv_usec = ACE_ONE_SECOND_IN_USECS - 1; + } + else + { + time_t l = (time_t) d; + this->tv_.tv_sec = l; + this->tv_.tv_usec = (suseconds_t) ((d - (double) l) * ACE_ONE_SECOND_IN_USECS + (d < 0 ? -0.5 : 0.5)); + } } /// Initializes a timespec_t. Note that this approach loses precision @@ -331,15 +343,6 @@ ACE_Time_Value::operator+= (time_t tv) return *this; } -ACE_INLINE ACE_Time_Value & -ACE_Time_Value::operator= (const ACE_Time_Value &tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator="); - this->sec (tv.sec ()); - this->usec (tv.usec ()); - return *this; -} - ACE_INLINE ACE_Time_Value & ACE_Time_Value::operator= (time_t tv) { diff --git a/deps/acelite/ace/Time_Value_T.h b/deps/acelite/ace/Time_Value_T.h index 4348dccf1..3cbdf84e4 100644 --- a/deps/acelite/ace/Time_Value_T.h +++ b/deps/acelite/ace/Time_Value_T.h @@ -37,8 +37,6 @@ class ACE_Time_Value_T : public ACE_Time_Value public: typedef TIME_POLICY time_policy_t; - // = Initialization methods. - /// Default Constructor. ACE_Time_Value_T (void) {} diff --git a/deps/acelite/ace/Timer_Hash_T.h b/deps/acelite/ace/Timer_Hash_T.h index 2e7975c31..89fef2079 100644 --- a/deps/acelite/ace/Timer_Hash_T.h +++ b/deps/acelite/ace/Timer_Hash_T.h @@ -173,7 +173,6 @@ public: /// Type inherited from typedef ACE_Timer_Queue_T Base_Timer_Queue; - // = Initialization and termination methods. /** * Default constructor. @a table_size determines the size of the * hash table. @a upcall_functor is the instance of the FUNCTOR diff --git a/deps/acelite/ace/Timer_Heap.h b/deps/acelite/ace/Timer_Heap.h index 116336b5b..ccdf8c605 100644 --- a/deps/acelite/ace/Timer_Heap.h +++ b/deps/acelite/ace/Timer_Heap.h @@ -4,7 +4,7 @@ /** * @file Timer_Heap.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= diff --git a/deps/acelite/ace/Timer_Heap_T.cpp b/deps/acelite/ace/Timer_Heap_T.cpp index 0cc17bea2..fa2704ed8 100644 --- a/deps/acelite/ace/Timer_Heap_T.cpp +++ b/deps/acelite/ace/Timer_Heap_T.cpp @@ -22,6 +22,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tccct(ACE_Timer_Heap_Iterator_T) +ACE_ALLOC_HOOK_DEFINE_Tccct(ACE_Timer_Heap_T) + // Define some simple inlined functions to clarify the code. inline size_t ACE_HEAP_PARENT (size_t X) @@ -121,8 +124,13 @@ ACE_Timer_Heap_T::ACE_Timer_Heap_T ( } // Create the heap array. - ACE_NEW (this->heap_, - ACE_Timer_Node_T *[size]); +#if defined (ACE_HAS_ALLOC_HOOKS) + this->heap_ = reinterpret_cast **> + (ACE_Allocator::instance ()->malloc (sizeof (ACE_Timer_Node_T *) * size)); +#else + ACE_NEW (this->heap_, + ACE_Timer_Node_T *[size]); +#endif /* ACE_HAS_ALLOC_HOOKS */ // Create the parallel ACE_NEW (this->timer_ids_, @@ -186,12 +194,22 @@ ACE_Timer_Heap_T::ACE_Timer_Heap_T ( this->max_size_ = static_cast (ACE_Numeric_Limits::max ()); // Create the heap array. +#if defined (ACE_HAS_ALLOC_HOOKS) + this->heap_ = reinterpret_cast **> + (ACE_Allocator::instance ()->malloc (sizeof (ACE_Timer_Node_T *) * this->max_size_)); +#else ACE_NEW (this->heap_, ACE_Timer_Node_T *[this->max_size_]); +#endif /* ACE_HAS_ALLOC_HOOKS */ // Create the parallel array. - ACE_NEW (this->timer_ids_, - ssize_t[this->max_size_]); +#if defined (ACE_HAS_ALLOC_HOOKS) + this->timer_ids_ = reinterpret_cast + (ACE_Allocator::instance ()->malloc (sizeof (ssize_t) * this->max_size_)); +#else + ACE_NEW (this->timer_ids_, + ssize_t[this->max_size_]); +#endif /* ACE_HAS_ALLOC_HOOKS */ // Initialize the "freelist," which uses negative values to // distinguish freelist elements from "pointers" into the @@ -212,8 +230,19 @@ ACE_Timer_Heap_T::~ACE_Timer_Heap_T (void) this->close (); +#if defined (ACE_HAS_ALLOC_HOOKS) + if (this->heap_) + (ACE_Allocator::instance ()->free (this->heap_)); +#else delete [] this->heap_; +#endif /* ACE_HAS_ALLOC_HOOKS */ + +#if defined (ACE_HAS_ALLOC_HOOKS) + if (this->timer_ids_) + (ACE_Allocator::instance ()->free (this->timer_ids_)); +#else delete [] this->timer_ids_; +#endif /* ACE_HAS_ALLOC_HOOKS */ // clean up any preallocated timer nodes if (preallocated_nodes_ != 0) @@ -541,27 +570,48 @@ ACE_Timer_Heap_T::grow_heap (void) // First grow the heap itself. ACE_Timer_Node_T **new_heap = 0; - ACE_NEW (new_heap, - ACE_Timer_Node_T *[new_size]); +#if defined (ACE_HAS_ALLOC_HOOKS) + new_heap = reinterpret_cast **> + (ACE_Allocator::instance ()->malloc (sizeof (ACE_Timer_Node_T *) * new_size)); +#else + ACE_NEW (new_heap, + ACE_Timer_Node_T *[new_size]); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_OS::memcpy (new_heap, this->heap_, this->max_size_ * sizeof *new_heap); + +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_Allocator::instance ()->free (this->heap_); +#else delete [] this->heap_; +#endif /* ACE_HAS_ALLOC_HOOKS */ + this->heap_ = new_heap; // Grow the array of timer ids. ssize_t *new_timer_ids = 0; +#if defined (ACE_HAS_ALLOC_HOOKS) + new_timer_ids = reinterpret_cast + (ACE_Allocator::instance ()->malloc (sizeof (ssize_t) * new_size)); +#else ACE_NEW (new_timer_ids, ssize_t[new_size]); +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_OS::memcpy (new_timer_ids, this->timer_ids_, this->max_size_ * sizeof (ssize_t)); - delete [] timer_ids_; +#if defined (ACE_HAS_ALLOC_HOOKS) + if (this->timer_ids_) + (ACE_Allocator::instance ()->free (this->timer_ids_)); +#else + delete [] this->timer_ids_; +#endif /* ACE_HAS_ALLOC_HOOKS */ this->timer_ids_ = new_timer_ids; // And add the new elements to the end of the "freelist". diff --git a/deps/acelite/ace/Timer_Heap_T.h b/deps/acelite/ace/Timer_Heap_T.h index a6f056c7b..433bb7b74 100644 --- a/deps/acelite/ace/Timer_Heap_T.h +++ b/deps/acelite/ace/Timer_Heap_T.h @@ -4,7 +4,7 @@ /** * @file Timer_Heap_T.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -59,6 +59,9 @@ public: /// Returns the node at the current position in the sequence virtual ACE_Timer_Node_T *item (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /// Pointer to the ACE_Timer_Heap that we are iterating over. Heap & timer_heap_; @@ -90,7 +93,6 @@ public: typedef ACE_Timer_Queue_T Base_Time_Policy; - // = Initialization and termination methods. /** * The Constructor creates a heap with specified number of elements. * This can also take in a upcall functor and freelist (if 0, then @@ -187,6 +189,9 @@ public: /// Reads the earliest node from the queue and returns it. virtual ACE_Timer_Node_T *get_first (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + protected: /** diff --git a/deps/acelite/ace/Timer_List_T.h b/deps/acelite/ace/Timer_List_T.h index dd719b402..181174fb7 100644 --- a/deps/acelite/ace/Timer_List_T.h +++ b/deps/acelite/ace/Timer_List_T.h @@ -4,7 +4,7 @@ /** * @file Timer_List_T.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -94,7 +94,6 @@ public: typedef ACE_Timer_Queue_T Base_Timer_Queue; typedef ACE_Free_List FreeList; - // = Initialization and termination methods. /** * Default constructor. @a upcall_functor is the instance of the * FUNCTOR to be used by the list. If @a upcall_functor is 0, a diff --git a/deps/acelite/ace/Timer_Queue.h b/deps/acelite/ace/Timer_Queue.h index c69491247..c48e6e37b 100644 --- a/deps/acelite/ace/Timer_Queue.h +++ b/deps/acelite/ace/Timer_Queue.h @@ -4,7 +4,7 @@ /** * @file Timer_Queue.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt * @author Irfan Pyarali */ //============================================================================= diff --git a/deps/acelite/ace/Timer_Queue_Adapters.cpp b/deps/acelite/ace/Timer_Queue_Adapters.cpp index b2ccf1a21..7f12d8258 100644 --- a/deps/acelite/ace/Timer_Queue_Adapters.cpp +++ b/deps/acelite/ace/Timer_Queue_Adapters.cpp @@ -159,7 +159,7 @@ ACE_Thread_Timer_Queue_Adapter::ACE_Thread_Timer_Queue_Adapter (ACE_Th : ACE_Task_Base (tm), timer_queue_(timer_queue), delete_timer_queue_(false), - condition_ (mutex_), + condition_ (mutex_, cond_attr_), active_ (true), // Assume that we start in active mode. thr_id_ (ACE_OS::NULL_thread) { diff --git a/deps/acelite/ace/Timer_Queue_Adapters.h b/deps/acelite/ace/Timer_Queue_Adapters.h index a92a260cd..0ba8dc2f0 100644 --- a/deps/acelite/ace/Timer_Queue_Adapters.h +++ b/deps/acelite/ace/Timer_Queue_Adapters.h @@ -4,7 +4,7 @@ /** * @file Timer_Queue_Adapters.h * - * @author Douglas C. Schmidt and + * @author Douglas C. Schmidt and * Carlos O'Ryan */ //============================================================================= @@ -225,6 +225,12 @@ private: /// . ACE_SYNCH_RECURSIVE_MUTEX mutex_; + /// Attributes to initialize condition with. + /* We only need this because some crappy compilers can't + properly handle initializing the conditions with + temporary objects. */ + ACE_Condition_Attributes_T cond_attr_; + /** * The dispatching thread sleeps on this condition while waiting to * dispatch the next timer; it is used to wake it up if there is a diff --git a/deps/acelite/ace/Timer_Queue_Iterator.cpp b/deps/acelite/ace/Timer_Queue_Iterator.cpp index 29a8547ae..2d16088b8 100644 --- a/deps/acelite/ace/Timer_Queue_Iterator.cpp +++ b/deps/acelite/ace/Timer_Queue_Iterator.cpp @@ -2,6 +2,9 @@ #define ACE_TIMER_QUEUE_ITERATOR_CPP #include "ace/config-all.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -13,6 +16,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Timer_Node_T) + template void ACE_Timer_Node_T::dump (void) const { diff --git a/deps/acelite/ace/Timer_Queue_Iterator.h b/deps/acelite/ace/Timer_Queue_Iterator.h index 84f8cbc85..35dc27403 100644 --- a/deps/acelite/ace/Timer_Queue_Iterator.h +++ b/deps/acelite/ace/Timer_Queue_Iterator.h @@ -121,6 +121,9 @@ public: /// Dump the state of an TYPE. void dump (void) const; + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + private: /// Type of object stored in the Queue TYPE type_; @@ -159,7 +162,6 @@ template class ACE_Timer_Queue_Iterator_T { public: - // = Initialization and termination methods. /// Constructor. ACE_Timer_Queue_Iterator_T (void); diff --git a/deps/acelite/ace/Timer_Queue_T.cpp b/deps/acelite/ace/Timer_Queue_T.cpp index 20d5dfbc4..e5a5fbf1f 100644 --- a/deps/acelite/ace/Timer_Queue_T.cpp +++ b/deps/acelite/ace/Timer_Queue_T.cpp @@ -411,11 +411,9 @@ ACE_Timer_Queue_T::dispatch_info_i (const if (this->is_empty ()) return 0; - ACE_Timer_Node_T *expired = 0; - if (this->earliest_time () <= cur_time) { - expired = this->remove_first (); + ACE_Timer_Node_T *expired = this->remove_first (); // Get the dispatch info expired->get_dispatch_info (info); diff --git a/deps/acelite/ace/Timer_Queue_T.h b/deps/acelite/ace/Timer_Queue_T.h index e97002a1c..e1ee3317d 100644 --- a/deps/acelite/ace/Timer_Queue_T.h +++ b/deps/acelite/ace/Timer_Queue_T.h @@ -4,7 +4,7 @@ /** * @file Timer_Queue_T.h * - * @author Doug Schmidt + * @author Doug Schmidt * @author Irfan Pyarali and * @author Darrell Brunsch */ @@ -73,7 +73,9 @@ class ACE_Timer_Queue_T : public ACE_Timer_Queue_Upcall_Base { public: - // = Initialization and termination methods. + /// Type of time policy + typedef TIME_POLICY time_policy_t; + /** * Default constructor. @a upcall_functor is the instance of the * FUNCTOR to be used by the queue. If @a upcall_functor is 0, Timer @@ -185,7 +187,6 @@ public: const void *upcall_act); protected: - /// Schedule a timer. virtual long schedule_i (const TYPE &type, const void *act, @@ -223,7 +224,6 @@ protected: bool const delete_free_list_; private: - /// Returned by . ACE_Time_Value timeout_; diff --git a/deps/acelite/ace/Timer_Wheel_T.cpp b/deps/acelite/ace/Timer_Wheel_T.cpp index e9d4f294e..5c5534618 100644 --- a/deps/acelite/ace/Timer_Wheel_T.cpp +++ b/deps/acelite/ace/Timer_Wheel_T.cpp @@ -311,24 +311,17 @@ ACE_Timer_Wheel_T::generate_timer_id (u_in if (root == root->get_next ()) root->set_act(0); - // We use this field to keep track of the next counter value that - // may be in use. Of course it may have expired, so we just use - // this field so that we know when we don't have to check for duplicates -#if defined (ACE_WIN64) - // The cast below is legit... we know that long is shorter than a - // pointer, but are only using it as a 'long' storage area. -# pragma warning(push) -# pragma warning(disable : 4311) -#endif /* ACE_WIN64 */ - long next_cnt = ACE_Utils::truncate_cast ((intptr_t)root->get_act ()); -#if defined (ACE_WIN64) -# pragma warning(pop) -#endif /* ACE_WIN64 */ - // This field is used as a counter instead of a timer_id. long cnt = root->get_timer_id (); - if (cnt >= max_cnt && root == root->get_next ()) + if (cnt < max_cnt) + { + root->set_timer_id (cnt + 1); + return (cnt << this->spoke_bits_) | spoke; + } + + // Count has overflowed its range. + if (root == root->get_next ()) { // Special case when we overflow on an empty spoke. We can just // wrap the count around without searching for duplicates. We only @@ -337,50 +330,20 @@ ACE_Timer_Wheel_T::generate_timer_id (u_in root->set_timer_id (1); return spoke; } - else if (cnt >= max_cnt) - { // overflow - cnt = 0; // try again starting at zero - } - else if (next_cnt == 0 || cnt < next_cnt) - { - root->set_timer_id (cnt + 1); - return (cnt << this->spoke_bits_) | spoke; - } + // Overflowed count, and the spoke is not empty. Search for an unused + // id value. //ACELIB_ERROR((LM_ERROR, "Timer id overflow. We have to search now.\n")); - - // We've run out of consecutive id numbers so now we have to search - // for a unique id. - // We'll try increasing numbers until we find one that is not in use, - // and we'll record the next highest number so that we can avoid this - // search as often as possible. - for (; cnt < max_cnt - 1; ++cnt) + for (cnt = 0; cnt < max_cnt - 1; ++cnt) { + // Look for an unused id. Yes, every new id on this spoke will result in a + // scan until all the spoke's timers get canceled/expired then the spoke will + // start over like new. So, when an empty spot is found, don't reset the + // root node's timer_id - it stays at max until the spoke clears out and + // starts over. long id = (cnt << this->spoke_bits_) | spoke; - ACE_Timer_Node_T* n = this->find_spoke_node (spoke, id); - if (n == 0) - { - root->set_timer_id (cnt + 1); - // Now we need to find the next highest cnt in use - next_cnt = 0; - for (; n != root; n = n->get_next ()) - { - long tmp = n->get_timer_id () >> this->spoke_bits_; - if (tmp > cnt && (tmp < next_cnt || next_cnt == 0)) - next_cnt = tmp; - } -#if defined (ACE_WIN64) - // The cast below is legit... we know we're storing a long in - // a pointer, but are only using it as a 'long' storage area. -# pragma warning(push) -# pragma warning(disable : 4312) -#endif /* ACE_WIN64 */ - root->set_act (reinterpret_cast (next_cnt)); -#if defined (ACE_WIN64) -# pragma warning(pop) -#endif /* ACE_WIN64 */ - return id; - } + if (0 == this->find_spoke_node (spoke, id)) + return id; } return -1; // We did our best, but the spoke is full. @@ -421,6 +384,10 @@ ACE_Timer_Wheel_T::schedule_i (const TYPE& n->set (type, act, future_time, interval, 0, 0, id); this->schedule_i (n, spoke, future_time); } + else + { + this->free_node (n); + } return id; } diff --git a/deps/acelite/ace/Timer_Wheel_T.h b/deps/acelite/ace/Timer_Wheel_T.h index 22c204ca1..be21c31c0 100644 --- a/deps/acelite/ace/Timer_Wheel_T.h +++ b/deps/acelite/ace/Timer_Wheel_T.h @@ -169,7 +169,6 @@ public: virtual ACE_Timer_Node_T* get_first (void); protected: - /// Schedules a timer. virtual long schedule_i (const TYPE& type, const void* act, @@ -200,8 +199,6 @@ private: u_int spoke_count_; /// Number of timer_id bits used for the spoke int spoke_bits_; - /// Maximum number of timers per spoke - u_int max_per_spoke_; /// Resolution (in microsoconds) of the timing wheel. int res_bits_; /// Index of the list with the earliest time diff --git a/deps/acelite/ace/TkReactor/ACE_TkReactor.pc.in b/deps/acelite/ace/TkReactor/ACE_TkReactor.pc.in deleted file mode 100644 index e53797e60..000000000 --- a/deps/acelite/ace/TkReactor/ACE_TkReactor.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_TkReactor -Description: ACE TkReactor Library -Requires: ACE -Version: @VERSION@ -Libs: -L${libdir} -lACE_TkReactor -Cflags: -I${includedir} diff --git a/deps/acelite/ace/TkReactor/ACE_TkReactor_export.h b/deps/acelite/ace/TkReactor/ACE_TkReactor_export.h deleted file mode 100644 index 905eacb46..000000000 --- a/deps/acelite/ace/TkReactor/ACE_TkReactor_export.h +++ /dev/null @@ -1,57 +0,0 @@ - -// -*- C++ -*- -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s ACE_TkReactor -// ------------------------------ -#ifndef ACE_TKREACTOR_EXPORT_H -#define ACE_TKREACTOR_EXPORT_H - -#include /**/ "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_TKREACTOR_HAS_DLL) -# define ACE_TKREACTOR_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && ACE_TKREACTOR_HAS_DLL */ - -#if !defined (ACE_TKREACTOR_HAS_DLL) -# define ACE_TKREACTOR_HAS_DLL 1 -#endif /* ! ACE_TKREACTOR_HAS_DLL */ - -#if defined (ACE_TKREACTOR_HAS_DLL) && (ACE_TKREACTOR_HAS_DLL == 1) -# if defined (ACE_TKREACTOR_BUILD_DLL) -# define ACE_TkReactor_Export ACE_Proper_Export_Flag -# define ACE_TKREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_TKREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* ACE_TKREACTOR_BUILD_DLL */ -# define ACE_TkReactor_Export ACE_Proper_Import_Flag -# define ACE_TKREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_TKREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_TKREACTOR_BUILD_DLL */ -#else /* ACE_TKREACTOR_HAS_DLL == 1 */ -# define ACE_TkReactor_Export -# define ACE_TKREACTOR_SINGLETON_DECLARATION(T) -# define ACE_TKREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_TKREACTOR_HAS_DLL == 1 */ - -// Set ACE_TKREACTOR_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (ACE_TKREACTOR_NTRACE) -# if (ACE_NTRACE == 1) -# define ACE_TKREACTOR_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define ACE_TKREACTOR_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !ACE_TKREACTOR_NTRACE */ - -#if (ACE_TKREACTOR_NTRACE == 1) -# define ACE_TKREACTOR_TRACE(X) -#else /* (ACE_TKREACTOR_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define ACE_TKREACTOR_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (ACE_TKREACTOR_NTRACE == 1) */ - -#endif /* ACE_TKREACTOR_EXPORT_H */ - -// End of auto generated file. diff --git a/deps/acelite/ace/TkReactor/TkReactor.cpp b/deps/acelite/ace/TkReactor/TkReactor.cpp deleted file mode 100644 index 13c5904cc..000000000 --- a/deps/acelite/ace/TkReactor/TkReactor.cpp +++ /dev/null @@ -1,437 +0,0 @@ -#include "ace/TkReactor/TkReactor.h" - -#include "ace/SOCK_Acceptor.h" -#include "ace/SOCK_Connector.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE (ACE_TkReactor) - -// Must be called with lock held -ACE_TkReactor::ACE_TkReactor (size_t size, - bool restart, - ACE_Sig_Handler *h) - : ACE_Select_Reactor (size, restart, h), - ids_ (0), - timeout_ (0) -{ - // When the ACE_Select_Reactor is constructed it creates the notify - // pipe and registers it with the register_handler_i() method. The - // TkReactor overloads this method BUT because the - // register_handler_i occurs when constructing the base class - // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i() - // is called not the TkReactor register_handler_i(). This means - // that the notify pipe is registered with the ACE_Select_Reactor - // event handling code not the TkReactor and so notfications don't - // work. To get around this we simply close and re-opened the - // notification handler in the constructor of the TkReactor. - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - this->notify_handler_->close (); - this->notify_handler_->open (this, 0); -#endif /* ACE_MT_SAFE */ -} - -ACE_TkReactor::~ACE_TkReactor (void) -{ - // Delete the remaining items in the linked list. - - while (this->ids_) - { - ACE_TkReactorID *TkID = this->ids_->next_; - delete this->ids_; - this->ids_ = TkID; - } -} - -// This is just the from ace/Reactor.cpp -// but we use the Tk functions to wait for an event, not to find out which - * one might be available. - */ -void -ACE_TkReactor::InputCallbackProc (ClientData cd, - int /* mask */) -{ - ACE_TkReactor_Input_Callback *callback = (ACE_TkReactor_Input_Callback *) cd; - ACE_TkReactor *self = callback->reactor_; - ACE_HANDLE handle = callback->handle_; - - // my copy isn't const. - ACE_Time_Value zero = ACE_Time_Value::zero; - - ACE_Select_Reactor_Handle_Set wait_set; - - // Deal with one file event. - - // - read which kind of event - if (self->wait_set_.rd_mask_.is_set (handle)) - wait_set.rd_mask_.set_bit (handle); - if (self->wait_set_.wr_mask_.is_set (handle)) - wait_set.wr_mask_.set_bit (handle); - if (self->wait_set_.ex_mask_.is_set (handle)) - wait_set.ex_mask_.set_bit (handle); - - int result = ACE_OS::select (handle + 1, - wait_set.rd_mask_, - wait_set.wr_mask_, - wait_set.ex_mask_, &zero); - - ACE_Select_Reactor_Handle_Set dispatch_set; - - // - Use only that one file event (removes events for other files). - if (result > 0) - { - if (wait_set.rd_mask_.is_set (handle)) - dispatch_set.rd_mask_.set_bit (handle); - if (wait_set.wr_mask_.is_set (handle)) - dispatch_set.wr_mask_.set_bit (handle); - if (wait_set.ex_mask_.is_set (handle)) - dispatch_set.ex_mask_.set_bit (handle); - - self->dispatch (1, dispatch_set); - } -} - -int -ACE_TkReactor::TkWaitForMultipleEvents (int width, - ACE_Select_Reactor_Handle_Set &wait_set, - ACE_Time_Value *) -{ - // Check to make sure our handle's are all usable. - ACE_Select_Reactor_Handle_Set temp_set = wait_set; - - if (ACE_OS::select (width, - temp_set.rd_mask_, - temp_set.wr_mask_, - temp_set.ex_mask_, - (ACE_Time_Value *) &ACE_Time_Value::zero) == -1) - return -1; // Bad file arguments... - - // Instead of waiting using . - return ACE_OS::select (width, - wait_set.rd_mask_, - wait_set.wr_mask_, - wait_set.ex_mask_, - (ACE_Time_Value *) &ACE_Time_Value::zero); -} - -int -ACE_TkReactor::register_handler_i (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_TkReactor::register_handler_i"); - - int result = ACE_Select_Reactor::register_handler_i (handle, - handler, mask); - if (result == -1) - return -1; - - int condition = 0; - -#if !defined ACE_WIN32 - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) - ACE_SET_BITS (condition, TK_READABLE); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) - ACE_SET_BITS (condition, TK_WRITABLE); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) - ACE_SET_BITS (condition, TK_EXCEPTION); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK)) - ACE_SET_BITS (condition, TK_READABLE); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)){ - ACE_SET_BITS (condition, TK_READABLE); // connected, you may write - ACE_SET_BITS (condition, TK_WRITABLE); // connected, you have data/err - } -#else - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) - ACE_SET_BITS (condition, TK_READABLE); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) - ACE_SET_BITS (condition, TK_WRITABLE); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) - ACE_NOTSUP_RETURN(-1); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK)) - ACE_SET_BITS (condition, TK_READABLE); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)){ - ACE_SET_BITS (condition, TK_READABLE); // connected, you may write - ACE_SET_BITS (condition, TK_WRITABLE); // connected, you have data/err - } -#endif /* !ACE_WIN32 */ - - if (condition != 0) - { - ACE_TkReactorID *TkID = this->ids_; - - while(TkID) - { - if (TkID->handle_ == handle) - { - ::Tk_DeleteFileHandler (TkID->handle_); - - ACE_TkReactor_Input_Callback *callback; - ACE_NEW_RETURN (callback, - ACE_TkReactor_Input_Callback, - -1); - callback->reactor_ = this; - callback->handle_ = handle; - ::Tk_CreateFileHandler ((int) handle, - condition, - InputCallbackProc, - (ClientData) callback); - return 0; - } - else - TkID = TkID->next_; - } - - ACE_NEW_RETURN (TkID, - ACE_TkReactorID, - -1); - TkID->next_ = this->ids_; - TkID->handle_ = handle; - ACE_TkReactor_Input_Callback *callback; - ACE_NEW_RETURN (callback, - ACE_TkReactor_Input_Callback, - -1); - callback->reactor_ = this; - callback->handle_ = handle; - - ::Tk_CreateFileHandler ((int) handle, - condition, - InputCallbackProc, - (ClientData) callback); - this->ids_ = TkID; - } - return 0; -} - -int -ACE_TkReactor::register_handler_i (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - return ACE_Select_Reactor::register_handler_i (handles, - handler, - mask); -} - -int -ACE_TkReactor::remove_handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_TkReactor::remove_handler_i"); - - // In the registration phase we registered first with - // ACE_Select_Reactor and then with X. Now we are now doing things - // in reverse order. - - // First clean up the corresponding X11Input. - this->remove_TkFileHandler (handle); - - // Now let the reactor do its work. - return ACE_Select_Reactor::remove_handler_i (handle, - mask); -} - -void -ACE_TkReactor::remove_TkFileHandler (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_TkReactor::remove_TkFileHandler"); - - ACE_TkReactorID *TkID = this->ids_; - - if (TkID) - { - if (TkID->handle_ == handle) - { - ::Tk_DeleteFileHandler (TkID->handle_); - this->ids_ = TkID->next_; - delete TkID; - return; - } - - ACE_TkReactorID *NextID = TkID->next_; - - while (NextID) - { - if (NextID->handle_ == handle) - { - ::Tk_DeleteFileHandler (NextID->handle_); - TkID->next_ = NextID->next_; - delete NextID; - return; - } - else - { - TkID = NextID; - NextID = NextID->next_; - } - } - } -} - -int -ACE_TkReactor::remove_handler_i (const ACE_Handle_Set &handles, - ACE_Reactor_Mask mask) -{ - return ACE_Select_Reactor::remove_handler_i (handles, - mask); -} - -// The following functions ensure that there is an Tk timeout for the -// first timeout in the Reactor's Timer_Queue. - -void -ACE_TkReactor::reset_timeout (void) -{ - if (this->timeout_) - ::Tk_DeleteTimerHandler (this->timeout_); - timeout_ = 0; - - ACE_Time_Value *max_wait_time = - this->timer_queue_->calculate_timeout (0); - - if (max_wait_time) - timeout_ = ::Tk_CreateTimerHandler (max_wait_time->msec (), - TimerCallbackProc, - (ClientData) this); -} - -int -ACE_TkReactor::reset_timer_interval - (long timer_id, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_TkReactor::reset_timer_interval"); - ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1)); - - int result = ACE_Select_Reactor::timer_queue_->reset_interval - (timer_id, - interval); - - if (result == -1) - return -1; - else - { - this->reset_timeout (); - return result; - } -} - -long -ACE_TkReactor::schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_TkReactor::schedule_timer"); - ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1)); - - long result = ACE_Select_Reactor::schedule_timer (event_handler, - arg, - delay, - interval); - if (result == -1) - return -1; - else - { - this->reset_timeout (); - return result; - } -} - -int -ACE_TkReactor::cancel_timer (ACE_Event_Handler *handler, - int dont_call_handle_close) -{ - ACE_TRACE ("ACE_TkReactor::cancel_timer"); - - if (ACE_Select_Reactor::cancel_timer (handler, - dont_call_handle_close) == -1) - return -1; - else - { - this->reset_timeout (); - return 0; - } -} - -int -ACE_TkReactor::cancel_timer (long timer_id, - const void **arg, - int dont_call_handle_close) -{ - ACE_TRACE ("ACE_TkReactor::cancel_timer"); - - if (ACE_Select_Reactor::cancel_timer (timer_id, - arg, - dont_call_handle_close) == -1) - return -1; - else - { - this->reset_timeout (); - return 0; - } -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/TkReactor/TkReactor.h b/deps/acelite/ace/TkReactor/TkReactor.h deleted file mode 100644 index adedbb098..000000000 --- a/deps/acelite/ace/TkReactor/TkReactor.h +++ /dev/null @@ -1,134 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file TkReactor.h - * - * @author Nagarajan Surendran - */ -//============================================================================= - - -#ifndef ACE_TKREACTOR_H -#define ACE_TKREACTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/TkReactor/ACE_TkReactor_export.h" -#include "ace/Select_Reactor.h" -#include /**/ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_TkReactorID - * - * @brief This little class is necessary due to the way that Microsoft - * implements sockets to be pointers rather than indices. - */ -class ACE_TkReactor_Export ACE_TkReactorID -{ -public: - /// Underlying handle. - ACE_HANDLE handle_; - - /// Pointer to next node in the linked list. - ACE_TkReactorID *next_; -}; - -class ACE_TkReactor; - -class ACE_TkReactor_Export ACE_TkReactor_Input_Callback -{ -public: - ACE_TkReactor *reactor_; - ACE_HANDLE handle_; -}; - -/** - * @class ACE_TkReactor - * - * @brief An object-oriented event demultiplexor and event handler - * dispatcher that uses the Tk functions. - */ -class ACE_TkReactor_Export ACE_TkReactor : public ACE_Select_Reactor -{ -public: - // = Initialization and termination methods. - ACE_TkReactor (size_t size = DEFAULT_SIZE, - bool restart = false, - ACE_Sig_Handler * = 0); - - virtual ~ACE_TkReactor (void); - - // = Timer operations. - virtual long schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval); - virtual int reset_timer_interval (long timer_id, - const ACE_Time_Value &interval); - virtual int cancel_timer (ACE_Event_Handler *handler, - int dont_call_handle_close = 1); - virtual int cancel_timer (long timer_id, - const void **arg = 0, - int dont_call_handle_close = 1); - -protected: - // = Register timers/handles with Tk. - /// Register a single @a handler. - virtual int register_handler_i (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - - /// Register a set of . - virtual int register_handler_i (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - - /// Remove the @a handler associated with this @a handle. - virtual int remove_handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - - /// Remove a set of . - virtual int remove_handler_i (const ACE_Handle_Set &handles, - ACE_Reactor_Mask); - - /// Removes an Tk FileHandler. - virtual void remove_TkFileHandler (ACE_HANDLE handle); - - /// Wait for events to occur. - virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &, - ACE_Time_Value *); - - ///Wait for Tk events to occur. - virtual int TkWaitForMultipleEvents (int, - ACE_Select_Reactor_Handle_Set &, - ACE_Time_Value *); - - ACE_TkReactorID *ids_; - Tk_TimerToken timeout_; - -private: - /// This method ensures there's a Tk timeout for the first timeout in - /// the Reactor's Timer_Queue. - void reset_timeout (void); - - // = Integrate with the X callback function mechanism. - static void TimerCallbackProc (ClientData cd); - static void InputCallbackProc (ClientData cd,int mask); - - /// Deny access since member-wise won't work... - ACE_TkReactor (const ACE_TkReactor &); - ACE_TkReactor &operator = (const ACE_TkReactor &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_TK_REACTOR_H */ diff --git a/deps/acelite/ace/TkReactor/ace_tkreactor.mpc b/deps/acelite/ace/TkReactor/ace_tkreactor.mpc deleted file mode 100644 index 6389e320d..000000000 --- a/deps/acelite/ace/TkReactor/ace_tkreactor.mpc +++ /dev/null @@ -1,9 +0,0 @@ -// -*- MPC -*- now wouldn't this be cool... -project(ACE_TkReactor) : acedefaults, install, acelib, ace_output, ace_tk { - sharedname = ACE_TkReactor - dynamicflags += ACE_TKREACTOR_BUILD_DLL - - specific { - install_dir = ace/TkReactor - } -} diff --git a/deps/acelite/ace/Token.cpp b/deps/acelite/ace/Token.cpp index 1cb261bfc..86acaf07d 100644 --- a/deps/acelite/ace/Token.cpp +++ b/deps/acelite/ace/Token.cpp @@ -294,7 +294,7 @@ ACE_Token::shared_acquire (void (*sleep_hook_func)(void *), ACELIB_DEBUG ((LM_DEBUG, "(%t) ACE_Token::shared_acquire (UNBLOCKED)\n")); #endif /* ACE_TOKEN_DEBUGGING */ - // If timeout occured + // If timeout occurred if (timed_out) { // This thread was still selected to own the token. @@ -440,7 +440,7 @@ ACE_Token::renew (int requeue_position, ACELIB_DEBUG ((LM_DEBUG, "(%t) ACE_Token::renew (UNBLOCKED)\n")); #endif /* ACE_TOKEN_DEBUGGING */ - // If timeout occured + // If timeout occurred if (timed_out) { // This thread was still selected to own the token. diff --git a/deps/acelite/ace/Token.h b/deps/acelite/ace/Token.h index 817364504..dc57e14af 100644 --- a/deps/acelite/ace/Token.h +++ b/deps/acelite/ace/Token.h @@ -7,7 +7,7 @@ * @author Original author * @author Karl-Heinz Dorn (kdorn@erlh.siemens.de) * @author Ported to ACE by - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) + * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) */ //============================================================================= @@ -74,7 +74,6 @@ class ACE_Time_Value; class ACE_Export ACE_Token { public: - /** * Available queueing strategies. */ @@ -86,8 +85,6 @@ public: LIFO = 0 }; - // = Initialization and termination. - /// Constructor ACE_Token (const ACE_TCHAR *name = 0, void * = 0); diff --git a/deps/acelite/ace/Token_Collection.h b/deps/acelite/ace/Token_Collection.h index c5be0aa13..c4b55ce44 100644 --- a/deps/acelite/ace/Token_Collection.h +++ b/deps/acelite/ace/Token_Collection.h @@ -12,7 +12,7 @@ * * The atomic group operations are not yet implemented. * - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) + * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) * @author Tim Harrison (harrison@cs.wustl.edu) */ //============================================================================= diff --git a/deps/acelite/ace/Token_Request_Reply.h b/deps/acelite/ace/Token_Request_Reply.h index edb7c5d9a..dd1a03bcd 100644 --- a/deps/acelite/ace/Token_Request_Reply.h +++ b/deps/acelite/ace/Token_Request_Reply.h @@ -7,7 +7,7 @@ * Define the format used to exchange messages between the * ACE_Token Server and its clients. * - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) + * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) * @author Tim Harrison (harrison@cs.wustl.edu) */ //============================================================================= diff --git a/deps/acelite/ace/Tokenizer_T.cpp b/deps/acelite/ace/Tokenizer_T.cpp index 7c2924e03..5be90545e 100644 --- a/deps/acelite/ace/Tokenizer_T.cpp +++ b/deps/acelite/ace/Tokenizer_T.cpp @@ -4,7 +4,6 @@ #include "ace/ACE.h" #include "ace/Malloc_Base.h" #include "ace/String_Base.h" -#include "ace/Auto_Ptr.h" #include "ace/OS_NS_string.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Tokenizer_T.h b/deps/acelite/ace/Tokenizer_T.h index d3bba9491..686004873 100644 --- a/deps/acelite/ace/Tokenizer_T.h +++ b/deps/acelite/ace/Tokenizer_T.h @@ -4,7 +4,7 @@ /** * @file Tokenizer_T.h * - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) + * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) * @author Nanbor Wang */ //============================================================================= diff --git a/deps/acelite/ace/Trace.cpp b/deps/acelite/ace/Trace.cpp index 246de3b05..9259a8a19 100644 --- a/deps/acelite/ace/Trace.cpp +++ b/deps/acelite/ace/Trace.cpp @@ -8,6 +8,9 @@ #include "ace/Log_Category.h" #include "ace/Object_Manager_Base.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/Trace.h b/deps/acelite/ace/Trace.h index f70f35bbf..dee73c6ed 100644 --- a/deps/acelite/ace/Trace.h +++ b/deps/acelite/ace/Trace.h @@ -4,7 +4,7 @@ /** * @file Trace.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -34,8 +34,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Trace { public: - // = Initialization and termination methods. - /// Perform the first part of the trace, which prints out the string /// N, the LINE, and the ACE_FILE as the function is entered. ACE_Trace (const ACE_TCHAR *n, @@ -46,6 +44,9 @@ public: /// as the function is exited. ~ACE_Trace (void); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + // = Control the tracing level. /// Determine if tracing is enabled or not static bool is_tracing(void); diff --git a/deps/acelite/ace/Truncate.h b/deps/acelite/ace/Truncate.h index 528f4a3a6..fd9fed20f 100644 --- a/deps/acelite/ace/Truncate.h +++ b/deps/acelite/ace/Truncate.h @@ -32,28 +32,28 @@ namespace ACE_Utils template struct Sign_Check; // Specialize the unsigned signed cases. - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; + template<> struct Sign_Check { static bool const is_signed = false; }; + template<> struct Sign_Check { static bool const is_signed = false; }; + template<> struct Sign_Check { static bool const is_signed = false; }; + template<> struct Sign_Check { static bool const is_signed = false; }; # ifdef __GNUC__ // Silence g++ "-pedantic" warnings regarding use of "long long" // type. __extension__ # endif /* __GNUC__ */ - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; + template<> struct Sign_Check { static bool const is_signed = false; }; // Specialize the signed cases. - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; + template<> struct Sign_Check { static bool const is_signed = true; }; + template<> struct Sign_Check { static bool const is_signed = true; }; + template<> struct Sign_Check { static bool const is_signed = true; }; + template<> struct Sign_Check { static bool const is_signed = true; }; # ifdef __GNUC__ // Silence g++ "-pedantic" warnings regarding use of "long long" // type. __extension__ # endif /* __GNUC__ */ - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; + template<> struct Sign_Check { static bool const is_signed = true; }; // ----------------------------------------------------- @@ -271,9 +271,8 @@ namespace ACE_Utils template struct Fast_Comparator { - ACE_STATIC_CONSTANT ( - bool, - USE_LEFT = ((sizeof (LEFT) > sizeof (RIGHT) + static bool const USE_LEFT = + ((sizeof (LEFT) > sizeof (RIGHT) && (Sign_Check::is_signed == 1 || Sign_Check::is_signed == 0)) @@ -289,15 +288,14 @@ namespace ACE_Utils && ((Sign_Check::is_signed == 1 && Sign_Check::is_signed == 1) || (Sign_Check::is_signed == 0 - && Sign_Check::is_signed == 0))))); + && Sign_Check::is_signed == 0)))); - ACE_STATIC_CONSTANT ( - bool, - USE_RIGHT = (sizeof (RIGHT) > sizeof (LEFT) + static bool const USE_RIGHT = + (sizeof (RIGHT) > sizeof (LEFT) && (Sign_Check::is_signed == 1 - || Sign_Check::is_signed == 0))); + || Sign_Check::is_signed == 0)); - ACE_STATIC_CONSTANT (bool, USABLE = (USE_LEFT || USE_RIGHT)); + static bool const USABLE = (USE_LEFT || USE_RIGHT); typedef typename ACE::If_Then_Else< USE_LEFT, @@ -370,12 +368,11 @@ namespace ACE_Utils template struct Truncator { - ACE_STATIC_CONSTANT ( - bool, + static bool const // max FROM always greater than max TO MAX_FROM_GT_MAX_TO = (sizeof(FROM) > sizeof (TO) || (sizeof(FROM) == sizeof (TO) - && Sign_Check::is_signed == 0))); + && Sign_Check::is_signed == 0)); typedef typename ACE::If_Then_Else< MAX_FROM_GT_MAX_TO, diff --git a/deps/acelite/ace/Typed_SV_Message.h b/deps/acelite/ace/Typed_SV_Message.h index 50ef362fb..193c462da 100644 --- a/deps/acelite/ace/Typed_SV_Message.h +++ b/deps/acelite/ace/Typed_SV_Message.h @@ -32,7 +32,6 @@ template class ACE_Typed_SV_Message { public: - // = Initialization and termination methods. ACE_Typed_SV_Message (long type = 0, int length = sizeof (T), int max_size = sizeof (T)); diff --git a/deps/acelite/ace/Typed_SV_Message_Queue.h b/deps/acelite/ace/Typed_SV_Message_Queue.h index b10baf4cb..74a0cc142 100644 --- a/deps/acelite/ace/Typed_SV_Message_Queue.h +++ b/deps/acelite/ace/Typed_SV_Message_Queue.h @@ -4,7 +4,7 @@ /** * @file Typed_SV_Message_Queue.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -38,7 +38,6 @@ public: ACE_NOWAIT = IPC_NOWAIT }; - // = Initialization and termination operations. ACE_Typed_SV_Message_Queue (void); ACE_Typed_SV_Message_Queue (key_t external_id, int create = ACE_OPEN, diff --git a/deps/acelite/ace/UNIX_Addr.cpp b/deps/acelite/ace/UNIX_Addr.cpp index 970e4f274..460c58fc4 100644 --- a/deps/acelite/ace/UNIX_Addr.cpp +++ b/deps/acelite/ace/UNIX_Addr.cpp @@ -4,6 +4,10 @@ #if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ + #if !defined (__ACE_INLINE__) #include "ace/UNIX_Addr.inl" #endif /* __ACE_INLINE__ */ @@ -37,6 +41,10 @@ ACE_UNIX_Addr::string_to_addr (const char addr[]) { ACE_OS::strsncpy (this->unix_addr_.sun_path, addr, sizeof this->unix_addr_.sun_path); + + this->set_size (sizeof this->unix_addr_ - + sizeof (this->unix_addr_.sun_path) + + ACE_OS::strlen (this->unix_addr_.sun_path)); return 0; } @@ -67,7 +75,8 @@ ACE_UNIX_Addr::dump (void) const // Do nothing constructor. ACE_UNIX_Addr::ACE_UNIX_Addr (void) - : ACE_Addr (AF_UNIX, sizeof this->unix_addr_) + : ACE_Addr (AF_UNIX, + sizeof this->unix_addr_ - sizeof (this->unix_addr_.sun_path)) { (void) ACE_OS::memset ((void *) &this->unix_addr_, 0, diff --git a/deps/acelite/ace/UNIX_Addr.h b/deps/acelite/ace/UNIX_Addr.h index 02749abf0..d0851feb3 100644 --- a/deps/acelite/ace/UNIX_Addr.h +++ b/deps/acelite/ace/UNIX_Addr.h @@ -37,7 +37,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_UNIX_Addr : public ACE_Addr { public: - // = Initialization methods. /// Default constructor. ACE_UNIX_Addr (void); diff --git a/deps/acelite/ace/UPIPE_Acceptor.h b/deps/acelite/ace/UPIPE_Acceptor.h index 432fac53f..b5b13a048 100644 --- a/deps/acelite/ace/UPIPE_Acceptor.h +++ b/deps/acelite/ace/UPIPE_Acceptor.h @@ -36,7 +36,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_UPIPE_Acceptor : public ACE_SPIPE_Acceptor { public: - // = Initialization and termination. /// Default constructor. ACE_UPIPE_Acceptor (void); diff --git a/deps/acelite/ace/UPIPE_Connector.h b/deps/acelite/ace/UPIPE_Connector.h index fff02dc59..ddfd3c077 100644 --- a/deps/acelite/ace/UPIPE_Connector.h +++ b/deps/acelite/ace/UPIPE_Connector.h @@ -32,7 +32,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_UPIPE_Connector { public: - // = Initialization methods. /// Default constructor. ACE_UPIPE_Connector (void); diff --git a/deps/acelite/ace/UPIPE_Stream.h b/deps/acelite/ace/UPIPE_Stream.h index 491c8799c..f81b76ae5 100644 --- a/deps/acelite/ace/UPIPE_Stream.h +++ b/deps/acelite/ace/UPIPE_Stream.h @@ -41,8 +41,6 @@ public: typedef ACE_Stream MT_Stream; - // = Initialization and Termination. - ACE_UPIPE_Stream (void); virtual ~ACE_UPIPE_Stream (void); diff --git a/deps/acelite/ace/UUID.cpp b/deps/acelite/ace/UUID.cpp index b8206531e..dbac895fb 100644 --- a/deps/acelite/ace/UUID.cpp +++ b/deps/acelite/ace/UUID.cpp @@ -20,11 +20,15 @@ namespace ACE_Utils // NIL version of the UUID const UUID UUID::NIL_UUID; +#ifndef ACE_LACKS_SSCANF UUID::UUID (const ACE_CString& uuid_string) { this->init (); this->from_string_i (uuid_string); } +#endif /* ACE_LACKS_SSCANF */ + + ACE_ALLOC_HOOK_DEFINE(UUID); const UUID & UUID::operator = (const UUID & rhs) @@ -65,52 +69,65 @@ namespace ACE_Utils if (36 == UUID_STRING_LENGTH) { +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (buf, + static_cast (ACE_Allocator::instance()->malloc(sizeof (char) * (UUID_STRING_LENGTH + 1))), + 0); +#else ACE_NEW_RETURN (buf, char[UUID_STRING_LENGTH + 1], 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ // Let the auto array pointer manage the buffer. auto_clean.reset (buf); - ACE_OS::sprintf (buf, - "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x", - this->uuid_.time_low_, - this->uuid_.time_mid_, - this->uuid_.time_hi_and_version_, - this->uuid_.clock_seq_hi_and_reserved_, - this->uuid_.clock_seq_low_, - (this->uuid_.node_.node_ID ()) [0], - (this->uuid_.node_.node_ID ()) [1], - (this->uuid_.node_.node_ID ()) [2], - (this->uuid_.node_.node_ID ()) [3], - (this->uuid_.node_.node_ID ()) [4], - (this->uuid_.node_.node_ID ()) [5]); + ACE_OS::snprintf (buf, UUID_STRING_LENGTH + 1, + "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x", + this->uuid_.time_low_, + this->uuid_.time_mid_, + this->uuid_.time_hi_and_version_, + this->uuid_.clock_seq_hi_and_reserved_, + this->uuid_.clock_seq_low_, + this->uuid_.node_.node_ID ()[0], + this->uuid_.node_.node_ID ()[1], + this->uuid_.node_.node_ID ()[2], + this->uuid_.node_.node_ID ()[3], + this->uuid_.node_.node_ID ()[4], + this->uuid_.node_.node_ID ()[5]); } else { UUID_STRING_LENGTH += 2; //for '-' + +#if defined (ACE_HAS_ALLOC_HOOKS) + ACE_ALLOCATOR_RETURN (buf, + static_cast (ACE_Allocator::instance()->malloc(sizeof (char) * (UUID_STRING_LENGTH + 1))), + 0); +#else ACE_NEW_RETURN (buf, char[UUID_STRING_LENGTH + 1], 0); +#endif /* ACE_HAS_ALLOC_HOOKS */ // Let the auto array pointer manage the buffer. auto_clean.reset (buf); - ACE_OS::sprintf (buf, - "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x-%s-%s", - this->uuid_.time_low_, - this->uuid_.time_mid_, - this->uuid_.time_hi_and_version_, - this->uuid_.clock_seq_hi_and_reserved_, - this->uuid_.clock_seq_low_, - (this->uuid_.node_.node_ID ()) [0], - (this->uuid_.node_.node_ID ()) [1], - (this->uuid_.node_.node_ID ()) [2], - (this->uuid_.node_.node_ID ()) [3], - (this->uuid_.node_.node_ID ()) [4], - (this->uuid_.node_.node_ID ()) [5], - thr_id_.c_str (), - pid_.c_str ()); + ACE_OS::snprintf (buf, UUID_STRING_LENGTH + 1, + "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x-%s-%s", + this->uuid_.time_low_, + this->uuid_.time_mid_, + this->uuid_.time_hi_and_version_, + this->uuid_.clock_seq_hi_and_reserved_, + this->uuid_.clock_seq_low_, + this->uuid_.node_.node_ID ()[0], + this->uuid_.node_.node_ID ()[1], + this->uuid_.node_.node_ID ()[2], + this->uuid_.node_.node_ID ()[3], + this->uuid_.node_.node_ID ()[4], + this->uuid_.node_.node_ID ()[5], + thr_id_.c_str (), + pid_.c_str ()); } // Save the string. @@ -124,6 +141,7 @@ namespace ACE_Utils return this->as_string_.get (); } +#ifndef ACE_LACKS_SSCANF void UUID::from_string_i (const ACE_CString& uuid_string) { @@ -160,9 +178,6 @@ namespace ACE_Utils const int nScanned = #if defined (ACE_HAS_TR24731_2005_CRT) sscanf_s ( -#else - ::sscanf ( -#endif /* ACE_HAS_TR24731_2005_CRT */ uuid_string.c_str (), "%8x-%4x-%4x-%2x%2x-%2x%2x%2x%2x%2x%2x", &time_low, @@ -177,6 +192,23 @@ namespace ACE_Utils &node[4], &node[5] ); +#else + ::sscanf ( + uuid_string.c_str (), + "%8x-%4x-%4x-%2x%2x-%2x%2x%2x%2x%2x%2x", + &time_low, + &time_mid, + &time_hi_and_version, + &clock_seq_hi_and_reserved, + &clock_seq_low, + &node[0], + &node[1], + &node[2], + &node[3], + &node[4], + &node[5] + ); +#endif /* ACE_HAS_TR24731_2005_CRT */ if (nScanned != 11) { @@ -285,6 +317,7 @@ namespace ACE_Utils this->pid_ = thr_pid_str.substr (pos+1, thr_pid_str.length ()-pos-1); } } +#endif // ACE_LACKS_SSCANF UUID_Generator::UUID_Generator (void) : time_last_ (0), @@ -373,12 +406,11 @@ namespace ACE_Utils { ACE_Thread_ID thread_id; char buf [BUFSIZ]; - thread_id.to_string (buf); + thread_id.to_string (buf, BUFSIZ); uuid.thr_id (buf); - ACE_OS::sprintf (buf, - "%d", - static_cast (ACE_OS::getpid ())); + ACE_OS::snprintf (buf, BUFSIZ, "%d", + static_cast (ACE_OS::getpid ())); uuid.pid (buf); } } diff --git a/deps/acelite/ace/UUID.h b/deps/acelite/ace/UUID.h index 6b26fb33f..5ed3877da 100644 --- a/deps/acelite/ace/UUID.h +++ b/deps/acelite/ace/UUID.h @@ -88,8 +88,10 @@ namespace ACE_Utils /// Constructor UUID (void); +#ifndef ACE_LACKS_SSCANF /// Constructs a UUID from a string representation. UUID (const ACE_CString& uuidString); +#endif UUID (const UUID &right); @@ -125,8 +127,10 @@ namespace ACE_Utils /// Returns a string representation of the UUID const ACE_CString* to_string (void) const; +#ifndef ACE_LACKS_SSCANF /// Set the value using a string void from_string (const ACE_CString& uuid_string); +#endif /// NIL UUID static const UUID NIL_UUID; @@ -141,6 +145,8 @@ namespace ACE_Utils /// Assign an existing UUID to this UUID. const UUID & operator = (const UUID & rhs); + ACE_ALLOC_HOOK_DECLARE; + private: /// Initialize the UUID void init (void); @@ -150,7 +156,9 @@ namespace ACE_Utils * * @param[in] uuid_string String version of UUID. */ +#ifndef ACE_LACKS_SSCANF void from_string_i (const ACE_CString& uuid_string); +#endif /// Data Members for Class Attributes struct data @@ -259,7 +267,7 @@ namespace ACE_Utils bool destroy_lock_; - /// Initalization state of the generator. + /// Initialization state of the generator. bool is_init_; }; @@ -277,4 +285,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif // ACE_UUID_H - diff --git a/deps/acelite/ace/UUID.inl b/deps/acelite/ace/UUID.inl index a497da646..cf3a3c150 100644 --- a/deps/acelite/ace/UUID.inl +++ b/deps/acelite/ace/UUID.inl @@ -153,11 +153,13 @@ namespace ACE_Utils this->pid_ = pid; } +#ifndef ACE_LACKS_SSCANF ACE_INLINE void UUID::from_string (const ACE_CString& uuidString) { this->from_string_i (uuidString); } +#endif ACE_INLINE bool UUID::operator == (const UUID &right) const diff --git a/deps/acelite/ace/Unbounded_Queue.cpp b/deps/acelite/ace/Unbounded_Queue.cpp index 28f122d0c..02f96eeab 100644 --- a/deps/acelite/ace/Unbounded_Queue.cpp +++ b/deps/acelite/ace/Unbounded_Queue.cpp @@ -17,7 +17,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Queue) +ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Unbounded_Queue) template ACE_Unbounded_Queue::ACE_Unbounded_Queue (ACE_Allocator *alloc) diff --git a/deps/acelite/ace/Unbounded_Queue.h b/deps/acelite/ace/Unbounded_Queue.h index 8c2172ec8..cb0c748f9 100644 --- a/deps/acelite/ace/Unbounded_Queue.h +++ b/deps/acelite/ace/Unbounded_Queue.h @@ -4,7 +4,7 @@ /** * @file Unbounded_Queue.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -36,7 +36,6 @@ template class ACE_Unbounded_Queue_Iterator { public: - // = Initialization method. ACE_Unbounded_Queue_Iterator (ACE_Unbounded_Queue &q, int end = 0); // = Iteration methods. @@ -79,7 +78,6 @@ template class ACE_Unbounded_Queue_Const_Iterator { public: - // = Initialization method. ACE_Unbounded_Queue_Const_Iterator (const ACE_Unbounded_Queue &q, int end = 0); // = Iteration methods. @@ -154,7 +152,6 @@ public: typedef ACE_Unbounded_Queue_Iterator ITERATOR; typedef ACE_Unbounded_Queue_Const_Iterator CONST_ITERATOR; - // = Initialization and termination methods. /// Construction. Use user specified allocation strategy /// if specified. /** diff --git a/deps/acelite/ace/Unbounded_Set.h b/deps/acelite/ace/Unbounded_Set.h index 90ae7653d..890b4413b 100644 --- a/deps/acelite/ace/Unbounded_Set.h +++ b/deps/acelite/ace/Unbounded_Set.h @@ -4,7 +4,7 @@ /** * @file Unbounded_Set.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -46,7 +46,6 @@ class ACE_Unbounded_Set_Iterator : public public: typedef ACE_Unbounded_Set_Ex_Iterator > base_type; - // = Initialization method. ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set &s, bool end = false); ACE_Unbounded_Set_Iterator (const base_type &s); @@ -64,7 +63,6 @@ public: typedef ACE_Unbounded_Set_Ex_Const_Iterator > base_type; - // = Initialization method. ACE_Unbounded_Set_Const_Iterator (const ACE_Unbounded_Set &s, bool end = false); diff --git a/deps/acelite/ace/Unbounded_Set_Ex.cpp b/deps/acelite/ace/Unbounded_Set_Ex.cpp index 7692a4039..d6460cef1 100644 --- a/deps/acelite/ace/Unbounded_Set_Ex.cpp +++ b/deps/acelite/ace/Unbounded_Set_Ex.cpp @@ -15,7 +15,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Set_Ex) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Unbounded_Set_Ex) template size_t ACE_Unbounded_Set_Ex::size (void) const @@ -226,7 +226,7 @@ ACE_Unbounded_Set_Ex::remove (const T &item) { // ACE_TRACE ("ACE_Unbounded_Set_Ex::remove"); - // Insert the item to be founded into the dummy node. + // Insert the item to be found into the dummy node. this->head_->item_ = item; NODE *curr = this->head_; @@ -234,6 +234,11 @@ ACE_Unbounded_Set_Ex::remove (const T &item) while (!(this->comp_ (curr->next_->item_, item))) curr = curr->next_; + // reset the dummy node. This ensures reference counted items are + // completely released. Without this, a reference can linger as + // the dummy long after it was removed from the list. + this->head_->item_ = T(); + if (curr->next_ == this->head_) return -1; // Item was not found. else @@ -278,7 +283,7 @@ ACE_Unbounded_Set_Ex::end (void) const return const_iterator (*this, 1); } -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Set_Ex_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Unbounded_Set_Ex_Iterator) template void ACE_Unbounded_Set_Ex_Iterator::dump (void) const @@ -385,7 +390,7 @@ ACE_Unbounded_Set_Ex_Iterator::operator!= (const ACE_Unbounded_Set_Ex_Iter return (this->set_ != rhs.set_ || this->current_ != rhs.current_); } -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Set_Ex_Const_Iterator) +ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Unbounded_Set_Ex_Const_Iterator) template void ACE_Unbounded_Set_Ex_Const_Iterator::dump (void) const diff --git a/deps/acelite/ace/Unbounded_Set_Ex.h b/deps/acelite/ace/Unbounded_Set_Ex.h index bde3915ac..b1f3707a3 100644 --- a/deps/acelite/ace/Unbounded_Set_Ex.h +++ b/deps/acelite/ace/Unbounded_Set_Ex.h @@ -4,7 +4,7 @@ /** * @file Unbounded_Set_Ex.h * - * @author Douglas C. Schmidt + * @author Douglas C. Schmidt */ //============================================================================= @@ -52,7 +52,6 @@ public: typedef typename container_type::pointer pointer; typedef typename container_type::difference_type difference_type; - // = Initialization method. ACE_Unbounded_Set_Ex_Iterator (ACE_Unbounded_Set_Ex &s, bool end = false); // = Iteration methods. @@ -120,7 +119,6 @@ public: typedef typename container_type::const_pointer pointer; typedef typename container_type::difference_type difference_type; - // = Initialization method. ACE_Unbounded_Set_Ex_Const_Iterator (const ACE_Unbounded_Set_Ex &s, bool end = false); @@ -232,7 +230,6 @@ public: typedef const_value_type * const_pointer; typedef ptrdiff_t difference_type; - // = Initialization and termination methods. /// Constructor. Use user specified allocation strategy /// if specified. /** diff --git a/deps/acelite/ace/Vector_T.cpp b/deps/acelite/ace/Vector_T.cpp index 4e7aea27a..3cbec049a 100644 --- a/deps/acelite/ace/Vector_T.cpp +++ b/deps/acelite/ace/Vector_T.cpp @@ -13,7 +13,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_ALLOC_HOOK_DEFINE(ACE_Vector) +ACE_ALLOC_HOOK_DEFINE_Tcs(ACE_Vector) template void ACE_Vector::resize (const size_t new_size, @@ -66,6 +66,7 @@ ACE_Vector::operator== (const ACE_Vector &s) c } // **************************************************************** +ACE_ALLOC_HOOK_DEFINE_Tcs(ACE_Vector_Iterator) template int ACE_Vector_Iterator::next (T *&item) diff --git a/deps/acelite/ace/Vector_T.h b/deps/acelite/ace/Vector_T.h index 759178348..d88cb53d3 100644 --- a/deps/acelite/ace/Vector_T.h +++ b/deps/acelite/ace/Vector_T.h @@ -90,6 +90,9 @@ public: */ ~ACE_Vector (); + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + /** * Returns the current vector capacity, that is, the currently * allocated buffer size. @@ -185,6 +188,16 @@ public: void swap (ACE_Vector &rhs); + /* + * Implement our own end functions because Array_Base's end functions use the + * current capacity, not the Vector's actual element count! + */ + /// C++ Standard End Iterator + ///{ + typename ACE_Array_Base::iterator end (); + typename ACE_Array_Base::const_iterator end () const; + ///} + protected: /** @@ -213,7 +226,6 @@ template class ACE_Vector_Iterator { public: - // = Initialization method. ACE_Vector_Iterator (ACE_Vector &); // = Iteration methods. diff --git a/deps/acelite/ace/Vector_T.inl b/deps/acelite/ace/Vector_T.inl index 813824385..103bb93be 100644 --- a/deps/acelite/ace/Vector_T.inl +++ b/deps/acelite/ace/Vector_T.inl @@ -45,6 +45,18 @@ void ACE_Vector::pop_back (void) } } +template ACE_INLINE +typename ACE_Array_Base::iterator ACE_Vector::end () +{ + return ACE_Array_Base::array_ + length_; +} + +template ACE_INLINE +typename ACE_Array_Base::const_iterator ACE_Vector::end () const +{ + return ACE_Array_Base::array_ + length_; +} + // Compare this vector with for inequality. template ACE_INLINE bool diff --git a/deps/acelite/ace/Version.h b/deps/acelite/ace/Version.h index b09b4b1fe..738fd1751 100644 --- a/deps/acelite/ace/Version.h +++ b/deps/acelite/ace/Version.h @@ -1,8 +1,11 @@ // -*- C++ -*- -// This is file was automatically generated by \$ACE_ROOT/bin/make_release.py +// This is file was automatically generated by $ACE_ROOT/bin/make_release.py #define ACE_MAJOR_VERSION 6 -#define ACE_MINOR_VERSION 3 -#define ACE_BETA_VERSION 2 -#define ACE_VERSION "6.3.2" +#define ACE_MINOR_VERSION 5 +#define ACE_MICRO_VERSION 10 +#define ACE_BETA_VERSION 10 +#define ACE_VERSION "6.5.10" +#define ACE_VERSION_CODE 394506 +#define ACE_MAKE_VERSION_CODE(a,b,c) (((a) << 16) + ((b) << 8) + (c)) diff --git a/deps/acelite/ace/Versioned_Namespace.h b/deps/acelite/ace/Versioned_Namespace.h index 9e3274ed9..cd1e68ba7 100644 --- a/deps/acelite/ace/Versioned_Namespace.h +++ b/deps/acelite/ace/Versioned_Namespace.h @@ -29,9 +29,9 @@ // concatenated. Force the preprocessor to expand them during the // argument prescan by calling a macro that itself calls another that // performs the actual concatenation. -# define ACE_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,BETA) ACE_ ## MAJOR ## _ ## MINOR ## _ ## BETA -# define ACE_MAKE_VERSIONED_NAMESPACE_NAME(MAJOR,MINOR,BETA) ACE_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,BETA) -# define ACE_VERSIONED_NAMESPACE_NAME ACE_MAKE_VERSIONED_NAMESPACE_NAME(ACE_MAJOR_VERSION,ACE_MINOR_VERSION,ACE_BETA_VERSION) +# define ACE_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,MICRO) ACE_ ## MAJOR ## _ ## MINOR ## _ ## MICRO +# define ACE_MAKE_VERSIONED_NAMESPACE_NAME(MAJOR,MINOR,MICRO) ACE_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,MICRO) +# define ACE_VERSIONED_NAMESPACE_NAME ACE_MAKE_VERSIONED_NAMESPACE_NAME(ACE_MAJOR_VERSION,ACE_MINOR_VERSION,ACE_MICRO_VERSION) # endif /* !ACE_VERSIONED_NAMESPACE_NAME */ # define ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_VERSIONED_NAMESPACE_NAME { diff --git a/deps/acelite/ace/WFMO_Reactor.cpp b/deps/acelite/ace/WFMO_Reactor.cpp index 32b64908f..5f901b141 100644 --- a/deps/acelite/ace/WFMO_Reactor.cpp +++ b/deps/acelite/ace/WFMO_Reactor.cpp @@ -1384,7 +1384,11 @@ ACE_WFMO_Reactor::register_handler_i (ACE_HANDLE event_handle, long new_network_events = 0; bool delete_event = false; +#if defined (ACE_HAS_CPP11) std::unique_ptr event; +#else + auto_ptr event; +#endif /* ACE_HAS_CPP11 */ // Look up the repository to see if the is already // there. @@ -1401,10 +1405,15 @@ ACE_WFMO_Reactor::register_handler_i (ACE_HANDLE event_handle, // need to create one if (event_handle == ACE_INVALID_HANDLE) { - // Note: don't change this since some C++ compilers have - // s that don't work properly... +#if defined (ACE_HAS_CPP11) std::unique_ptr tmp (new ACE_Auto_Event); event = std::move(tmp); +#else + // Note: don't change this since some C++ compilers have + // s that don't work properly... + auto_ptr tmp (new ACE_Auto_Event); + event = tmp; +#endif /* ACE_HAS_CPP11 */ event_handle = event->handle (); delete_event = true; } diff --git a/deps/acelite/ace/WFMO_Reactor.h b/deps/acelite/ace/WFMO_Reactor.h index 32197eb99..4d4dccd15 100644 --- a/deps/acelite/ace/WFMO_Reactor.h +++ b/deps/acelite/ace/WFMO_Reactor.h @@ -6,7 +6,7 @@ * * @author Irfan Pyarali * @author Tim Harrison - * @author Doug Schmidt + * @author Doug Schmidt */ //============================================================================= @@ -71,11 +71,10 @@ int WSAEnumNetworkEvents (SOCKET s, #endif /* !defined ACE_HAS_WINSOCK2 */ -class ACE_WFMO_Reactor_Test; // Must be out of versioned namespace. - ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Forward decl. +class ACE_WFMO_Reactor_Test; class ACE_WFMO_Reactor; class ACE_Handle_Set; @@ -113,7 +112,7 @@ public: * Event_Handler entry. The reason the event is not in this * structure is because we need to pass an event array into * WaitForMultipleObjects and therefore keeping the events - * seperate makes sense. + * separate makes sense. */ class Common_Info { @@ -122,7 +121,7 @@ public: /// event bool io_entry_; - /// The assosiated Event_Handler + /// The associated Event_Handler ACE_Event_Handler *event_handler_; /// The I/O handle related to the Event_Handler. This entry is @@ -308,10 +307,6 @@ public: // = Search structure operations. - /// Bind the ACE_Event_Handler * to the ACE_HANDLE. This is for - /// the simple event entry. - int bind (ACE_HANDLE, ACE_Event_Handler *); - /// Insert I/O Event_Handler entry into the system. This method /// assumes that the lock are head *before* this method is invoked. int bind_i (bool io_entry, @@ -435,14 +430,14 @@ public: void dump (void) const; protected: - /// Reference to our . + /// Reference to our WFMO_Reactor. ACE_WFMO_Reactor &wfmo_reactor_; /// Maximum number of handles. size_t max_size_; /** - * Array of passed to . This + * Array of ACE_HANDLEs passed to . This * is not part of the structure as the handle array needs to be * passed directly to . */ @@ -498,7 +493,7 @@ public: /// Constructor ACE_WFMO_Reactor_Notify (size_t max_notifies = 1024); - /// Initialization. @a timer_queue is stored to call . + /// Initialization. @a timer_queue is stored to call gettimeofday(). virtual int open (ACE_Reactor_Impl *wfmo_reactor, ACE_Timer_Queue *timer_queue, int disable_notify = 0); @@ -546,10 +541,10 @@ public: /** * Set the maximum number of times that the - * method will iterate and + * ACE_WFMO_Reactor_Notify::handle_input() method will iterate and * dispatch the ACE_Event_Handlers that are passed in via the * notify queue before breaking out of its - * loop. By default, this is set to + * ACE_Message_Queue::dequeue() loop. By default, this is set to * -1, which means "iterate until the queue is empty." Setting this * to a value like "1 or 2" will increase "fairness" (and thus * prevent starvation) at the expense of slightly higher dispatching @@ -562,7 +557,7 @@ public: * ACE_WFMO_Reactor_Notify::handle_input() method will iterate and * dispatch the ACE_Event_Handlers that are passed in via the * notify queue before breaking out of its - * loop. + * ACE_Message_Queue::dequeue() loop. */ int max_notify_iterations (void); @@ -663,8 +658,6 @@ public: DEFAULT_SIZE = MAXIMUM_WAIT_OBJECTS - 2 }; - // = Initialization and termination methods. - /// Initialize ACE_WFMO_Reactor with the default size. ACE_WFMO_Reactor (ACE_Sig_Handler * = 0, ACE_Timer_Queue * = 0, @@ -778,8 +771,8 @@ public: /** * Control whether the Reactor will handle any more incoming events or not. - * If == 1, the Reactor will be disabled. By default, a reactor - * is in active state and can be deactivated/reactived as wish. + * If @a do_stop == 1, the Reactor will be disabled. By default, a reactor + * is in active state and can be deactivated/reactivated as wish. */ virtual void deactivate (int do_stop); @@ -798,13 +791,13 @@ public: ACE_HANDLE event_handle = ACE_INVALID_HANDLE); /** - * Register an ACE_Event_Handler . @a mask specifies - * the network events that the is interested in. If - * == the will + * Register an ACE_Event_Handler @a event_handle. @a mask specifies + * the network events that the @a event_handler is interested in. If + * @a io_handle == ACE_INVALID_HANDLE the ACE_WFMO_Reactor will * call the method of to extract the - * underlying I/O handle. If the == - * , WFMO_Reactor will create an event for - * associating it with the I/O handle. When the is + * underlying I/O handle. If the @a event_handle == + * ACE_INVALID_HANDLE, WFMO_Reactor will create an event for + * associating it with the I/O handle. When the @a event_handle is * signalled, the appropriate callback will be invoked on * the Event_Handler */ @@ -855,8 +848,8 @@ public: ACE_Sig_Action *new_disp = 0); /** - * Removes @a event_handler from the . Note that - * the will call the method of + * Removes @a event_handler from the ACE_WFMO_Reactor. Note that + * the ACE_WFMO_Reactor will call the method of * @a event_handler to extract the underlying handle. If @a mask == * ACE_Event_Handler::DONT_CALL then the method of * the @a event_handler is not invoked. Note that the @a handle can @@ -1025,8 +1018,8 @@ public: ACE_Reactor_Mask masks_to_be_deleted); /** - * Remove @a masks_to_be_deleted to the 's entry in - * WFMO_Reactor. The Event_Handler associated with must + * Remove @a masks_to_be_deleted to the @a handle's entry in + * WFMO_Reactor. The Event_Handler associated with @a handle must * already have been registered with WFMO_Reactor. */ virtual int cancel_wakeup (ACE_HANDLE handle, @@ -1079,13 +1072,13 @@ public: // = Assorted helper methods. /** - * Return the Event_Handler associated with . Return 0 if - * is not registered. + * Return the Event_Handler associated with @a handle. Return 0 if + * @a handle is not registered. */ ACE_Event_Handler *find_handler (ACE_HANDLE handle); /** - * Check to see if is associated with a valid Event_Handler + * Check to see if @a handle is associated with a valid Event_Handler * bound to @a mask. Return the @a event_handler associated with this * @a handler if @a event_handler != 0. */ diff --git a/deps/acelite/ace/WIN32_Proactor.h b/deps/acelite/ace/WIN32_Proactor.h index 1625fa8ce..e370ee08d 100644 --- a/deps/acelite/ace/WIN32_Proactor.h +++ b/deps/acelite/ace/WIN32_Proactor.h @@ -44,7 +44,7 @@ class ACE_WIN32_Proactor_Timer_Handler; * @brief A manager for asynchronous event demultiplexing on Win32. * * See the Proactor pattern description at - * http://www.cs.wustl.edu/~schmidt/PDF/proactor.pdf for more + * http://www.dre.vanderbilt.edu/~schmidt/PDF/proactor.pdf for more * details. */ class ACE_Export ACE_WIN32_Proactor : public ACE_Proactor_Impl diff --git a/deps/acelite/ace/XML_Utils/ACE_XML_Utils.pc.in b/deps/acelite/ace/XML_Utils/ACE_XML_Utils.pc.in deleted file mode 100644 index 9b267ae54..000000000 --- a/deps/acelite/ace/XML_Utils/ACE_XML_Utils.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_XML_Utils -Description: ACE XML Utilities Library -Requires: ACE -Version: @VERSION@ -Libs: -L${libdir} -lACE_XML_Utils -Cflags: -I${includedir} diff --git a/deps/acelite/ace/XML_Utils/XML.mpc b/deps/acelite/ace/XML_Utils/XML.mpc deleted file mode 100644 index 6e7918654..000000000 --- a/deps/acelite/ace/XML_Utils/XML.mpc +++ /dev/null @@ -1,42 +0,0 @@ -project (ACE_XML_Utils) : install, acelib, xerces, ace_output { - sharedname += ACE_XML_Utils - dynamicflags += XML_UTILS_BUILD_DLL - - specific { - install_dir = ace/XML_Utils - } - - Template_Files { - XML_Helper.tpp - XML_Schema_Resolver.tpp - XMLSchema - XSCRT - } - - Inline_Files { - XMLSchema - XSCRT - } - - Header_Files { - XML_Utils_Export.h - XML_Error_Handler.h - XercesString.h - XML_Schema_Resolver.h - XML_Typedefs.h - XML_Helper.h - XMLSchema - XSCRT - } - - Source_Files { - XML_Error_Handler.cpp - XercesString.cpp - XML_Schema_Resolver.cpp - XML_Typedefs.cpp - } - - Pkgconfig_Files { - ACE_XML_Utils.pc.in - } -} diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/Traversal.hpp b/deps/acelite/ace/XML_Utils/XMLSchema/Traversal.hpp deleted file mode 100644 index 970e0a6d3..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/Traversal.hpp +++ /dev/null @@ -1,74 +0,0 @@ -// file : XMLSchema/Traversal.hpp -// author : Boris Kolpackov -#ifndef XMLSCHEMA_TRAVERSAL_HPP -#define XMLSCHEMA_TRAVERSAL_HPP - -#include -#include - -namespace XMLSchema -{ - namespace Traversal - { - // Automatic traversal of IDREFs. - // - // - struct IDREF : - XSCRT::Traversal::Traverser - { - virtual void - traverse (XMLSchema::IDREF_Base& r) - { - if (r.get ()) dispatch (*(r.get ())); - } - - virtual void - traverse (XMLSchema::IDREF_Base const& r) - { - if (r.get ()) dispatch (*(r.get ())); - } - }; - - - template - struct Traverser : XSCRT::Traversal::Traverser - { - }; - - typedef Traverser byte; - typedef Traverser unsignedByte; - - typedef Traverser short_; - typedef Traverser unsignedShort; - - typedef Traverser int_; - typedef Traverser unsignedInt; - - typedef Traverser long_; - typedef Traverser unsignedLong; - - typedef Traverser boolean; - - typedef Traverser float_; - typedef Traverser double_; - - template - struct string : Traverser > - { - }; - - template - struct ID : Traverser > - { - }; - - template - struct anyURI : Traverser > - { - }; - } -} - -#include - -#endif // XMLSCHEMA_TRAVERSAL_HPP diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/Traversal.ipp b/deps/acelite/ace/XML_Utils/XMLSchema/Traversal.ipp deleted file mode 100644 index c96910a60..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/Traversal.ipp +++ /dev/null @@ -1,9 +0,0 @@ -// file : XMLSchema/Traversal.ipp -// author : Boris Kolpackov - -namespace XMLSchema -{ - namespace Traversal - { - } -} diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/TypeInfo.hpp b/deps/acelite/ace/XML_Utils/XMLSchema/TypeInfo.hpp deleted file mode 100644 index 2016982b7..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/TypeInfo.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// file : XMLSchema/TypeInfo.hpp -// author : Boris Kolpackov -#ifndef XMLSCHEMA_TYPE_INFO_HPP -#define XMLSCHEMA_TYPE_INFO_HPP - -#include - -namespace XMLSchema -{ - template - struct TypeInfoInitializer - { - TypeInfoInitializer (XSCRT::ExtendedTypeInfoMap&); - }; -} - -#include -#include - -#endif // XMLSCHEMA_TYPE_INFO_HPP diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/TypeInfo.ipp b/deps/acelite/ace/XML_Utils/XMLSchema/TypeInfo.ipp deleted file mode 100644 index 20cce1f97..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/TypeInfo.ipp +++ /dev/null @@ -1,6 +0,0 @@ -// file : XMLSchema/TypeInfo.ipp -// author : Boris Kolpackov - -namespace XMLSchema -{ -} diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/TypeInfo.tpp b/deps/acelite/ace/XML_Utils/XMLSchema/TypeInfo.tpp deleted file mode 100644 index b431c99f6..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/TypeInfo.tpp +++ /dev/null @@ -1,97 +0,0 @@ -// file : XMLSchema/TypeInfo.tpp -// author : Boris Kolpackov - -namespace XMLSchema -{ - //@@ VC6 - // - template - void - add_info (XSCRT::ExtendedTypeInfoMap& map, T*) - { - using XSCRT::TypeId; - using XSCRT::ExtendedTypeInfo; - - TypeId id (typeid (T)); - ExtendedTypeInfo info (id); - - info.add_base (ExtendedTypeInfo::Access::public_, - false, - typeid (XSCRT::Type)); - - map.insert (std::make_pair (id, info)); - } - - - template - inline - TypeInfoInitializer:: - TypeInfoInitializer (XSCRT::ExtendedTypeInfoMap& map) - { - using XSCRT::TypeId; - using XSCRT::ExtendedTypeInfo; - - // XSCRT::Type - // - { - TypeId id (typeid (XSCRT::Type)); - map.insert (std::make_pair (id, ExtendedTypeInfo (id))); - } - - //@@ VC6 - - add_info (map, 0); - add_info (map, 0); - - add_info (map, 0); - add_info (map, 0); - - add_info (map, 0); - add_info (map, 0); - - add_info (map, 0); - add_info (map, 0); - - add_info (map, 0); - - add_info (map, 0);; - add_info (map, 0); - - add_info > (map, 0); - - add_info > (map, 0); - add_info > (map, 0); - add_info > (map, 0); - add_info > (map, 0); - add_info > (map, 0); - add_info > (map, 0); - - add_info > (map, 0); - - // IDREF_Base - // - { - TypeId id (typeid (IDREF_Base)); - ExtendedTypeInfo info (id); - - info.add_base (ExtendedTypeInfo::Access::public_, - false, - typeid (XSCRT::Type)); - - map.insert (std::make_pair (id, info)); - } - - // IDREF - // - { - TypeId id (typeid (IDREF)); - ExtendedTypeInfo info (id); - - info.add_base (ExtendedTypeInfo::Access::public_, - false, - typeid (IDREF_Base)); - - map.insert (std::make_pair (id, info)); - } - } -} diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/Types.hpp b/deps/acelite/ace/XML_Utils/XMLSchema/Types.hpp deleted file mode 100644 index 9027786a8..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/Types.hpp +++ /dev/null @@ -1,667 +0,0 @@ -// file : XMLSchema/Types.hpp -// author : Boris Kolpackov -#ifndef XMLSCHEMA_TYPES_HPP -#define XMLSCHEMA_TYPES_HPP - -#include -#include "ace/XML_Utils/XSCRT/Elements.hpp" - -#include "ace/Basic_Types.h" -/** - * @@ HACK: VC7 - * - * Disabled the warning about using this in the base member initialization section. - * Our use in this file is fine. - */ -#ifdef _MSC_VER -# pragma warning ( disable: 4355 ) -#endif -namespace XMLSchema -{ - typedef XSCRT::FundamentalType byte; - typedef XSCRT::FundamentalType unsignedByte; - - typedef XSCRT::FundamentalType short_; - typedef XSCRT::FundamentalType unsignedShort; - - typedef XSCRT::FundamentalType int_; - typedef XSCRT::FundamentalType unsignedInt; - - typedef XSCRT::FundamentalType long_; - typedef XSCRT::FundamentalType unsignedLong; - - //@@ It would be nice to use some arbitrary-length integer class. - // - typedef long_ decimal; - typedef decimal integer; - typedef integer nonPositiveInteger; - typedef integer nonNegativeInteger; - typedef nonNegativeInteger positiveInteger; - typedef nonPositiveInteger negativeInteger; - - - typedef XSCRT::FundamentalType boolean; - - typedef XSCRT::FundamentalType float_; - typedef XSCRT::FundamentalType double_; - - // Just to make GCC 3.3 and other broken compilers shutup. - // - using std::basic_string; - - - template - class string : public XSCRT::Type, public basic_string - { - protected: - typedef basic_string Base__ ; - - public: - // typedef ACE_Refcounted_Auto_Ptr < string, ACE_Null_Mutex > _ptr; - - //@@ VC6 does not inject XSCRT::Type into the scope so I have - // to qualify it all the time. - // - - string () - { - } - - string (XSCRT::XML::Element const& e) - : Base__ (e.value ()) - { - } - - string (XSCRT::XML::Attribute const& a) - : Base__ (a.value ()) - { - } - - string (Base__ const& x) - : Base__ (x) - { - } - - string (C const* x) - : Base__ (x) - { - } - - string& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - - template - class normalizedString : public string - { - protected: - typedef typename string::Base__ Base__; - - public: - normalizedString () - { - } - - normalizedString (XSCRT::XML::Element const& e) - : string (e) - { - } - - normalizedString (XSCRT::XML::Attribute const& a) - : string (a) - { - } - - normalizedString (Base__ const& x) - : string (x) - { - } - - normalizedString (C const* x) - : string (x) - { - } - - normalizedString& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - - template - class token : public normalizedString - { - protected: - typedef typename normalizedString::Base__ Base__; - - public: - token () - { - } - - token (XSCRT::XML::Element const& e) - : normalizedString (e) - { - } - - token (XSCRT::XML::Attribute const& a) - : normalizedString (a) - { - } - - token (Base__ const& x) - : normalizedString (x) - { - } - - token (C const* x) - : normalizedString (x) - { - } - - token& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - - template - class NMTOKEN : public token - { - protected: - typedef typename token::Base__ Base__; - - public: - NMTOKEN () - { - } - - NMTOKEN (XSCRT::XML::Element const& e) - : token (e) - { - } - - NMTOKEN (XSCRT::XML::Attribute const& a) - : token (a) - { - } - - NMTOKEN (Base__ const& x) - : token (x) - { - } - - NMTOKEN (C const* x) - : token (x) - { - } - - NMTOKEN& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - template - class Name: public token - { - protected: - typedef typename token::Base__ Base__; - - public: - Name() - { - } - - Name(XSCRT::XML::Element const& e) - : token (e) - { - } - - Name(XSCRT::XML::Attribute const& a) - : token (a) - { - } - - Name(Base__ const& x) - : token (x) - { - } - - Name (C const* x) - : token (x) - { - } - - Name& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - - template - class NCName: public Name - { - protected: - typedef typename Name::Base__ Base__; - - public: - NCName() - { - } - - NCName(XSCRT::XML::Element const& e) - : Name (e) - { - } - - NCName(XSCRT::XML::Attribute const& a) - : Name (a) - { - } - - NCName(Base__ const& x) - : Name (x) - { - } - - NCName (C const* x) - : Name (x) - { - } - - NCName& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - template - class QName: public Name - { - protected: - typedef typename Name::Base__ Base__; - - public: - QName() - { - } - - QName(XSCRT::XML::Element const& e) - : Name (e) - { - } - - QName(XSCRT::XML::Attribute const& a) - : Name (a) - { - } - - QName(Base__ const& x) - : Name (x) - { - } - - QName (C const* x) - : Name (x) - { - } - - QName& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - template - struct IdentityProvider : XSCRT::IdentityProvider - { - IdentityProvider (NCName const& id) - : id_ (id) - { - } - - virtual ~IdentityProvider (void) - { - } - - virtual bool - before (XSCRT::IdentityProvider const& y) const - { - return id_ < dynamic_cast (y).id_; - } - - private: - NCName const& id_; - - private: - IdentityProvider (IdentityProvider const&); - - IdentityProvider& - operator= (IdentityProvider const&); - }; - - - template - class ID : public NCName - { - protected: - typedef typename NCName::Base__ Base__; - - public: - ~ID() - { - unregister_id (); - } - - ID () - : id_provider_ (*this) - { - } - - ID (XSCRT::XML::Element const& e) - : NCName (e), id_provider_ (*this) - { - } - - ID (XSCRT::XML::Attribute const& a) - : NCName (a), id_provider_ (*this) - { - } - - ID (ID const& x) - : NCName (x), id_provider_ (*this) - { - } - - ID (Base__ const& x) - : NCName (x), id_provider_ (*this) - { - } - - ID (C const* x) - : NCName (x), id_provider_ (*this) - { - } - - ID& - operator= (Base__ const& x) - { - unregister_id (); - - static_cast&>(*this) = x; - - register_id (); - - return *this; - } - - ID& - operator= (ID const& x) - { - unregister_id (); - - static_cast&>(*this) = static_cast const&>(x); - - register_id (); - - return *this; - } - - public: - using NCName::container; - - virtual void - container (XSCRT::Type* c) - { - unregister_id (); - - NCName::container (c); - - register_id (); - } - - private: - using NCName::empty; - using NCName::root; - - void - register_id () - { - if (NCName::container () != this && !empty ()) - { - //std::wcerr << "registering " << container () - // << " as '" << *this - // << "' on " << container () << std::endl; - NCName::container ()->register_id (id_provider_, - NCName::container ()); - } - } - - void - unregister_id () - { - if (NCName::container () != this && !empty ()) - { - //std::wcerr << "un-registering " << container () - // << " as '" << *this - // << "' on " << container () << std::endl; - NCName::container ()->unregister_id (id_provider_); - } - } - - private: - IdentityProvider id_provider_; - }; - - struct IDREF_Base : public XSCRT::Type - { - virtual XSCRT::Type const* - get () const = 0; - - virtual XSCRT::Type* - get () = 0; - }; - - template - class IDREF : public IDREF_Base - { - public: - typedef C CDR_Type__; - IDREF () - : id_provider_ (id_) - { - } - - IDREF (XSCRT::XML::Element const& e) - : id_ (e), id_provider_ (id_) - { - } - - IDREF (XSCRT::XML::Attribute const& a) - : id_ (a), id_provider_ (id_) - { - } - - IDREF (IDREF const& x) - : XMLSchema::IDREF_Base (), - id_ (x.id_), id_provider_ (id_) - { - } - - IDREF (basic_string const& id) - : id_ (id), id_provider_ (id_) - { - } - - IDREF (C const* id) - : id_ (id), id_provider_ (id_) - { - } - - IDREF& - operator= (IDREF const& x) - { - id_ = x.id_; - return *this; - } - - IDREF& - operator= (basic_string const& x) - { - id_ = x; - return *this; - } - - public: - NCName - id () const - { - return id_; - } - - public: - XSCRT::Type const* - operator-> () const - { - return get (); - } - - XSCRT::Type* - operator-> () - { - return get (); - } - - XSCRT::Type const& - operator* () const - { - return *(get ()); - } - - XSCRT::Type& - operator* () - { - return *(get ()); - } - - virtual XSCRT::Type const* - get () const - { - if (!id_.empty () && container () != this) - { - return root ()->lookup_id (id_provider_); - } - else - { - return 0; - } - } - - virtual XSCRT::Type* - get () - { - if (!id_.empty () && container () != this) - { - return root ()->lookup_id (id_provider_); - } - else - { - return 0; - } - } - - // conversion to bool - // - typedef void (IDREF::*bool_convertable)(); - - operator bool_convertable () const - { - return get () ? &IDREF::true_ : 0; - } - - private: - void true_ () - { - } - - private: - NCName id_; - IdentityProvider id_provider_; - }; - - template - class anyURI : public XSCRT::Type, public basic_string - { - protected: - typedef basic_string Base__ ; - - public: - // Trait for marshaling string - typedef C CDR_Type__; - - //@@ VC6 does not inject XSCRT::Type into the scope so I have - // to qualify it all the time. - // - - anyURI (void) - { - } - - anyURI (XSCRT::XML::Element const& e) - : Base__ (e.value ()) - { - } - - anyURI (XSCRT::XML::Attribute const& a) - : Base__ (a.value ()) - { - } - - anyURI (Base__ const& x) - : Base__ (x) - { - } - - anyURI (C const * x) - : Base__ (x) - { - } - - anyURI (const anyURI& s) - : Base__ (s) - { - - } - - anyURI & operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; -} - -#include "ace/XML_Utils/XMLSchema/Types.ipp" - -#endif // XMLSCHEMA_TYPES_HPP diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/Types.ipp b/deps/acelite/ace/XML_Utils/XMLSchema/Types.ipp deleted file mode 100644 index b39e46a39..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/Types.ipp +++ /dev/null @@ -1,7 +0,0 @@ -// file : XMLSchema/Types.ipp -// author : Boris Kolpackov - -namespace XMLSchema -{ - -} diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/Writer.hpp b/deps/acelite/ace/XML_Utils/XMLSchema/Writer.hpp deleted file mode 100644 index 781432b8f..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/Writer.hpp +++ /dev/null @@ -1,156 +0,0 @@ -// file : XMLSchema/Writer.hpp -// author : Boris Kolpackov -#ifndef XMLSCHEMA_WRITER_HPP -#define XMLSCHEMA_WRITER_HPP - -#include - -#include - -#include -#include - -#include - -namespace XMLSchema -{ - namespace Writer - { - template - struct FundamentalType : Traversal::Traverser, - virtual XSCRT::Writer - { - FundamentalType (XSCRT::XML::Element& e) - : XSCRT::Writer (e) - { - } - - using XSCRT::Writer::top_; - using XSCRT::Writer::attr_; - - virtual void - traverse (T const& o) - { - using namespace XSCRT::XML; - - std::basic_ostringstream os; - - os << o; - - if (Attribute* a = attr_ ()) - { - a->value (os.str ()); - } - else - { - top_().value (os.str ()); - } - } - - protected: - virtual void - traverse (T &t) - { - Traversal::Traverser::traverse (t); - } - - FundamentalType () - { - } - }; - - template - struct FundamentalType , C> : - Traversal::Traverser >, - virtual XSCRT::Writer - { - FundamentalType (XSCRT::XML::Element &e) - : XSCRT::Writer (e) - { - } - - using XSCRT::Writer::top_; - using XSCRT::Writer::attr_; - - virtual void - traverse (XSCRT::FundamentalType const &o) - { - using namespace XSCRT::XML; - - std::basic_ostringstream os; - - if (o) - { - os << "true"; - } - else - { - os << "false"; - } - - if (Attribute* a = attr_ ()) - { - a->value (os.str ()); - } - else - { - top_().value (os.str ()); - } - } - - protected: - virtual void - traverse (XSCRT::FundamentalType &t) - { - Traversal::Traverser >::traverse (t); - } - - FundamentalType () - { - } - }; - - - template - struct IDREF : Traversal::Traverser >, - virtual XSCRT::Writer - { - IDREF (XSCRT::XML::Element& e) - : XSCRT::Writer (e) - { - } - - virtual void - traverse ( - typename Traversal::Traverser >::Type const& o) - { - using namespace XSCRT::XML; - - if (Attribute* a = XSCRT::Writer::attr_ ()) - { - a->value (o.id ()); - } - else - { - XSCRT::Writer::top_().value (o.id ()); - } - } - - protected: - - virtual void - traverse (typename Traversal::Traverser >::Type &o) - { - Traversal::Traverser >::traverse (o); - } - - IDREF () - { - } - }; - } -} - -#include - -#endif // XMLSCHEMA_WRITER_HPP diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/Writer.ipp b/deps/acelite/ace/XML_Utils/XMLSchema/Writer.ipp deleted file mode 100644 index 98078da92..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/Writer.ipp +++ /dev/null @@ -1,9 +0,0 @@ -// file : XMLSchema/Writer.ipp -// author : Boris Kolpackov - -namespace XMLSchema -{ - namespace Writer - { - } -} diff --git a/deps/acelite/ace/XML_Utils/XMLSchema/id_map.hpp b/deps/acelite/ace/XML_Utils/XMLSchema/id_map.hpp deleted file mode 100644 index 2803a5a85..000000000 --- a/deps/acelite/ace/XML_Utils/XMLSchema/id_map.hpp +++ /dev/null @@ -1,142 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file id_map.hpp - * - * This file contains the ID_Map class which has the responsibility of linking - * XML IDREF objects to their XML ID counterparts. In the output files, this - * means that a _ptr() will return a pointer to the identified - * object. - * - * Exception NULL_PTR_Entry is thrown when a program attempts to add a NULL_PTR - * to either the id_map or idref_map. - * - * Exception Unresolved_IDREF is thrown if an element in an XML document attempts - * to reference an ID that does not exist. - * - * @author Jason R. Cody - */ -//============================================================================= - -#ifndef _ID_MAP_H -#define _ID_MAP_H - -//ID_Map makes use of the Types::idref_ data member to set it to the appropriate -//object created during parsing -#include "ace/XML_Utils/XMLSchema/Types.hpp" - -//The ID_Map is a Thread Specific Storage element. -#include "ace/TSS_T.h" -#include "ace/ace_wchar.h" - - /** - * @class ID_Map - * - * @brief A class that handles the mapping of IDREF objects to objects with the - * respective ID. - */ - class ID_Map - { - public: - - //Trait to allow for ease of thread specific storage. - typedef ACE_TSS TSS_ID_Map; - typedef std::map, XSCRT::Type*>::iterator id_iterator; - typedef std::multimap, XSCRT::Type*>::iterator idref_iterator; - typedef std::map, XSCRT::Type*> ID_MAP; - typedef std::multimap, XSCRT::Type*> IDREF_MAP; - - - //Exception Classes - //NULL_PTR_Entry thrown when a NULL PTR is added to the - //ID_Map - class NULL_PTR_Entry {}; - - //Unresolved_IDREF thrown when there are IDREF's in the - //XML document. - class Unresolved_IDREF {}; - - //Only a default constructor and destructor are needed - //Constructor - ID_Map () - { - } - - //Destructor - ~ID_Map () - { - } - - //Add an ID to the ID map - void add_id (std::basic_string id, XSCRT::Type *obj_ref) - { - if (obj_ref) - { - this->id_map_.insert (ID_MAP::value_type(id, obj_ref)); - } - else - { - throw NULL_PTR_Entry(); - } - return; - } - - //Add an IDREF to the IDREF map - void add_idref (std::basic_string idref, XSCRT::Type *obj_ref) - { - if (obj_ref) - { - this->idref_map_.insert (IDREF_MAP::value_type(idref, obj_ref)); - } - else - { - throw NULL_PTR_Entry(); - } - return; - } - - //Sets the referencing elements XSCRT::Type::idref_ to point to the - //referenced element. - //Note: The pointer is of type "XSCRT::Type*" - void resolve_idref ( void ) - { - //Declare iterators to navigate the maps - ID_Map::id_iterator id_iterator; - ID_Map::idref_iterator idref_iterator; - - for (idref_iterator = this->idref_map_.begin(); - idref_iterator != this->idref_map_.end(); - ++idref_iterator) - { - //Find the ID that matches the IDREF element - id_iterator = this->id_map_.find(idref_iterator->first); - if (id_iterator != this->id_map_.end()) - { - //Add the IDREF identifier and the reference to the - //identified object - std::basic_string temp_id = id_iterator->first; - idref_iterator->second->set_idref(temp_id, id_iterator->second); - } - else - { - //throw Unresolved_IDREF(); - } - } - } - - void reset (void) - { - id_map_.clear (); - idref_map_.clear (); - } - - private: - //id_map_: maps the ID string to the element with the - // ID attribute - //idref_map_: multimap that maps the IDREF string to the - // element with the IDREF attribute - ID_MAP id_map_; - IDREF_MAP idref_map_; - }; - -#endif /* _ID_MAP_HPP */ diff --git a/deps/acelite/ace/XML_Utils/XML_Error_Handler.cpp b/deps/acelite/ace/XML_Utils/XML_Error_Handler.cpp deleted file mode 100644 index 234baa144..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Error_Handler.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include "XML_Error_Handler.h" -#include "ace/Log_Category.h" -#include "ace/Auto_Ptr.h" -#include "ace/ACE.h" -#include -#include -#include -#include "XercesString.h" -#include - -using xercesc::SAXParseException; - -namespace XML -{ - XML_Error_Handler::XML_Error_Handler (void) - : errors_ (false) - { - } - - XML_Error_Handler::~XML_Error_Handler() - { - } - - void XML_Error_Handler::warning(const SAXParseException& toCatch) - { - if (ACE::debug ()) - { - XStr file (toCatch.getSystemId ()); - XStr msg (toCatch.getMessage ()); - - std::cerr << "Warning: " << file << ':' << toCatch.getLineNumber () - << ':' << toCatch.getColumnNumber () << " - " - << msg << std::endl; - } - } - - void XML_Error_Handler::error(const SAXParseException& toCatch) - { - if (ACE::debug ()) - { - XStr file (toCatch.getSystemId ()); - XStr msg (toCatch.getMessage ()); - - std::cerr << "Error: " << file << ':' << toCatch.getLineNumber () - << ':' << toCatch.getColumnNumber () << " - " - << msg << std::endl; - } - this->errors_ = true; - } - - void XML_Error_Handler::fatalError(const SAXParseException& toCatch) - { - if (ACE::debug ()) - { - XStr file (toCatch.getSystemId ()); - XStr msg (toCatch.getMessage ()); - - std::cerr << "Fatal Error: " << file << ':' << toCatch.getLineNumber () - << ':' << toCatch.getColumnNumber () << " - " - << msg << std::endl; - } - this->errors_ = true; - } - - void XML_Error_Handler::resetErrors() - { - this->errors_ = false; - } - - bool - XML_Error_Handler::getErrors (void) const - { - return this->errors_; - } -} diff --git a/deps/acelite/ace/XML_Utils/XML_Error_Handler.h b/deps/acelite/ace/XML_Utils/XML_Error_Handler.h deleted file mode 100644 index 2f094bbb9..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Error_Handler.h +++ /dev/null @@ -1,58 +0,0 @@ -//============================================================== -/** - * @file XML_Error_Handler.h - * - * @brief Error handler for Xerces - * - * @author Bala Natarajan - */ -//================================================================ -#ifndef ACE_XML_ERROR_HANDLER_H -#define ACE_XML_ERROR_HANDLER_H - -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "XML_Utils_Export.h" - -#include - -using xercesc::SAXParseException; - -namespace XML -{ - /** - * @class XML_Error_Hander - * - * @brief Error handler for XERCES - * - */ - class XML_Utils_Export XML_Error_Handler - : public xercesc::ErrorHandler - { - public: - - XML_Error_Handler (void); - - ~XML_Error_Handler (void); - - void warning(const SAXParseException& toCatch); - void error(const SAXParseException& toCatch); - void fatalError(const SAXParseException& toCatch); - void resetErrors(); - bool getErrors (void) const; - private : - // Disallow copying - XML_Error_Handler (const XML_Error_Handler&); - XML_Error_Handler& operator= (const XML_Error_Handler&); - - bool errors_; - }; -} - -#include /**/ "ace/post.h" - -#endif /* ACE_XML_ERROR_HANDLER_H */ diff --git a/deps/acelite/ace/XML_Utils/XML_Helper.h b/deps/acelite/ace/XML_Utils/XML_Helper.h deleted file mode 100644 index 9deeda5e9..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Helper.h +++ /dev/null @@ -1,98 +0,0 @@ -//============================================================ -/** - * @file XML_Helper.h - * - * @brief Some helper functions for XML - * - * @author Bala Natarajan - * @author William R. Otte - */ -//============================================================ -#ifndef ACE_XML_HELPER_H -#define ACE_XML_HELPER_H -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "XML_Error_Handler.h" -#include "XML_Schema_Resolver.h" - -#include "xercesc/util/XercesDefs.hpp" -#include "xercesc/parsers/XercesDOMParser.hpp" - -#include - -namespace XERCES_CPP_NAMESPACE -{ - class DOMDocument; - class DOMWriter; - class DOMImplementation; - class DOMDocumentType; -} - -namespace XML -{ - /** - * @class XML_Helper - * - * @brief Helper class for some routine XML stuff. - */ - template , - typename Error_Handler = XML_Error_Handler> - class XML_Helper - { - public: - // XML_Helper (void); - XML_Helper (Resolver *resolver = 0, Error_Handler *eh = 0); - - ~XML_Helper (void); - - /// Create a DOM tree - XERCES_CPP_NAMESPACE::DOMDocument * - create_dom (const ACE_TCHAR *uri) const; - - XERCES_CPP_NAMESPACE::DOMDocument * - create_dom (const ACE_TCHAR *root, - const ACE_TCHAR *ns, - XERCES_CPP_NAMESPACE::DOMDocumentType * doctype = 0) const; - - XERCES_CPP_NAMESPACE::DOMDocumentType * - create_doctype (const ACE_TCHAR *qn, - const ACE_TCHAR *pid, - const ACE_TCHAR *sid) const; - - /// Writes out a DOMDocument to an XML file - bool write_DOM (XERCES_CPP_NAMESPACE::DOMDocument *doc, - const ACE_TCHAR *file) const; - - bool is_initialized (void) const; - - /// Terminate the parser - void terminate_parser (void); - - Resolver &get_resolver (void); - - Error_Handler &get_error_handler (void); - - protected: - /// Intialize the parser - void init_parser (void); - - private: - bool initialized_; - XERCES_CPP_NAMESPACE::DOMImplementation *impl_; - mutable std::unique_ptr parser_; - - Resolver *resolver_; - bool release_resolver_; - Error_Handler *e_handler_; - bool release_e_handler_; - }; -} - -#include "XML_Helper.tpp" - -#include /**/ "ace/post.h" -#endif/*ACE_XML_HELPER_H*/ diff --git a/deps/acelite/ace/XML_Utils/XML_Helper.tpp b/deps/acelite/ace/XML_Utils/XML_Helper.tpp deleted file mode 100644 index 4c0b9fbf7..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Helper.tpp +++ /dev/null @@ -1,345 +0,0 @@ -#include "XML_Helper.h" -#include "ace/Auto_Ptr.h" -#include "ace/Log_Msg.h" -#include "ace/Log_Category.h" -#include "xercesc/util/XMLUniDefs.hpp" -#include "xercesc/dom/DOM.hpp" -#include "XML_Error_Handler.h" -#include "XML_Schema_Resolver.h" -#include "xercesc/framework/LocalFileFormatTarget.hpp" -#include "xercesc/dom/DOM.hpp" -#include "XercesString.h" - -#if XERCES_VERSION_MAJOR == 3 -#include "xercesc/dom/DOMLSSerializer.hpp" -#endif - -namespace XML -{ - using xercesc::XMLException; - using xercesc::XMLString; - using xercesc::DOMImplementation; - using xercesc::DOMImplementationRegistry; -// using xercesc::DOMBuilder; - using xercesc::DOMImplementationLS; - using xercesc::XMLUni; - using xercesc::DOMDocument; - using xercesc::DOMException; - using xercesc::DOMDocumentType; - using xercesc::XercesDOMParser; -/* - template - XML_Helper::XML_Helper (void) - : initialized_ (false) - { - this->init_parser (); - } -*/ - // TODO this is stub implementation - template - XML_Helper::XML_Helper (Resolver *resolver, Error *eh) - : initialized_ (false), - resolver_ (resolver), - release_resolver_(false), - e_handler_ (eh), - release_e_handler_ (false) - { - this->init_parser (); - } - - template - XML_Helper::~XML_Helper (void) - { - this->terminate_parser (); - } - - template - bool - XML_Helper::is_initialized (void) const - { - return this->initialized_ == true; - } - - template - void - XML_Helper::init_parser (void) - { - if (this->initialized_) - return; - - // CIAO_DEBUG ((LM_TRACE, CLINFO - //"XML_Helper<>::is_initialized - Initializing the Xerces runtime \n")); - // Initialize the Xerces run-time - try - { - if (!resolver_) - { - resolver_ = new Resolver (); - release_resolver_ = true; - } - - if (!e_handler_) - { - e_handler_ = new Error (); - release_e_handler_ = true; - } - - xercesc::XMLPlatformUtils::Initialize(); - } - catch (const XMLException& e) - { - char* message = - XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr cleanup_message (message); - - throw; - } - catch (...) - { - ACELIB_DEBUG ((LM_DEBUG, "(%P|%t) Some other exception, returning\n")); - return; - } - - // Instantiate the DOM parser. - static const XMLCh gLS[] = { xercesc::chLatin_L, - xercesc::chLatin_S, - xercesc::chNull }; - - // Get an implementation of the Load-Store (LS) interface - // and cache it for later use - impl_ = - DOMImplementationRegistry::getDOMImplementation(gLS); - - this->initialized_ = true; - return; - } - - template - XERCES_CPP_NAMESPACE::DOMDocument * - XML_Helper::create_dom (const ACE_TCHAR *root, - const ACE_TCHAR *ns, - DOMDocumentType *doctype) const - { - if (root == 0 || ns == 0) - return 0; - - return this->impl_->createDocument (XStr (ns), - XStr (root), - doctype); - } - - template - XERCES_CPP_NAMESPACE::DOMDocumentType * - XML_Helper::create_doctype (const ACE_TCHAR *qn, - const ACE_TCHAR *pid, - const ACE_TCHAR *sid) const - { - return this->impl_->createDocumentType (XStr (qn), - XStr (pid), - XStr (sid)); - } - template - XERCES_CPP_NAMESPACE::DOMDocument * - XML_Helper::create_dom (const ACE_TCHAR *url) const - { - - if (url == 0) - return 0; - - try - { - if (this->parser_.get () == 0) - this->parser_.reset ((new xercesc::XercesDOMParser ())); - - // Perform Namespace processing. - this->parser_->setDoNamespaces (true); - - // Discard comment nodes in the document - this->parser_->setCreateCommentNodes (false); - - // Disable datatype normalization. The XML 1.0 attribute value - // normalization always occurs though. - // this->parser_->setFeature (XMLUni::fgDOMDatatypeNormalization, true); - - // Do not create EntityReference nodes in the DOM tree. No - // EntityReference nodes will be created, only the nodes - // corresponding to their fully expanded sustitution text will be - // created. - this->parser_->setCreateEntityReferenceNodes (false); - - // Perform Validation - this->parser_->setValidationScheme (xercesc::AbstractDOMParser::Val_Always); - - // Do not include ignorable whitespace in the DOM tree. - this->parser_->setIncludeIgnorableWhitespace (false); - - // Enable the parser's schema support. - this->parser_->setDoSchema (true); - - // Enable full schema constraint checking, including checking which - // may be time-consuming or memory intensive. Currently, particle - // unique attribution constraint checking and particle derivation - // restriction checking are controlled by this option. - this->parser_->setValidationSchemaFullChecking (true); - - // The parser will treat validation error as fatal and will exit. - this->parser_->setValidationConstraintFatal (true); - - this->parser_->setErrorHandler (e_handler_); - - this->parser_->setEntityResolver (resolver_); - - this->parser_->parse (ACE_TEXT_ALWAYS_CHAR (url)); - - if (e_handler_ && e_handler_->getErrors ()) - return 0; - - return this->parser_->getDocument (); - } - catch (const DOMException& e) - { - const unsigned int maxChars = 2047; - XMLCh errText[maxChars + 1]; - - if (DOMImplementation::loadDOMExceptionMsg (e.code, - errText, - maxChars)) - { - char* message = - XMLString::transcode (errText); - ACE_Auto_Basic_Array_Ptr cleanup_message (message); - } - return 0; - - } - catch (const XMLException& e) - { - char* message = XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr cleanup_message (message); - throw 0; - } - catch (...) - { - ACELIB_DEBUG ((LM_DEBUG, "(%P|%t) Caught an unknown exception\n")); - throw; - } - - return 0; - } - - template - void - XML_Helper::terminate_parser (void) - { - if (!this->initialized_) - return; - - try - { - if (release_resolver_ && resolver_) - { - delete resolver_; - resolver_ = 0; - } - - if (release_e_handler_ && e_handler_) - { - delete e_handler_; - e_handler_ = 0; - } - - this->parser_.reset (0); - this->impl_ = 0; - xercesc::XMLPlatformUtils::Terminate(); - } - catch (const XMLException& e) - { - char* message = - XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr cleanup_message (message); - throw; - } - - this->initialized_ = false; - return; - } - - template - Resolver & - XML_Helper::get_resolver (void) - { - if (!this->resolver_) - throw std::exception (); - - return *this->resolver_; - } - - template - Error & - XML_Helper::get_error_handler (void) - { - if (!this->e_handler_) - throw std::exception (); - - return *this->e_handler_; - } - - template - bool - XML_Helper::write_DOM (XERCES_CPP_NAMESPACE::DOMDocument *doc, - const ACE_TCHAR *file) const - { - try - { - bool retn; -#if XERCES_VERSION_MAJOR == 3 - XERCES_CPP_NAMESPACE::DOMLSSerializer *serializer (impl_->createLSSerializer ()); - XERCES_CPP_NAMESPACE::DOMConfiguration *ser_config (serializer->getDomConfig ()); - XERCES_CPP_NAMESPACE::DOMLSOutput *output (impl_->createLSOutput ()); - - if (ser_config->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true)) - ser_config->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); - - XMLFormatTarget *format_target = new XERCES_CPP_NAMESPACE::LocalFileFormatTarget (ACE_TEXT_ALWAYS_CHAR (file)); - - output->setByteStream (format_target); - - retn = serializer->write (doc, output); - - output->release (); - serializer->release (); - return retn; -#else - std::unique_ptr writer (impl_->createDOMWriter()); - - if (writer->canSetFeature (XMLUni::fgDOMWRTFormatPrettyPrint, - true)) - writer->setFeature (XMLUni::fgDOMWRTFormatPrettyPrint, true); - - std::unique_ptr ft (new xercesc::LocalFileFormatTarget(ACE_TEXT_ALWAYS_CHAR (file))); - retn = writer->writeNode(ft.get (), *doc); - - return retn; -#endif - } - catch (const xercesc::XMLException &e) - { - char* message = XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr cleanup_message (message); - - char* name = XMLString::transcode (e.getType()); - ACE_Auto_Basic_Array_Ptr cleanup_name (name); - - ACELIB_ERROR ((LM_ERROR, "Caught exception while serializing DOM to file.\n" - "Name: %C\n" - "Message: %C\n" - "SrcFile: %C\n" - "SrcLine: %C\n", - name, - message, - e.getSrcFile (), - e.getSrcLine ())); - return false; - } - } -} diff --git a/deps/acelite/ace/XML_Utils/XML_Schema_Resolver.cpp b/deps/acelite/ace/XML_Utils/XML_Schema_Resolver.cpp deleted file mode 100644 index b9fa61ad4..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Schema_Resolver.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include "XML_Schema_Resolver.h" - -#include -#include - -#include "XercesString.h" - -#include "ace/Env_Value_T.h" - -#include - -namespace XML -{ - Basic_Resolver::Basic_Resolver (const ACE_TCHAR *path) - : path_ (path) - { - } - - XMLCh * - Basic_Resolver::operator() (const XMLCh *const, - const XMLCh *const systemId) const - { - XStr path (path_); - path.append (systemId); - return path.release (); - } - - Environment_Resolver::Environment_Resolver (void) - { - } - - Environment_Resolver::Environment_Resolver (const ACE_TCHAR *variable, - const ACE_TCHAR *relpath) - { - this->add_path (variable, relpath); - } - - using xercesc::XMLPlatformUtils; - - void - Environment_Resolver::add_path (const ACE_TCHAR *variable, - const ACE_TCHAR *relpath) - { - ACE_Env_Value path_env (variable, - ACE_TEXT("")); - - XStr xpath (path_env); - XStr xrelpath (relpath); - - xpath.append (xrelpath); - - paths_.push_back (xpath); - } - - XMLCh * - Environment_Resolver::operator() (const XMLCh *const, - const XMLCh *const systemId) const - { - for (std::vector::const_iterator i = this->paths_.begin (); - i != this->paths_.end (); - ++i) - { - XStr path (*i); - path.append(systemId); - - FileHandle file (XMLPlatformUtils::openFile (path)); - - if (file != 0) - { - XMLPlatformUtils::closeFile (file); - return path.release (); - } - } - return 0; - } -} diff --git a/deps/acelite/ace/XML_Utils/XML_Schema_Resolver.h b/deps/acelite/ace/XML_Utils/XML_Schema_Resolver.h deleted file mode 100644 index 4fd578776..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Schema_Resolver.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @file XML_Schema_Resolver.h - * @author Will Otte - * - * Resolves schema locations. - */ - -#ifndef ACE_XML_SCHEMA_RESOLVER_H -#define ACE_XML_SCHEMA_RESOLVER_H -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "XML_Utils_Export.h" -#include "XercesString.h" - -#include -#include -#include - -using namespace xercesc; - -namespace XML -{ - // forward decl. - struct NoOp_Resolver; - - /** - * @class XML_Schema_Resolver - * @brief Resolves schema locations - * - * Template argument Resolver should be a functor with an operation - * const ACE_TCHAR * operator () (...arguments from resolveEntity...) - */ - template - class XML_Schema_Resolver - : public virtual EntityResolver - { - public: - XML_Schema_Resolver (void); - - XML_Schema_Resolver (Resolver &resolver); - - /// This function is called by the Xerces infrastructure to - /// actually resolve the location of a schema. - virtual InputSource * resolveEntity (const XMLCh *const publicId, - const XMLCh *const systemId); - - Resolver &get_resolver (void); - - private: - XML_Schema_Resolver (XML_Schema_Resolver &); - - Resolver resolver_; - }; - - /** - * @class NoOp_Resolver - * @brief Resolver that does nothing. - */ - struct NoOp_Resolver - { - const XMLCh* operator() (const XMLCh *const, - const XMLCh *const systemId) const - { return systemId; }; - }; - - /** - * @class Basic_Resolver - * @brief Resolves a schema location from a fixed path. - */ - struct Basic_Resolver - { - Basic_Resolver (const ACE_TCHAR *path); - - XMLCh* operator() (const XMLCh *const publicId, - const XMLCh *const systemId) const; - XStr path_; - }; - - /** - * @class Environment_Resolver - * @brief Resolves a schema location from a path from an environment variable. - */ - struct XML_Utils_Export Environment_Resolver - { - Environment_Resolver (void); - - Environment_Resolver (const ACE_TCHAR *variable, - const ACE_TCHAR *path); - - void add_path (const ACE_TCHAR *variable, - const ACE_TCHAR *path); - - XMLCh* operator() (const XMLCh *const publicId, - const XMLCh *const systemId) const; - - std::vector paths_; - }; -} - -#include "XML_Schema_Resolver.tpp" - -#include /**/ "ace/post.h" - -#endif /* ACE_XML_SCHEMA_RESOLVER_H */ diff --git a/deps/acelite/ace/XML_Utils/XML_Schema_Resolver.tpp b/deps/acelite/ace/XML_Utils/XML_Schema_Resolver.tpp deleted file mode 100644 index 3b5a68b5d..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Schema_Resolver.tpp +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef XML_SCHEMA_RESOLVER_TPP -#define XML_SCHEMA_RESOLVER_TPP - -#include "XML_Schema_Resolver.h" -#include "XercesString.h" - -#include -#include - -using xercesc::Wrapper4InputSource; -using xercesc::LocalFileInputSource; - - -namespace XML -{ - template - XML_Schema_Resolver::XML_Schema_Resolver (void) - : resolver_ () - { - } - - template - XML_Schema_Resolver::XML_Schema_Resolver (Resolver &res) - : resolver_ (res) - { - } - - template - Resolver & - XML_Schema_Resolver::get_resolver (void) - { - return resolver_; - } - - /// This function is called by the Xerces infrastructure to - /// actually resolve the location of a schema. - template - InputSource * - XML_Schema_Resolver::resolveEntity (const XMLCh *const publicId, - const XMLCh *const systemId) - { - XStr path = resolver_ (publicId, systemId); - if (path.begin () == 0) - return 0; - - // Ownership of these objects is given to other people. - return /*new Wrapper4InputSource*/ (new LocalFileInputSource (path.begin ())); - } -} - -#endif /*XML_SCHEMA_RESOLVER_TPP*/ diff --git a/deps/acelite/ace/XML_Utils/XML_Typedefs.cpp b/deps/acelite/ace/XML_Utils/XML_Typedefs.cpp deleted file mode 100644 index 3385a4b38..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Typedefs.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "XML_Typedefs.h" - -namespace XML -{ - XML_Typedef::HELPER XML_Typedef::XML_HELPER; -} diff --git a/deps/acelite/ace/XML_Utils/XML_Typedefs.h b/deps/acelite/ace/XML_Utils/XML_Typedefs.h deleted file mode 100644 index 7892f5bc4..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Typedefs.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file XML_Typedefs.h - * @author William R. Otte - * - * Typedefs from the XML Utilities. - */ -#ifndef XML_TYPEDEFS_H -#define XML_TYPEDEFS_H - -#include "XML_Utils_Export.h" -#include "XML_Helper.h" -#include "XML_Schema_Resolver.h" -#include "XML_Error_Handler.h" - -namespace XML -{ - class XML_Utils_Export XML_Typedef - { - public: - typedef ::XML::Environment_Resolver PATH_RESOLVER; - typedef ::XML::XML_Schema_Resolver< ::XML::Environment_Resolver > XML_RESOLVER; - typedef ::XML::XML_Error_Handler ERROR_HANDLER; - typedef ::XML::XML_Helper< XML_RESOLVER, ERROR_HANDLER > HELPER; - - static ERROR_HANDLER _xml_error_handler; - - public: - static HELPER XML_HELPER; - }; -} - -#endif /* XML_TYPEDEFS_H */ diff --git a/deps/acelite/ace/XML_Utils/XML_Utils_Export.h b/deps/acelite/ace/XML_Utils/XML_Utils_Export.h deleted file mode 100644 index 60e2adec9..000000000 --- a/deps/acelite/ace/XML_Utils/XML_Utils_Export.h +++ /dev/null @@ -1,57 +0,0 @@ - -// -*- C++ -*- -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl XML_Utils -// ------------------------------ -#ifndef XML_UTILS_EXPORT_H -#define XML_UTILS_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (XML_UTILS_HAS_DLL) -# define XML_UTILS_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && XML_UTILS_HAS_DLL */ - -#if !defined (XML_UTILS_HAS_DLL) -# define XML_UTILS_HAS_DLL 1 -#endif /* ! XML_UTILS_HAS_DLL */ - -#if defined (XML_UTILS_HAS_DLL) && (XML_UTILS_HAS_DLL == 1) -# if defined (XML_UTILS_BUILD_DLL) -# define XML_Utils_Export ACE_Proper_Export_Flag -# define XML_UTILS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* XML_UTILS_BUILD_DLL */ -# define XML_Utils_Export ACE_Proper_Import_Flag -# define XML_UTILS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* XML_UTILS_BUILD_DLL */ -#else /* XML_UTILS_HAS_DLL == 1 */ -# define XML_Utils_Export -# define XML_UTILS_SINGLETON_DECLARATION(T) -# define XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* XML_UTILS_HAS_DLL == 1 */ - -// Set XML_UTILS_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (XML_UTILS_NTRACE) -# if (ACE_NTRACE == 1) -# define XML_UTILS_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define XML_UTILS_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !XML_UTILS_NTRACE */ - -#if (XML_UTILS_NTRACE == 1) -# define XML_UTILS_TRACE(X) -#else /* (XML_UTILS_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define XML_UTILS_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (XML_UTILS_NTRACE == 1) */ - -#endif /* XML_UTILS_EXPORT_H */ - -// End of auto generated file. diff --git a/deps/acelite/ace/XML_Utils/XSCRT/Elements.hpp b/deps/acelite/ace/XML_Utils/XSCRT/Elements.hpp deleted file mode 100644 index abe607291..000000000 --- a/deps/acelite/ace/XML_Utils/XSCRT/Elements.hpp +++ /dev/null @@ -1,567 +0,0 @@ -// file : XSCRT/Elements.hpp -// author : Boris Kolpackov -#ifndef XSCRT_ELEMENTS_HPP -#define XSCRT_ELEMENTS_HPP - -#include -#include -#include -#include "ace/ace_wchar.h" -// #include //@@ tmp - -#include -#include "ace/Refcounted_Auto_Ptr.h" - -namespace XSCRT -{ - struct IdentityProvider - { - virtual bool - before (IdentityProvider const&) const = 0; - - virtual ~IdentityProvider (void) - { - - } - }; - - class Type - { - public: - - virtual ~Type (void) - { - } - - protected: - Type (void) - : container_ (0) - { - } - - template - Type (XML::Element const&) - : container_ (0) - { - } - - template - Type (XML::Attribute const&) - : container_ (0) - { - } - - Type (Type const&) - : container_ (0) - { - } - - Type& - operator= (Type const&) - { - //@@ I don't need this. - //if (map_.get ()) map_->clear (); // Flush the map. - return *this; - } - - public: - Type const* - container () const - { - return container_ ? container_ : this; - } - - Type* - container () - { - return container_ ? container_ : this; - } - - - Type const* - root () const - { - Type const* r = container (); - - //@@ VC6 can't handle this inside the loop. - // - Type const* c = r->container (); - - for (; c != r; c = c->container ()) r = c; - - return r; - } - - Type* - root () - { - Type* r = container (); - - for (Type* c = r->container (); c != r; c = c->container ()) r = c; - - return r; - } - - //@@ - //protected: - - public: - virtual void - container (Type* c) - { - if (container_ == c) return; - - // Revoke registrations from our old container. - // - if (container_ != 0 && map_.get ()) - { - for (Map_::iterator i (map_->begin ()); i != map_->end (); ++i) - { - //std::wcerr << "revoking " << i->second - // << " to " << container_ << std::endl; - - container_->unregister_id (*(i->first)); - } - } - - // Copy registrations to our new container. - // - if (c != 0 && map_.get ()) - { - for (Map_::iterator i (map_->begin ()); i != map_->end (); ++i) - { - //std::wcerr << "copying " << i->second - // << " to " << c << std::endl; - - c->register_id (*(i->first), i->second); - } - } - - container_ = c; - } - - //@@ - //protected: - - public: - void - register_id (IdentityProvider const& id, Type* t) - { - if (map_.get () == 0) - { - map_ = std::unique_ptr (new Map_); - } - - if (!map_->insert ( - std::pair (&id, t)).second) - { - throw 1; - } - - if (container () != this) container ()->register_id (id, t); - } - - void - unregister_id (IdentityProvider const& id) - { - if (map_.get ()) - { - Map_::iterator it (map_->find (&id)); - - if (it != map_->end ()) - { - map_->erase (it); - - if (container () != this) container ()->unregister_id (id); - - return; - } - } - - throw 1; - } - - Type* - lookup_id (IdentityProvider const& id) const - { - if (map_.get ()) - { - Map_::const_iterator it (map_->find (&id)); - - if (it != map_->end ()) - { - return it->second; - } - } - - return 0; - } - - //Get and set methods for the idref_map_ data member - Type* get_idref (const char* name) - { - std::basic_string name_string (ACE_TEXT_CHAR_TO_TCHAR(name)); - std::map, XSCRT::Type*>::iterator i = - this->idref_map_.find(name_string); - if (i != idref_map_.end()) - { - return i->second; - } - else - { - return 0; - } - } - - Type* get_idref (const wchar_t *name) - { - std::basic_string name_string (ACE_TEXT_WCHAR_TO_TCHAR(name)); - std::map, XSCRT::Type*>::iterator i = - this->idref_map_.find(name_string); - if (i != idref_map_.end()) - { - return i->second; - } - else - { - return 0; - } - } - - - void set_idref (std::basic_string name, Type* new_idref) - { - this->idref_map_.insert(std::pair,Type*>(name, new_idref)); - return; - } - - private: - - //Data member to handle unbounded IDREF attributes and elements - std::map, XSCRT::Type*> idref_map_; - - Type* container_; - - struct IdentityComparator - { - bool operator () (IdentityProvider const* x, - IdentityProvider const* y) const - { - return x->before (*y); - } - }; - - typedef - std::map - Map_; - - std::unique_ptr map_; - }; - - // Fundamental types template. - // - // - template - class FundamentalType : public Type - { - public: - // Trait for marshaling a FundamentalType X - typedef X CDR_Type__; -#if !defined (__BORLANDC__) || (__BORLANDC__ >= 0x620) - typedef ACE_Refcounted_Auto_Ptr < FundamentalType, ACE_Null_Mutex > _ptr; -#endif /* !__BORLANDC__ */ - - FundamentalType () - { - } - - template - FundamentalType (XML::Element const& e) - { - std::basic_stringstream s; - s << e.value (); - s >> x_; - } - - template - FundamentalType (XML::Attribute const& a) - { - std::basic_stringstream s; - s << a.value (); - s >> x_; - } - - FundamentalType (X const& x) - : x_ (x) - { - } - - FundamentalType& - operator= (X const& x) - { - x_ = x; - return *this; - } - - public: - operator X const& () const - { - return x_; - } - - operator X& () - { - return x_; - } - - protected: - X x_; - }; - -#if !((defined (__GNUC__) && (__GNUC__ == 3 && (__GNUC_MINOR__ < 3))) || \ - (defined (__BORLANDC__) && (__BORLANDC__ < 0x620)) || \ - (defined (__SUNPRO_CC) && (__SUNPRO_CC <= 0x5100))) - - // Stuff for normal compilers. - // - - // Specialization for `signed char' - // - // - template<> - template - inline - FundamentalType:: - FundamentalType (XML::Element const& e) - { - std::basic_stringstream s; - s << e.value (); - - short t; - s >> t; - - x_ = static_cast (t); - } - - template<> - template - inline - FundamentalType:: - FundamentalType (XML::Attribute const& a) - { - std::basic_stringstream s; - s << a.value (); - - short t; - s >> t; - - x_ = static_cast (t); - } - - // Specialization for `unsigned char' - // - // - template<> - template - inline - FundamentalType:: - FundamentalType (XML::Element const& e) - { - std::basic_stringstream s; - s << e.value (); - - unsigned short t; - s >> t; - - x_ = static_cast (t); - } - - template<> - template - inline - FundamentalType:: - FundamentalType (XML::Attribute const& a) - { - std::basic_stringstream s; - s << a.value (); - - unsigned short t; - s >> t; - - x_ = static_cast (t); - } - -#else - - // Stuff for broken VC6 & gcc < 3.3. Don't like what you see - use better - // compiler! - // - - // Specialization for signed char. - // - template <> - class FundamentalType : public Type - { - public: - FundamentalType () - { - } - - template - FundamentalType (XML::Element const& e) - { - std::basic_stringstream s; - s << e.value (); - - short t; - s >> t; - - x_ = static_cast (t); - } - - template - FundamentalType (XML::Attribute const& a) - { - std::basic_stringstream s; - s << a.value (); - - short t; - s >> t; - - x_ = static_cast (t); - } - - FundamentalType (signed char const& x) - : x_ (x) - { - } - - FundamentalType& - operator= (signed char const& x) - { - x_ = x; - return *this; - } - - public: - operator signed char const& () const - { - return x_; - } - - operator signed char& () - { - return x_; - } - - protected: - signed char x_; - }; - - // Specialization for unsigned char. - // - template <> - class FundamentalType : public Type - { - public: - FundamentalType () - { - } - - template - FundamentalType (XML::Element const& e) - { - std::basic_stringstream s; - s << e.value (); - - unsigned short t; - s >> t; - - x_ = static_cast (t); - } - - template - FundamentalType (XML::Attribute const& a) - { - std::basic_stringstream s; - s << a.value (); - - unsigned short t; - s >> t; - - x_ = static_cast (t); - } - - FundamentalType (unsigned char const& x) - : x_ (x) - { - } - - FundamentalType& - operator= (unsigned char const& x) - { - x_ = x; - return *this; - } - - public: - operator unsigned char const& () const - { - return x_; - } - - operator unsigned char& () - { - return x_; - } - - protected: - unsigned char x_; - }; - -#endif - - - // Specialization for bool. - // - // - - template<> - template<> - inline - FundamentalType:: - FundamentalType (XML::Element const& e) - { - x_ = (e.value () == "true") || (e.value () == "1"); - } - - template<> - template<> - inline - FundamentalType:: - FundamentalType (XML::Element const& e) - { - x_ = (e.value () == L"true") || (e.value () == L"1"); - } - - template<> - template<> - inline - FundamentalType:: - FundamentalType (XML::Attribute const& a) - { - x_ = (a.value () == "true") || (a.value () == "1"); - } - - template<> - template<> - inline - FundamentalType:: - FundamentalType (XML::Attribute const& a) - { - x_ = (a.value () == L"true") || (a.value () == L"1"); - } - -} - -#endif // XSCRT_ELEMENTS_HPP diff --git a/deps/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp b/deps/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp deleted file mode 100644 index 90c4e37c5..000000000 --- a/deps/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp +++ /dev/null @@ -1,180 +0,0 @@ -// file : XSCRT/ExtendedTypeInfo.hpp -// author : Boris Kolpackov -#ifndef XSCRT_EXTENDED_TYPE_INFO_HPP -#define XSCRT_EXTENDED_TYPE_INFO_HPP - -#include -#include -#include - -namespace XSCRT -{ - // - // - // - class TypeId - { - public: - template - TypeId (T const& t); - - TypeId (std::type_info const& tid); - - public: - bool - operator == (TypeId const& other) const; - - bool - operator != (TypeId const& other) const; - - bool - operator < (TypeId const& other) const; - - /* - friend std::ostream& - operator << (std::ostream& os, TypeId const& t); - */ - - public: - char const* - name () const - { - return tid_->name (); - } - - private: - std::type_info const* tid_; - }; - - - // - // - // - class ExtendedTypeInfo - { - public: - - // - // - // - struct Access - { - enum Value - { - private_, - protected_, - public_ - }; - }; - - - // - // - // - class BaseInfo - { - public: - BaseInfo (Access::Value access, bool virtual_base, TypeId const& tid); - - public: - ExtendedTypeInfo const& - type_info () const; - - Access::Value - access () const; - - bool - virtual_base () const; - - private: - TypeId tid_; - mutable ExtendedTypeInfo const* ti_; - bool virtual_base_; - Access::Value access_; - }; - - private: - typedef - std::vector - BaseInfoList; - - public: - typedef - BaseInfoList::const_iterator - BaseIterator; - - public: - ExtendedTypeInfo (TypeId const& tid); - - TypeId - type_id () const; - - BaseIterator - begin_base () const; - - BaseIterator - end_base () const; - - void - add_base (Access::Value access, bool virtual_base, TypeId const& tid); - - private: - TypeId tid_; - BaseInfoList base_; - }; - - typedef - std::map - ExtendedTypeInfoMap; - - - ExtendedTypeInfoMap& - extended_type_info_map (); - - - class NotAvailable {}; - - - template - ExtendedTypeInfo const& - extended_type_info (T const& t) - { - return extended_type_info (typeid (t)); - } - - template - ExtendedTypeInfo const& - extended_type_info () - { - return extended_type_info (typeid (T)); - } - - //@@ Had to use function template specialization because VC6 - // cannot handle simply overloaded functions. - // - - template <> - inline - ExtendedTypeInfo const& - extended_type_info (TypeId const& tid) - { - ExtendedTypeInfoMap::const_iterator i ( - extended_type_info_map ().find (tid)); - - if (i == extended_type_info_map ().end ()) throw NotAvailable (); - - return i->second; - } - - template <> - inline - ExtendedTypeInfo const& - extended_type_info (std::type_info const& tid) - { - return extended_type_info (TypeId (tid)); - } -} - -#include - -#endif // XSCRT_EXTENDED_TYPE_INFO_HPP diff --git a/deps/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.ipp b/deps/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.ipp deleted file mode 100644 index 6f402b021..000000000 --- a/deps/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.ipp +++ /dev/null @@ -1,140 +0,0 @@ -// file : XSCRT/ExtendedTypeInfo.ipp -// author : Boris Kolpackov - - -/* - * @@HACK: Visual Studio. - * I think the return value for operator== for type_info - * in VC7 (perhaps others) is int when is should be bool. - * This causes a warning about converting the return value from - * int to bool. - */ -#ifdef _MSC_VER -# pragma warning( disable: 4800 ) -#endif - -namespace XSCRT -{ - // TypeId - // - // - inline - TypeId:: - TypeId (std::type_info const& tid) - : tid_ (&tid) - { - } - - inline - bool TypeId:: - operator == (TypeId const& other) const - { - return *tid_ == *other.tid_; - } - - inline - bool TypeId:: - operator != (TypeId const& other) const - { - return *tid_ != *other.tid_; - } - - inline - bool TypeId:: - operator < (TypeId const& other) const - { - return tid_->before (*other.tid_); - } - - - // ExtendedTypeInfo::BaseInfo - // - // - - inline - ExtendedTypeInfo::BaseInfo:: - BaseInfo (Access::Value access, bool virtual_base, TypeId const& tid) - : tid_ (tid), - ti_ (0), - virtual_base_ (virtual_base), - access_ (access) - { - } - - inline - ExtendedTypeInfo const& ExtendedTypeInfo::BaseInfo:: - type_info () const - { - if (ti_ == 0) ti_ = &(extended_type_info (tid_)); - - return *ti_; - } - - - inline - ExtendedTypeInfo::Access::Value ExtendedTypeInfo::BaseInfo:: - access () const - { - return access_; - } - - inline - bool ExtendedTypeInfo::BaseInfo:: - virtual_base () const - { - return virtual_base_; - } - - - // ExtendedTypeInfo - // - // - inline - ExtendedTypeInfo:: - ExtendedTypeInfo (TypeId const& tid) - : tid_ (tid) - { - } - - inline - TypeId ExtendedTypeInfo:: - type_id () const - { - return tid_; - } - - inline - ExtendedTypeInfo::BaseIterator ExtendedTypeInfo:: - begin_base () const - { - return base_.begin (); - } - - - inline - ExtendedTypeInfo::BaseIterator ExtendedTypeInfo:: - end_base () const - { - return base_.end (); - } - - inline - void ExtendedTypeInfo:: - add_base (Access::Value access, bool virtual_base, TypeId const& tid) - { - base_.push_back (BaseInfo (access, virtual_base, tid)); - } - - // ExtendedTypeInfoMap - // - // - - inline - ExtendedTypeInfoMap& - extended_type_info_map () - { - static ExtendedTypeInfoMap extended_type_info_map_; - - return extended_type_info_map_; - } -} diff --git a/deps/acelite/ace/XML_Utils/XSCRT/Parser.hpp b/deps/acelite/ace/XML_Utils/XSCRT/Parser.hpp deleted file mode 100644 index 0f7fb87ed..000000000 --- a/deps/acelite/ace/XML_Utils/XSCRT/Parser.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// file : XSCRT/Parser.hpp -// author : Boris Kolpackov -#ifndef XSCRT_PARSER_HPP -#define XSCRT_PARSER_HPP - -#include - -#include "ace/XML_Utils/XSCRT/XML.hpp" - -namespace XSCRT -{ - template - class Parser - { - public: - Parser (XML::Element const& e) - : e_ (e.dom_element ()->getChildNodes ()), ei_ (0), - a_ (e.dom_element ()->getAttributes ()), ai_ (0) - { - } - - bool - more_elements () const - { - return e_->getLength () > ei_; - } - - XML::Element - next_element () - { - return XML::Element (XML::dom_cast (e_->item (ei_++))); - } - - bool - more_attributes () const - { - return a_->getLength () > ai_; - } - - XML::Attribute - next_attribute () - { - return XML::Attribute ( - XML::dom_cast (a_->item (ai_++))); - } - - private: - xercesc::DOMNodeList const* e_; - unsigned long ei_; - - xercesc::DOMNamedNodeMap const* a_; - unsigned long ai_; - - private: - Parser (Parser const&); - - void - operator= (Parser const&); - }; -} - -#endif // XSCRT_PARSER_HPP diff --git a/deps/acelite/ace/XML_Utils/XSCRT/Traversal.hpp b/deps/acelite/ace/XML_Utils/XSCRT/Traversal.hpp deleted file mode 100644 index b77f077d2..000000000 --- a/deps/acelite/ace/XML_Utils/XSCRT/Traversal.hpp +++ /dev/null @@ -1,263 +0,0 @@ -// file : XSCRT/Traversal.hpp -// author : Boris Kolpackov -#ifndef XSCRT_TRAVERSAL_HPP -#define XSCRT_TRAVERSAL_HPP - -#include -#include -#include - -#include "ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp" - -namespace XSCRT -{ - namespace Traversal - { - // - // - // - template - class TraverserBase - { - protected: - virtual - ~TraverserBase (); - - //@@ VC6 - public: - virtual void - trampoline (B& n) = 0; - - virtual void - trampoline (B const& n) = 0; - }; - - - // - // - // - template - class DispatcherBase - { - public: - virtual - ~DispatcherBase (); - - virtual void - dispatch (B& n); - - virtual void - dispatch (B const& n); - - void - map (TypeId id, TraverserBase& t) - { - //wcerr << "map for " << id.name () << " to " << &t - // << " in " << &traversal_map_ << endl; - - //@@ VC6 - Traversers& traversers = traversal_map_[id]; - traversers.push_back (&t); - } - - public: - typedef - std::vector*> - Traversers; - - typedef - std::map - TraversalMap; - - typedef - typename TraversalMap::const_iterator - Iterator; - - Iterator - begin () const - { - return traversal_map_.begin (); - } - - Iterator - end () const - { - return traversal_map_.end (); - } - - private: - struct TypeInfoComparator - { - bool - operator () (ExtendedTypeInfo const& x, - ExtendedTypeInfo const& y) const - { - return x.type_id () < y.type_id (); - } - }; - - typedef - std::map - LevelMap; - - typedef - std::set - TypeInfoSet; - - static unsigned long - compute_levels (ExtendedTypeInfo const& ti, - unsigned long cur, - LevelMap& map); - - static void - flatten_tree (ExtendedTypeInfo const& ti, TypeInfoSet& set); - - private: - TraversalMap traversal_map_; - }; - - - // - // - // - template - class Dispatcher : public virtual DispatcherBase - { - public: - Dispatcher () - : merge_ (true) - { - } - - void - traverser (DispatcherBase& d) - { - for (typename DispatcherBase::Iterator - i (d.begin ()), end (d.end ()); - i != end; ++i) - { - for (typename DispatcherBase::Traversers::const_iterator - t (i->second.begin ()), end (i->second.end ()); - t != end; ++t) - { - dispatcher_.map (i->first, **t); - } - } - } - - public: - virtual void - dispatch (B& n) - { - merge (); - dispatcher_.dispatch (n); - } - - virtual void - dispatch (B const& n) - { - merge (); - dispatcher_.dispatch (n); - } - - using DispatcherBase::begin; - using DispatcherBase::end; - - private: - void - merge () - { - if (merge_) - { - for (typename DispatcherBase::Iterator - i (begin ()), e (end ()); i != e; ++i) - { - for (typename DispatcherBase::Traversers::const_iterator - t (i->second.begin ()), e (i->second.end ()); t != e; ++t) - { - dispatcher_.map (i->first, **t); - } - } - - merge_ = false; - } - } - - protected: - // DispatcherBase& - // traverser () - // { - // return dispatcher_; - // } - - template - void - iterate_and_dispatch (I begin, I end, X& x, void (X::*next)(A&), A& a) - { - for (; begin != end;) - { - dispatch (*begin); - - if (++begin != end) (x.*next) (a); - } - } - - private: - bool merge_; - DispatcherBase dispatcher_; - }; - - - - // - // - // - template - struct Traverser : TraverserBase, virtual Dispatcher - { - typedef - T - Type; - - Traverser () - { - DispatcherBase::map (typeid (Type), *this); - } - - virtual void - traverse (Type&) - { - abort (); - } - - virtual void - traverse (Type const&) - { - abort (); - } - - protected: - virtual void - trampoline (B& n) - { - //wcerr << "trampoline for " << &n << " to type " - // << typeid (Type).name () << endl; - - traverse (dynamic_cast (n)); - } - - virtual void - trampoline (B const& n) - { - //wcerr << "trampoline for " << &n << " to type " - // << typeid (Type).name () << endl; - - traverse (dynamic_cast (n)); - } - }; - } -} - -#include - -#endif // XSCRT_TRAVERSAL_HPP diff --git a/deps/acelite/ace/XML_Utils/XSCRT/Traversal.tpp b/deps/acelite/ace/XML_Utils/XSCRT/Traversal.tpp deleted file mode 100644 index 4d6d8b05b..000000000 --- a/deps/acelite/ace/XML_Utils/XSCRT/Traversal.tpp +++ /dev/null @@ -1,194 +0,0 @@ -// file : XSCRT/Traversal.tpp -// author : Boris Kolpackov - -namespace XSCRT -{ - namespace Traversal - { - // TraverserBase - // - // - - template - TraverserBase:: - ~TraverserBase () - { - } - - // DispatcherBase - // - // - - template - DispatcherBase:: - ~DispatcherBase () - { - } - - //@@ merge after dropping VC6 - // - // - template - void DispatcherBase:: - dispatch (B& n) - { - LevelMap levels; - - //@@ VC6 - ExtendedTypeInfo const& ti = extended_type_info (n); - - unsigned long max = compute_levels (ti, 0, levels); - - - //wcerr << "starting dispatch process for " - // << typeid (n).name () << " with " - // << max << " levels" << endl; - - for (unsigned long l = 0; l < max + 1; ++l) - { - TypeInfoSet dispatched; - - for (typename LevelMap::const_iterator - i (levels.begin ()), e (levels.end ()); - i != e; ++i) - { - if (i->second == l) - { - typename TraversalMap::const_iterator v ( - traversal_map_.find (i->first.type_id ())); - - if (v != traversal_map_.end ()) - { - //wcerr << "dispatching traversers for " - // << typeid (n).name () << " as " - // << i->first.type_id ().name () << endl; - - //@@ VC6 - Traversers const& traversers = v->second; - for (typename Traversers::const_iterator - ti (traversers.begin ()), te (traversers.end ()); - ti != te; ++ti) - { - (*ti)->trampoline (n); - } - - flatten_tree (i->first, dispatched); - } - } - } - - // Remove traversed types from the level map. - // - //@@ VC6 - { - for (typename TypeInfoSet::const_iterator i = dispatched.begin (); - i != dispatched.end (); - ++i) - { - levels.erase (*i); - } - } - } - } - - template - void DispatcherBase:: - dispatch (B const& n) - { - LevelMap levels; - - //@@ VC6 - ExtendedTypeInfo const& ti = extended_type_info (n); - - unsigned long max = compute_levels (ti, 0, levels); - - - //wcerr << "starting dispatch process for " - // << typeid (n).name () << " with " - // << max << " levels" << endl; - - //wcerr << "using " << &traversal_map_ << " traversal map" << endl; - - for (unsigned long l = 0; l < max + 1; ++l) - { - TypeInfoSet dispatched; - - for (typename LevelMap::const_iterator - i (levels.begin ()), e (levels.end ()); - i != e; ++i) - { - if (i->second == l) - { - typename TraversalMap::const_iterator v ( - traversal_map_.find (i->first.type_id ())); - - if (v != traversal_map_.end ()) - { - //wcerr << "dispatching traversers for " - // << typeid (n).name () << " as " - // << i->first.type_id ().name () << endl; - - //@@ VC6 - Traversers const& traversers = v->second; - for (typename Traversers::const_iterator - ti (traversers.begin ()), te (traversers.end ()); - ti != te; ++ti) - { - (*ti)->trampoline (n); - } - - flatten_tree (i->first, dispatched); - } - } - } - - // Remove traversed types from the level map. - // - //@@ VC6 - { - for (typename TypeInfoSet::const_iterator i = dispatched.begin (); - i != dispatched.end (); - ++i) - { - levels.erase (*i); - } - } - } - } - - template - unsigned long DispatcherBase:: - compute_levels (ExtendedTypeInfo const& ti, - unsigned long cur, - LevelMap& map) - { - unsigned long ret = cur; - - if (map.find (ti) == map.end () || map[ti] < cur) map[ti] = cur; - - for (ExtendedTypeInfo::BaseIterator i = ti.begin_base (); - i != ti.end_base (); - i++) - { - unsigned long t = compute_levels (i->type_info (), cur + 1, map); - if (t > ret) ret = t; - } - - return ret; - } - - template - void DispatcherBase:: - flatten_tree (ExtendedTypeInfo const& ti, TypeInfoSet& set) - { - set.insert (ti); - - for (ExtendedTypeInfo::BaseIterator i = ti.begin_base (); - i != ti.end_base (); - i++) - { - flatten_tree (i->type_info (), set); - } - } - } -} diff --git a/deps/acelite/ace/XML_Utils/XSCRT/Writer.hpp b/deps/acelite/ace/XML_Utils/XSCRT/Writer.hpp deleted file mode 100644 index 13c64d9b6..000000000 --- a/deps/acelite/ace/XML_Utils/XSCRT/Writer.hpp +++ /dev/null @@ -1,76 +0,0 @@ -// file : XSCRT/Writer.hpp -// author : Boris Kolpackov -#ifndef XSCRT_WRITER_HPP -#define XSCRT_WRITER_HPP - -#include -#include - -#include "ace/XML_Utils/XSCRT/XML.hpp" - -namespace XSCRT -{ - template - class Writer - { - public: - Writer (XML::Element& e) - : attr__ (0) - { - push_ (e); - } - - protected: - // This c-tor should never be called. - // - Writer () - { - abort (); - } - - public: - void - push_ (XML::Element const& e) - { - stack_.push (e); - } - - void - pop_ () - { - stack_.pop (); - } - - XML::Element& - top_ () - { - return stack_.top (); - } - - public: - XML::Attribute* - attr_ () - { - return attr__; - } - - void - attr_ (XML::Attribute* a) - { - attr__ = a; - } - - private: - std::stack > stack_; - - XML::Attribute* attr__; - - private: - Writer (Writer const&); - - void - operator= (Writer const&); - }; -} - -#endif // XSCRT_WRITER_HPP diff --git a/deps/acelite/ace/XML_Utils/XSCRT/XML.hpp b/deps/acelite/ace/XML_Utils/XSCRT/XML.hpp deleted file mode 100644 index ce4b51284..000000000 --- a/deps/acelite/ace/XML_Utils/XSCRT/XML.hpp +++ /dev/null @@ -1,488 +0,0 @@ -// file : XSCRT/XML.hpp -// author : Boris Kolpackov - -#ifndef XSCRT_XML_HPP -#define XSCRT_XML_HPP - -#include - -#include -#include - -namespace XSCRT -{ - namespace XML - { - //@@ VC6 - // - template - std::basic_string - transcode (XMLCh const* s, C*); - - template - XMLCh* - transcode (std::basic_string const& s); - - // - // - // - class string - { - public : - template - string (std::basic_string const& s) - : s_ (XSCRT::XML::transcode (s)) - { - } - - template - string (C const* s) - : s_ (XSCRT::XML::transcode (s)) - { - } - - ~string () - { - delete[] s_; - } - - XMLCh const* - c_str () const - { - return s_; - } - - private : - XMLCh* s_; - }; - - - template <> - inline - std::basic_string - transcode (XMLCh const* s, char*) - { - if (s == 0) return std::basic_string (); - - char* buf = xercesc::XMLString::transcode (s); - - std::basic_string r (buf); - - xercesc::XMLString::release (&buf); - - return r; - } - - template <> - inline - std::basic_string - transcode (XMLCh const* s, wchar_t*) - { - if (s == 0) return std::basic_string (); - - // std::wcerr << s << std::endl; - - std::basic_string r (xercesc::XMLString::stringLen (s), L'0'); - - for (std::size_t i (0); *s != XMLCh (0); ++s, ++i) - { - r[i] = *s; - } - - return r; - } - - template <> - inline - XMLCh* - transcode (std::basic_string const& s) - { - return xercesc::XMLString::transcode (s.c_str ()); - } - - template <> - inline - XMLCh* - transcode (std::basic_string const& s) - { - //@@ VC6 - std::size_t l = s.length (); - - //@@ VC6 - XMLCh* r = new XMLCh[l + 1]; - XMLCh* ir = r; - - for (std::size_t i (0); i < l; ++ir, ++i) - { - *ir = static_cast(s[i]); - //std::wcerr << s[i] << "->" << *ir << std::endl; - } - - *ir = XMLCh (0); - - // std::wcerr << r << std::endl; - - return r; - } - - - template - class Element; - - template - std::basic_string - ns_prefix (std::basic_string const& ns, Element const& e); - - // Casting helpers, made necessary by the Xerces project's braindead - // avoidance of RTTI. - template struct dom_traits; - - // Specializations for different node types - template <> - struct dom_traits - { - static const xercesc::DOMNode::NodeType node_type = xercesc::DOMNode::ELEMENT_NODE; - }; - - template <> - struct dom_traits - { - static const xercesc::DOMNode::NodeType node_type = xercesc::DOMNode::ATTRIBUTE_NODE; - }; - - template - DERIVED_PTR dom_cast (xercesc::DOMNode *node) - { - DERIVED_PTR elem = 0; - if ((node != 0) && - (node->getNodeType () == dom_traits::node_type)) - { - elem = reinterpret_cast (node); - } - return elem; - } - - template - class Element - { - typedef std::basic_string string_; - - public: - Element (xercesc::DOMElement const* e) - : e_ (0), - ce_ (e), - name_ (transcode (e->getLocalName (), 0)), - namespace__ (transcode (e->getNamespaceURI (), 0)) - { - } - - Element (xercesc::DOMElement* e) - : e_ (e), - ce_ (e), - name_ (transcode (e->getLocalName (), 0)), - namespace__ (transcode (e->getNamespaceURI (), 0)) - { - } - - Element (string_ const& name, Element& parent) - : e_ (0), - ce_ (0), - name_ (name) - { - xercesc::DOMDocument* doc ( - parent.dom_element ()->getOwnerDocument ()); - - e_ = doc->createElement (string (name).c_str ()); - - parent.dom_element ()->appendChild (e_); - - ce_ = e_; - } - - Element (string_ const& name, string_ const& ns, Element& parent) - : e_ (0), - ce_ (0), - name_ (name), - namespace__ (ns) - { - string_ prefix (ns_prefix (ns, parent)); - - xercesc::DOMDocument* doc ( - parent.dom_element ()->getOwnerDocument ()); - - e_ = doc->createElementNS ( - string (ns).c_str (), - string (prefix.empty () - ? name - : prefix + string_ (1, ':') + name).c_str ()); - - parent.dom_element ()->appendChild (e_); - - ce_ = e_; - } - - public: - string_ - name () const - { - return name_; - } - - string_ - namespace_ () const - { - return namespace__; - } - - public: - Element - parent () const - { - return dom_cast (ce_->getParentNode ()); - } - - public: - string_ - value () const - { - return XML::transcode (dom_element ()->getTextContent (), 0); - } - - void - value (string_ const& v) - { - xercesc::DOMText* text ( - dom_element ()->getOwnerDocument ()->createTextNode( - string (v).c_str ())); - - dom_element ()->appendChild (text); - } - - public: - string_ - operator[] (string_ const& s) const - { - //@@ VC6 - XMLCh const* value = ce_->getAttribute (string (s).c_str ()); - - return transcode (value, 0); - } - - public: - xercesc::DOMElement const* - dom_element () const - { - return ce_; - } - - xercesc::DOMElement* - dom_element () - { - return e_; - } - - private: - xercesc::DOMElement* e_; - xercesc::DOMElement const* ce_; - - string_ name_; - string_ namespace__; - }; - - - template - class Attribute - { - typedef std::basic_string string_; - - public: - Attribute (xercesc::DOMAttr const* a) - : a_ (0), - ca_ (a), - name_ (transcode (a->getLocalName (), 0)), - value_ (transcode (a->getValue (), 0)) - { - } - - Attribute (xercesc::DOMAttr* a) - : a_ (a), - ca_ (a), - name_ (transcode (a->getLocalName (), 0)), - value_ (transcode (a->getValue (), 0)) - { - } - - Attribute (string_ const& name, - string_ const& v, - Element& parent) - : a_ (0), - ca_ (0), - name_ (name), - value_ () - { - xercesc::DOMDocument* doc ( - parent.dom_element ()->getOwnerDocument ()); - - a_ = doc->createAttribute (string (name).c_str ()); - - value (v); - - parent.dom_element ()->setAttributeNode (a_); - - ca_ = a_; - } - - Attribute (string_ const& name, - string_ const& ns, - string_ const& v, - Element& parent) - : a_ (0), - ca_ (0), - name_ (name), - value_ () - { - string_ prefix (ns_prefix (ns, parent)); - - xercesc::DOMDocument* doc ( - parent.dom_element ()->getOwnerDocument ()); - - a_ = doc->createAttributeNS ( - string (ns).c_str (), - string (prefix.empty () - ? name - : prefix + string_ (1, ':') + name).c_str ()); - - value (v); - - parent.dom_element ()->setAttributeNodeNS (a_); - - ca_ = a_; - } - - string_ - name () const - { - return name_; - } - - string_ - value () const - { - return value_; - } - - void - value (string_ const& v) - { - value_ = v; - a_->setValue (string (v).c_str ()); - } - - public: - xercesc::DOMAttr const* - dom_attribute () const - { - return ca_; - } - - xercesc::DOMAttr* - dom_attribute () - { - return a_; - } - - private: - - private: - xercesc::DOMAttr* a_; - xercesc::DOMAttr const* ca_; - - string_ name_; - string_ value_; - }; - - template - std::basic_string - prefix (std::basic_string const& n) - { - std::size_t i (0); - while (i < n.length () && n[i] != ':') ++i; - - //std::wcerr << "prefix " << n << " " - // << std::wstring (n, i == n.length () ? i : 0, i) << std::endl; - - return std::basic_string (n, i == n.length () ? i : 0, i); - } - - template - std::basic_string - uq_name (std::basic_string const& n) - { - std::size_t i (0); - while (i < n.length () && n[i] != ':') ++i; - - return std::basic_string (n.c_str () + (i == n.length () ? 0 : i + 1)); - } - - template - std::basic_string - ns_name (Element const& e, std::basic_string const& n) - { - std::basic_string wp (prefix (n)); - - //@@ VC6 - XMLCh const* xns = e.dom_element ()->lookupNamespaceURI ( - wp.empty () ? 0 : string (wp).c_str ()); - - - std::basic_string ns ( - xns ? transcode (xns, 0) : std::basic_string ()); - - return ns; - - } - - template - std::basic_string - fq_name (Element const& e, std::basic_string const& n) - { - std::basic_string ns (ns_name (e, n)); - std::basic_string un (uq_name (n)); - - return ns.empty () ? un : (ns + C ('#') + un); - } - - class no_prefix {}; - - template - std::basic_string - ns_prefix (std::basic_string const& ns, Element const& e) - { - string xns (ns); - -#if defined(XERCES_VERSION_MAJOR) && XERCES_VERSION_MAJOR > 2 - XMLCh const* p (e.dom_element ()->lookupPrefix (xns.c_str ())); -#else - XMLCh const* p (e.dom_element ()->lookupNamespacePrefix (xns.c_str (), false)); -#endif - - if (p == 0) - { - bool r (e.dom_element ()->isDefaultNamespace (xns.c_str ())); - - if (r) - { - return std::basic_string (); - } - else - { - throw no_prefix (); - } - } - - return transcode (p, 0); - } - } -} - -#endif // XSCRT_XML_HPP diff --git a/deps/acelite/ace/XML_Utils/XSCRT/XMLSchema.hpp b/deps/acelite/ace/XML_Utils/XSCRT/XMLSchema.hpp deleted file mode 100644 index 419785102..000000000 --- a/deps/acelite/ace/XML_Utils/XSCRT/XMLSchema.hpp +++ /dev/null @@ -1,584 +0,0 @@ -// file : XSCRT/XMLSchema.hpp -// author : Boris Kolpackov -#ifndef XSCRT_XMLSCHEMA_HPP -#define XSCRT_XMLSCHEMA_HPP - -#include -// #include //@@ tmp - -#include "ace/XML_Utils/XMLSchema/XSCRT/Elements.hpp" - -namespace XMLSchema -{ - typedef XSCRT::FundamentalType byte; - typedef XSCRT::FundamentalType unsignedByte; - - typedef XSCRT::FundamentalType short_; - typedef XSCRT::FundamentalType unsignedShort; - - typedef XSCRT::FundamentalType int_; - typedef XSCRT::FundamentalType unsignedInt; - - typedef XSCRT::FundamentalType long_; - typedef XSCRT::FundamentalType unsignedLong; - - //@@ It would be nice to use some arbitrary-length integer class. - // - typedef long_ decimal; - typedef decimal integer; - typedef integer nonPositiveInteger; - typedef integer nonNegativeInteger; - typedef nonNegativeInteger positiveInteger; - typedef nonPositiveInteger negativeInteger; - - - typedef XSCRT::FundamentalType boolean; - - typedef XSCRT::FundamentalType float_; - typedef XSCRT::FundamentalType double_; - - // Just to make GCC 3.3 and other broken compilers shutup. - // - using std::basic_string; - - - template - class string : public XSCRT::Type, public basic_string - { - protected: - typedef basic_string Base__ ; - - public: - - //@@ VC6 does not inject XSCRT::Type into the scope so I have - // to qualify it all the time. - // - - string () - { - } - - string (XSCRT::XML::Element const& e) - : Base__ (e.value ()) - { - } - - string (XSCRT::XML::Attribute const& a) - : Base__ (a.value ()) - { - } - - string (Base__ const& x) - : Base__ (x) - { - } - - string& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - - template - class normalizedString : public string - { - protected: - typedef typename string::Base__ Base__; - - public: - normalizedString () - { - } - - normalizedString (XSCRT::XML::Element const& e) - : string (e) - { - } - - normalizedString (XSCRT::XML::Attribute const& a) - : string (a) - { - } - - normalizedString (Base__ const& x) - : string (x) - { - } - - normalizedString& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - - template - class token : public normalizedString - { - protected: - typedef typename normalizedString::Base__ Base__; - - public: - token () - { - } - - token (XSCRT::XML::Element const& e) - : normalizedString (e) - { - } - - token (XSCRT::XML::Attribute const& a) - : normalizedString (a) - { - } - - token (Base__ const& x) - : normalizedString (x) - { - } - - token& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - - template - class NMTOKEN : public token - { - protected: - typedef typename token::Base__ Base__; - - public: - NMTOKEN () - { - } - - NMTOKEN (XSCRT::XML::Element const& e) - : token (e) - { - } - - NMTOKEN (XSCRT::XML::Attribute const& a) - : token (a) - { - } - - NMTOKEN (Base__ const& x) - : token (x) - { - } - - NMTOKEN& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - template - class Name: public token - { - protected: - typedef typename token::Base__ Base__; - - public: - Name() - { - } - - Name(XSCRT::XML::Element const& e) - : token (e) - { - } - - Name(XSCRT::XML::Attribute const& a) - : token (a) - { - } - - Name(Base__ const& x) - : token (x) - { - } - - Name& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - - template - class NCName: public Name - { - protected: - typedef typename Name::Base__ Base__; - - public: - NCName() - { - } - - NCName(XSCRT::XML::Element const& e) - : Name (e) - { - } - - NCName(XSCRT::XML::Attribute const& a) - : Name (a) - { - } - - NCName(Base__ const& x) - : Name (x) - { - } - - NCName& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - template - class QName: public Name - { - protected: - typedef typename Name::Base__ Base__; - - public: - QName() - { - } - - QName(XSCRT::XML::Element const& e) - : Name (e) - { - } - - QName(XSCRT::XML::Attribute const& a) - : Name (a) - { - } - - QName(Base__ const& x) - : Name (x) - { - } - - QName& - operator= (Base__ const& x) - { - static_cast (*this) = x; - return *this; - } - }; - - template - struct IdentityProvider : XSCRT::IdentityProvider - { - IdentityProvider (NCName const& id) - : id_ (id) - { - } - - virtual bool - before (XSCRT::IdentityProvider const& y) const - { - return id_ < dynamic_cast (y).id_; - } - - private: - NCName const& id_; - - private: - IdentityProvider (IdentityProvider const&); - - IdentityProvider& - operator= (IdentityProvider const&); - }; - - - template - class ID : public NCName - { - protected: - typedef typename NCName::Base__ Base__; - - public: - ~ID() - { - unregister_id (); - } - - ID () - : id_provider_ (*this) - { - } - - ID (XSCRT::XML::Element const& e) - : NCName (e), id_provider_ (*this) - { - } - - ID (XSCRT::XML::Attribute const& a) - : NCName (a), id_provider_ (*this) - { - } - - ID (ID const& x) - : NCName (x), id_provider_ (*this) - { - } - - ID (Base__ const& x) - : NCName (x), id_provider_ (*this) - { - } - - ID& - operator= (Base__ const& x) - { - unregister_id (); - - static_cast&>(*this) = x; - - register_id (); - - return *this; - } - - ID& - operator= (ID const& x) - { - unregister_id (); - - static_cast&>(*this) = static_cast const&>(x); - - register_id (); - - return *this; - } - - public: - using NCName::container; - - virtual void - container (XSCRT::Type* c) - { - unregister_id (); - - NCName::container (c); - - register_id (); - } - - private: - using NCName::empty; - using NCName::root; - - void - register_id () - { - if (container () != this && !empty ()) - { - //std::wcerr << "registering " << container () - // << " as '" << *this - // << "' on " << container () << std::endl; - container ()->register_id (id_provider_, container ()); - } - } - - void - unregister_id () - { - if (container () != this && !empty ()) - { - //std::wcerr << "un-registering " << container () - // << " as '" << *this - // << "' on " << container () << std::endl; - container ()->unregister_id (id_provider_); - } - } - - private: - IdentityProvider id_provider_; - }; - - struct IDREF_Base : public XSCRT::Type - { - virtual XSCRT::Type* - get () const = 0; - }; - - template - class IDREF : public IDREF_Base - { - public: - IDREF () - : id_provider_ (id_) - { - } - - IDREF (XSCRT::XML::Element const& e) - : id_ (e), id_provider_ (id_) - { - } - - IDREF (XSCRT::XML::Attribute const& a) - : id_ (a), id_provider_ (id_) - { - } - - IDREF (IDREF const& x) - : id_ (x.id_), id_provider_ (id_) - { - } - - IDREF (basic_string const& id) - : id_ (id), id_provider_ (id_) - { - } - - IDREF& - operator= (IDREF const& x) - { - id_ = x.id_; - return *this; - } - - IDREF& - operator= (basic_string const& x) - { - id_ = x; - return *this; - } - - public: - XSCRT::Type* - operator-> () const - { - return get (); - } - - XSCRT::Type& - operator* () const - { - return *(get ()); - } - - virtual XSCRT::Type* - get () const - { - if (!id_.empty () && container () != this) - { - return root ()->lookup_id (id_provider_); - } - else - { - return 0; - } - } - - // conversion to bool - // - typedef XSCRT::Type* (IDREF::*bool_convertable)() const; - - operator bool_convertable () const - { - return get () ? &IDREF::operator-> : 0; - } - - private: - NCName id_; - IdentityProvider id_provider_; - }; -} - -// Traversal -// - -#include "ace/XML_Utils/XSCRT/Traversal.hpp" - -namespace XMLSchema -{ - namespace Traversal - { - template - struct Traverser : XSCRT::Traversal::Traverser, - XSCRT::Traversal::Traverser - { - typedef - T - Type; - - virtual void - traverse (XMLSchema::IDREF_Base& r) - { - if (r.get ()) dispatch (*(r.get ())); - } - }; - - typedef Traverser byte; - typedef Traverser unsignedByte; - - typedef Traverser short_; - typedef Traverser unsignedShort; - - typedef Traverser int_; - typedef Traverser unsignedInt; - - typedef Traverser long_; - typedef Traverser unsignedLong; - - typedef Traverser boolean; - - typedef Traverser float_; - typedef Traverser double_; - - template - struct string : Traverser > - { - }; - - template - struct ID : Traverser > - { - }; - } -} - - -// ExtendedTypeInfo for XML Schema types -// - -#include "ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp" - -namespace XMLSchema -{ - template - struct TypeInfoInitializer - { - TypeInfoInitializer (XSCRT::ExtendedTypeInfoMap&); - }; -} - -#include "ace/XML_Utils/XSCRT/XMLSchema.ipp" -#include "ace/XML_Utils/XSCRT/XMLSchema.tpp" - -#endif // XSCRT_XMLSCHEMA_HPP diff --git a/deps/acelite/ace/XML_Utils/XercesString.cpp b/deps/acelite/ace/XML_Utils/XercesString.cpp deleted file mode 100644 index d4fe450e2..000000000 --- a/deps/acelite/ace/XML_Utils/XercesString.cpp +++ /dev/null @@ -1,165 +0,0 @@ -#include -#include - -#include "XercesString.h" -#include "xercesc/util/PlatformUtils.hpp" - -using xercesc::XMLString; -using xercesc::XMLPlatformUtils; - -namespace XML -{ -// On unicode windows, ACE_TCHAR == XMLCh -#if !defined (_MSC_VER) || !defined (ACE_USES_WCHAR) - XStr::XStr (const ACE_TCHAR* str) - : _wstr(0) - { - _wstr = XMLString::transcode(ACE_TEXT_ALWAYS_CHAR (str)); - } -#endif - - XStr::XStr (XMLCh *wstr) - : _wstr(wstr) - { - - } - - XStr::XStr (const XMLCh* wstr) - : _wstr(0) - { - _wstr = XMLString::replicate(wstr); - } - - XStr::XStr (const XStr &right) - : _wstr(0) - { - _wstr = XMLString::replicate(right._wstr); - } - - XStr& XStr::operator= (const XStr& rhs) - { - if (&rhs == this) - return *this; - XStr temp (rhs); - std::swap (this->_wstr, temp._wstr); - return *this; - } - - XStr::~XStr () - { - this->reset (); - } - - const XMLCh* XStr::begin () const - { - return _wstr; - } - - const XMLCh* XStr::end () const - { - return _wstr + size(); - } - - bool XStr::append(const XMLCh *tail) - { - int iTailLen = XMLString::stringLen(tail); - int iWorkLen = XMLString::stringLen(_wstr); - - XMLSize_t bytes = (iWorkLen + iTailLen + 1) * sizeof (XMLCh); - void *tmp = XMLPlatformUtils::fgMemoryManager->allocate (bytes); - XMLCh *result = reinterpret_cast (tmp); - - bool bOK = result != 0; - if (bOK) - { - XMLCh *target = result; - XMLString::moveChars(target, _wstr, iWorkLen); - target += iWorkLen; - XMLString::moveChars(target, tail, iTailLen); - target += iTailLen; - *target++ = 0; - XMLString::release(&_wstr); - _wstr = result; - } - return bOK; - } - - bool XStr::erase(const XMLCh *head, const XMLCh *tail) - { - bool bOK = head <= tail && head >= begin() && tail <= end(); - if (bOK) - { - XMLSize_t bytes = (size() - (tail - head) + 1 ) * sizeof (XMLCh); - void *tmp = XMLPlatformUtils::fgMemoryManager->allocate (bytes); - XMLCh *result = reinterpret_cast (tmp); - - XMLCh *target = result; - bOK = target != 0; - if (bOK) - { - const XMLCh *cursor = begin(); - - while (cursor != head) *target++ = *cursor++; - cursor = tail; - while ( cursor != end() ) *target++ = *cursor++; - *target ++ = 0; - XMLString::release(&_wstr); - _wstr = result; - } - } - return bOK; - } - - int XStr::size () const - { - return XMLString::stringLen(_wstr); - } - - XMLCh XStr::operator [] (const int i) - { - return _wstr[i]; - } - - XMLCh XStr::operator [] (const int i) const - { - return _wstr[i]; - } - - XMLCh * XStr::release (void) - { - XMLCh* tmp = _wstr; - this->_wstr = 0; - return tmp; - } - - void - XStr::reset (void) - { - if (_wstr) - XMLString::release(&_wstr); - _wstr = 0; - } - - bool operator== (const XStr& lhs, const XStr& rhs) - { - return XMLString::compareIString (lhs,rhs) == 0; - } - - bool operator!= (const XStr& lhs, const XStr& rhs) - { - return !operator==(lhs, rhs); - } - - - std::ostream& - operator<< (std::ostream& o, XStr const& str) - { - char* s = XMLString::transcode (str); - - o << s; - - XMLString::release (&s); // idiots? - return o; - } - -} diff --git a/deps/acelite/ace/XML_Utils/XercesString.h b/deps/acelite/ace/XML_Utils/XercesString.h deleted file mode 100644 index 661f4bd05..000000000 --- a/deps/acelite/ace/XML_Utils/XercesString.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef _XERCESSTRING_H -#define _XERCESSTRING_H - -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include - -#ifdef __BORLANDC__ -using std::memcpy; -#endif - -#include - -// Utility class that provides a std::string like facade to XMLString. -// Doesn't implement all of the methods of std::string. -#include "XML_Utils_Export.h" - -namespace XML -{ - class XML_Utils_Export XStr - { - public: - XStr() : _wstr(0L) { }; - -// On unicode windows, ACE_TCHAR == XMLCh -#if !defined (_MSC_VER) || !defined (ACE_USES_WCHAR) - XStr (const ACE_TCHAR* str); -#endif - - XStr (XMLCh* wstr); - - XStr (const XMLCh* wstr); - - XStr (const XStr& copy); - - XStr& operator= (const XStr& rhs); - - ~XStr(); - - const XMLCh* begin() const; - - const XMLCh* end() const; - - bool append(const XMLCh* tail); - - bool erase (const XMLCh* head, const XMLCh* tail); - - int size() const; - - XMLCh operator [] (const int i); - - XMLCh operator [] (const int i) const; - - operator const XMLCh* () const { return _wstr; }; - - XMLCh * release (void); - - /// Release the held string and free its memory. - void reset (void); - private: - - XMLCh* _wstr; // Internal representation - - }; - - XML_Utils_Export bool operator== (const XStr& lhs, const XStr& rhs); - XML_Utils_Export bool operator!= (const XStr& lhs, const XStr& rhs); - - XML_Utils_Export std::ostream& - operator<< (std::ostream& o, XStr const& str); - -} - -#include /**/ "ace/post.h" - -#endif /* _XERCESSTRING_H */ diff --git a/deps/acelite/ace/XTI_ATM_Mcast.h b/deps/acelite/ace/XTI_ATM_Mcast.h index 56ce53446..89f4ee11c 100644 --- a/deps/acelite/ace/XTI_ATM_Mcast.h +++ b/deps/acelite/ace/XTI_ATM_Mcast.h @@ -35,7 +35,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_XTI_ATM_Mcast : public ACE_TLI_Connector { public: - // = Initialization methods. /// Default constructor. ACE_XTI_ATM_Mcast (void); diff --git a/deps/acelite/ace/XtReactor/ACE_XtReactor.pc.in b/deps/acelite/ace/XtReactor/ACE_XtReactor.pc.in deleted file mode 100644 index 118c61c56..000000000 --- a/deps/acelite/ace/XtReactor/ACE_XtReactor.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_XtReactor -Description: ACE XtReactor Library -Requires: ACE -Version: @VERSION@ -Libs: -L${libdir} -lACE_XtReactor -Cflags: -I${includedir} diff --git a/deps/acelite/ace/XtReactor/ACE_XtReactor_export.h b/deps/acelite/ace/XtReactor/ACE_XtReactor_export.h deleted file mode 100644 index 1153d814a..000000000 --- a/deps/acelite/ace/XtReactor/ACE_XtReactor_export.h +++ /dev/null @@ -1,57 +0,0 @@ - -// -*- C++ -*- -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s ACE_XtReactor -// ------------------------------ -#ifndef ACE_XTREACTOR_EXPORT_H -#define ACE_XTREACTOR_EXPORT_H - -#include /**/ "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_XTREACTOR_HAS_DLL) -# define ACE_XTREACTOR_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && ACE_XTREACTOR_HAS_DLL */ - -#if !defined (ACE_XTREACTOR_HAS_DLL) -# define ACE_XTREACTOR_HAS_DLL 1 -#endif /* ! ACE_XTREACTOR_HAS_DLL */ - -#if defined (ACE_XTREACTOR_HAS_DLL) && (ACE_XTREACTOR_HAS_DLL == 1) -# if defined (ACE_XTREACTOR_BUILD_DLL) -# define ACE_XtReactor_Export ACE_Proper_Export_Flag -# define ACE_XTREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_XTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* ACE_XTREACTOR_BUILD_DLL */ -# define ACE_XtReactor_Export ACE_Proper_Import_Flag -# define ACE_XTREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_XTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_XTREACTOR_BUILD_DLL */ -#else /* ACE_XTREACTOR_HAS_DLL == 1 */ -# define ACE_XtReactor_Export -# define ACE_XTREACTOR_SINGLETON_DECLARATION(T) -# define ACE_XTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_XTREACTOR_HAS_DLL == 1 */ - -// Set ACE_XTREACTOR_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (ACE_XTREACTOR_NTRACE) -# if (ACE_NTRACE == 1) -# define ACE_XTREACTOR_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define ACE_XTREACTOR_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !ACE_XTREACTOR_NTRACE */ - -#if (ACE_XTREACTOR_NTRACE == 1) -# define ACE_XTREACTOR_TRACE(X) -#else /* (ACE_XTREACTOR_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define ACE_XTREACTOR_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (ACE_XTREACTOR_NTRACE == 1) */ - -#endif /* ACE_XTREACTOR_EXPORT_H */ - -// End of auto generated file. diff --git a/deps/acelite/ace/XtReactor/XtReactor.cpp b/deps/acelite/ace/XtReactor/XtReactor.cpp deleted file mode 100644 index bf23d31e6..000000000 --- a/deps/acelite/ace/XtReactor/XtReactor.cpp +++ /dev/null @@ -1,466 +0,0 @@ -#include "ace/XtReactor/XtReactor.h" - -#include "ace/SOCK_Acceptor.h" -#include "ace/SOCK_Connector.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE (ACE_XtReactor) - -// Must be called with lock held -ACE_XtReactor::ACE_XtReactor (XtAppContext context, - size_t size, - bool restart, - ACE_Sig_Handler *h) - : ACE_Select_Reactor (size, restart, h), - context_ (context), - ids_ (0), - timeout_ (0) -{ - // When the ACE_Select_Reactor is constructed it creates the notify - // pipe and registers it with the register_handler_i() method. The - // XtReactor overloads this method BUT because the - // register_handler_i occurs when constructing the base class - // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i() - // is called not the XtReactor register_handler_i(). This means - // that the notify pipe is registered with the ACE_Select_Reactor - // event handling code not the XtReactor and so notfications don't - // work. To get around this we simply close and re-opened the - // notification handler in the constructor of the XtReactor. - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - this->notify_handler_->close (); - this->notify_handler_->open (this, 0); -#endif /* ACE_MT_SAFE */ -} - -ACE_XtReactor::~ACE_XtReactor (void) -{ - // Delete the remaining items in the linked list. - - while (this->ids_) - { - ACE_XtReactorID *XtID = this->ids_->next_; - delete this->ids_; - this->ids_ = XtID; - } -} - -// This is just the from ace/Reactor.cpp -// but we use the Xt functions to wait for an event, not to find out which one might be -// available. - -void -ACE_XtReactor::InputCallbackProc (XtPointer closure, - int *source, - XtInputId *) -{ - ACE_XtReactor *self = (ACE_XtReactor *) closure; - ACE_HANDLE handle = (ACE_HANDLE) *source; - - // my copy isn't const. - ACE_Time_Value zero = ACE_Time_Value::zero; - - ACE_Select_Reactor_Handle_Set wait_set; - - // Deal with one file event. - - // - read which kind of event - if (self->wait_set_.rd_mask_.is_set (handle)) - wait_set.rd_mask_.set_bit (handle); - if (self->wait_set_.wr_mask_.is_set (handle)) - wait_set.wr_mask_.set_bit (handle); - if (self->wait_set_.ex_mask_.is_set (handle)) - wait_set.ex_mask_.set_bit (handle); - - int result = ACE_OS::select (*source + 1, - wait_set.rd_mask_, - wait_set.wr_mask_, - wait_set.ex_mask_, &zero); - - ACE_Select_Reactor_Handle_Set dispatch_set; - - // - Use only that one file event (removes events for other files). - if (result > 0) - { - if (wait_set.rd_mask_.is_set (handle)) - dispatch_set.rd_mask_.set_bit (handle); - if (wait_set.wr_mask_.is_set (handle)) - dispatch_set.wr_mask_.set_bit (handle); - if (wait_set.ex_mask_.is_set (handle)) - dispatch_set.ex_mask_.set_bit (handle); - - self->dispatch (1, dispatch_set); - } -} - -int -ACE_XtReactor::XtWaitForMultipleEvents (int width, - ACE_Select_Reactor_Handle_Set &wait_set, - ACE_Time_Value *) -{ - // Make sure we have a valid context - ACE_ASSERT (this->context_ != 0); - - // Check to make sure our handle's are all usable. - ACE_Select_Reactor_Handle_Set temp_set = wait_set; - - if (ACE_OS::select (width, - temp_set.rd_mask_, - temp_set.wr_mask_, - temp_set.ex_mask_, - (ACE_Time_Value *) &ACE_Time_Value::zero) == -1) - return -1; // Bad file arguments... - - // Instead of waiting using . - return ACE_OS::select (width, - wait_set.rd_mask_, - wait_set.wr_mask_, - wait_set.ex_mask_, - (ACE_Time_Value *) &ACE_Time_Value::zero); -} - -XtAppContext -ACE_XtReactor::context (void) const -{ - return this->context_; -} - -void -ACE_XtReactor::context (XtAppContext context) -{ - this->context_ = context; -} - -int -ACE_XtReactor::register_handler_i (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_XtReactor::register_handler_i"); - - // Make sure we have a valid context - ACE_ASSERT (this->context_ != 0); - -#if defined ACE_WIN32 - // Let's handle this special case before we do any real work. - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) - ACE_NOTSUP_RETURN(-1); -#endif /* ACE_WIN32 */ - - int result = ACE_Select_Reactor::register_handler_i (handle, - handler, mask); - if (result == -1) - return -1; - - synchronize_XtInput (handle); - return 0; -} - -int -ACE_XtReactor::register_handler_i (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - return ACE_Select_Reactor::register_handler_i (handles, - handler, - mask); -} - -int -ACE_XtReactor::remove_handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_XtReactor::remove_handler_i"); - - int result = ACE_Select_Reactor::remove_handler_i (handle, - mask); - if (result == -1) - return -1; - - synchronize_XtInput (handle); - return 0; -} - -int -ACE_XtReactor::remove_handler_i (const ACE_Handle_Set &handles, - ACE_Reactor_Mask mask) -{ - return ACE_Select_Reactor::remove_handler_i (handles, - mask); -} - -int -ACE_XtReactor::suspend_i (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_XtReactor::suspend_i"); - - int result = ACE_Select_Reactor::suspend_i (handle); - - if (result == -1) - return -1; - - synchronize_XtInput (handle); - return 0; -} - -int -ACE_XtReactor::resume_i (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_XtReactor::resume_i"); - - int result = ACE_Select_Reactor::resume_i (handle); - - if (result == -1) - return -1; - - synchronize_XtInput (handle); - return 0; -} - -void -ACE_XtReactor::synchronize_XtInput(ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_XtReactor::synchronize_XtInput"); - - // The idea here is to call this function after the base class has - // processed the register/remove/suspend/resume_handler request. The - // resulting mask is used to find out which XtInput mask we need. - - // Find existing handler in linked list. - ACE_XtReactorID **XtID = &(this->ids_); - - while (*XtID && (*XtID)->handle_ != handle) - XtID = &((*XtID)->next_); - - // Remove existing input handler. - if (*XtID) - ::XtRemoveInput ((*XtID)->id_); - - int condition = compute_Xt_condition (handle); - - if (condition == 0) // No input handler needed. - { - if (*XtID) - { - // Remove linked list entry. - ACE_XtReactorID *toDelete = *XtID; - *XtID = (*XtID)->next_; - delete toDelete; - } - return; - } - - if (*XtID == 0) - { - // Create new node. - ACE_XtReactorID *tmp = new ACE_XtReactorID; - tmp->next_ = this->ids_; - tmp->handle_ = handle; - this->ids_ = tmp; - XtID = &(this->ids_); - } - - // Finally, add input handler. - (*XtID)->id_ = ::XtAppAddInput (this->context_, - (int) handle, - reinterpret_cast (condition), - InputCallbackProc, - (XtPointer) this); -} - -int -ACE_XtReactor::compute_Xt_condition(ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_XtReactor::compute_Xt_condition"); - - // Retrieve current wait mask from base class. - // The returned value is either a combination of READ/WRITE/EXCEPT_MASK - // or -1. - int mask =this->bit_ops(handle, - 0, - this->wait_set_, - ACE_Reactor::GET_MASK); - - if (mask == -1) // No active mask. - return 0; - - int condition = 0; - -#if !defined ACE_WIN32 - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) - ACE_SET_BITS (condition, XtInputReadMask); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) - ACE_SET_BITS (condition, XtInputWriteMask); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) - ACE_SET_BITS (condition, XtInputExceptMask); -#else - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) - ACE_SET_BITS (condition, XtInputReadWinsock); - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) - ACE_SET_BITS (condition, XtInputWriteWinsock); - // EXCEPT_MASK is not supported for WIN32. As this was - // already handled in register_handler_i, no check here. -#endif /* !ACE_WIN32 */ - - return condition; -} - -// The following functions ensure that there is an Xt timeout for the -// first timeout in the Reactor's Timer_Queue. - -void -ACE_XtReactor::reset_timeout (void) -{ - // Make sure we have a valid context - ACE_ASSERT (this->context_ != 0); - - if (timeout_) - ::XtRemoveTimeOut (timeout_); - timeout_ = 0; - - ACE_Time_Value *max_wait_time = - this->timer_queue_->calculate_timeout (0); - - if (max_wait_time) - timeout_ = ::XtAppAddTimeOut (this->context_, - max_wait_time->msec (), - TimerCallbackProc, - (XtPointer) this); -} - -int -ACE_XtReactor::reset_timer_interval - (long timer_id, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_XtReactor::reset_timer_interval"); - ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1)); - - int const result = ACE_Select_Reactor::timer_queue_->reset_interval - (timer_id, - interval); - - if (result == -1) - return -1; - else - { - this->reset_timeout (); - return result; - } -} - -long -ACE_XtReactor::schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_XtReactor::schedule_timer"); - ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1)); - - long const result = ACE_Select_Reactor::schedule_timer (event_handler, - arg, - delay, - interval); - if (result == -1) - return -1; - else - { - this->reset_timeout (); - return result; - } -} - -int -ACE_XtReactor::cancel_timer (ACE_Event_Handler *handler, - int dont_call_handle_close) -{ - ACE_TRACE ("ACE_XtReactor::cancel_timer"); - - if (ACE_Select_Reactor::cancel_timer (handler, - dont_call_handle_close) == -1) - return -1; - else - { - this->reset_timeout (); - return 0; - } -} - -int -ACE_XtReactor::cancel_timer (long timer_id, - const void **arg, - int dont_call_handle_close) -{ - ACE_TRACE ("ACE_XtReactor::cancel_timer"); - - if (ACE_Select_Reactor::cancel_timer (timer_id, - arg, - dont_call_handle_close) == -1) - return -1; - else - { - this->reset_timeout (); - return 0; - } -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/deps/acelite/ace/XtReactor/XtReactor.h b/deps/acelite/ace/XtReactor/XtReactor.h deleted file mode 100644 index 8b172fb24..000000000 --- a/deps/acelite/ace/XtReactor/XtReactor.h +++ /dev/null @@ -1,145 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file XtReactor.h - * - * @author Eric C. Newton - * @author Kirill Rybaltchenko - * @author Douglas C. Schmidt - */ -//============================================================================= - - -#ifndef ACE_XTREACTOR_H -#define ACE_XTREACTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/XtReactor/ACE_XtReactor_export.h" -#include "ace/Select_Reactor.h" - -#include /**/ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_XtReactorID - * - * @brief This little class is necessary due to the way that Microsoft - * implements sockets to be pointers rather than indices. - */ -class ACE_XtReactor_Export ACE_XtReactorID -{ -public: - /// Magic cookie. - XtInputId id_; - - /// Underlying handle. - ACE_HANDLE handle_; - - /// Pointer to next node in the linked list. - ACE_XtReactorID *next_; -}; - -/** - * @class ACE_XtReactor - * - * @brief An object-oriented event demultiplexor and event handler - * dispatcher that uses the X Toolkit functions. - */ -class ACE_XtReactor_Export ACE_XtReactor : public ACE_Select_Reactor -{ -public: - // = Initialization and termination methods. - ACE_XtReactor (XtAppContext context = 0, - size_t size = DEFAULT_SIZE, - bool restart = false, - ACE_Sig_Handler * = 0); - virtual ~ACE_XtReactor (void); - - XtAppContext context (void) const; - void context (XtAppContext); - - // = Timer operations. - virtual long schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval); - virtual int reset_timer_interval (long timer_id, - const ACE_Time_Value &interval); - virtual int cancel_timer (ACE_Event_Handler *handler, - int dont_call_handle_close = 1); - - virtual int cancel_timer (long timer_id, - const void **arg = 0, - int dont_call_handle_close = 1); - -protected: - // = Register timers/handles with Xt. - /// Register a single @a handler. - virtual int register_handler_i (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - - /// Register a set of . - virtual int register_handler_i (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - - /// Remove the @a handler associated with this @a handle. - virtual int remove_handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - - /// Remove a set of . - virtual int remove_handler_i (const ACE_Handle_Set &handles, - ACE_Reactor_Mask); - - /// Suspend the associated with @a handle - virtual int suspend_i (ACE_HANDLE handle); - - /// Resume the associated with @a handle - virtual int resume_i (ACE_HANDLE handle); - - /// Synchronize XtInputHandler for @a handle - virtual void synchronize_XtInput(ACE_HANDLE handle); - - /// Compute needed Xt condition by looking at base class wait set. - virtual int compute_Xt_condition(ACE_HANDLE handle); - - /// Wait for events to occur. - virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &, - ACE_Time_Value *); - - ///Wait for Xt events to occur. - virtual int XtWaitForMultipleEvents (int, - ACE_Select_Reactor_Handle_Set &, - ACE_Time_Value *); - - XtAppContext context_; - ACE_XtReactorID *ids_; - XtIntervalId timeout_; - -private: - /// This method ensures there's an Xt timeout for the first timeout - /// in the Reactor's Timer_Queue. - void reset_timeout (void); - - // = Integrate with the X callback function mechanism. - static void TimerCallbackProc (XtPointer closure, XtIntervalId *id); - static void InputCallbackProc (XtPointer closure, int* source, XtInputId *id); - - /// Deny access since member-wise won't work... - ACE_XtReactor (const ACE_XtReactor &); - ACE_XtReactor &operator = (const ACE_XtReactor &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_XTREACTOR_H */ diff --git a/deps/acelite/ace/XtReactor/ace_xtreactor.mpc b/deps/acelite/ace/XtReactor/ace_xtreactor.mpc deleted file mode 100644 index 86466d4a4..000000000 --- a/deps/acelite/ace/XtReactor/ace_xtreactor.mpc +++ /dev/null @@ -1,9 +0,0 @@ -// -*- MPC -*- now wouldn't this be cool... -project(ACE_XtReactor) : acedefaults, install, acelib, ace_output, ace_xt { - sharedname = ACE_XtReactor - dynamicflags += ACE_XTREACTOR_BUILD_DLL - - specific { - install_dir = ace/XtReactor - } -} diff --git a/deps/acelite/ace/ace.mpc b/deps/acelite/ace/ace.mpc index a3fd62989..59d06539c 100644 --- a/deps/acelite/ace/ace.mpc +++ b/deps/acelite/ace/ace.mpc @@ -1,4 +1,4 @@ -// -*- MPC -*- now wouldn't this be cool... +// -*- MPC -*- project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, uuid, filecache, versioned_namespace, pkgconfig, support_ostream { avoids = ace_for_tao sharedname = ACE @@ -92,6 +92,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Lock.cpp Log_Category.cpp Log_Msg.cpp + Log_Msg_Android_Logcat.cpp Log_Msg_Backend.cpp Log_Msg_Callback.cpp Log_Msg_IPC.cpp @@ -120,6 +121,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Message_Queue_Vx.cpp Method_Request.cpp MMAP_Memory_Pool.cpp + MQX_Filesystem.cpp Msg_WFMO_Reactor.cpp Monitor_Admin.cpp Monitor_Admin_Manager.cpp @@ -134,6 +136,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Netlink_Addr.cpp Notification_Strategy.cpp Notification_Queue.cpp + Null_Mutex.cpp Obchunk.cpp Object_Manager.cpp Object_Manager_Base.cpp @@ -143,6 +146,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, OS_main.cpp OS_NS_arpa_inet.cpp OS_NS_ctype.cpp + OS_NS_devctl.cpp OS_NS_dirent.cpp OS_NS_dlfcn.cpp OS_NS_errno.cpp @@ -298,6 +302,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Auto_IncDec_T.cpp Auto_Ptr.cpp Based_Pointer_T.cpp + Bound_Ptr.cpp Cache_Map_Manager_T.cpp Cached_Connect_Strategy_T.cpp Caching_Strategies_T.cpp @@ -464,7 +469,6 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Version.h Versioned_Namespace.h ace_wchar.h - ace_wchar.inl checked_iterator.h config-*.h config.h @@ -478,7 +482,6 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Documentation_Files { README - ../VERSION } Pkgconfig_Files { @@ -494,6 +497,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, ../bin/add_rel_link.sh ../bin/depgen.pl ../bin/ace_install_pkgconfig.pl + ../bin/generate_export_file.pl } InstallData_Files { gendir = include @@ -502,7 +506,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, InstallData_Files { gendir = . ../README - ../VERSION + ../VERSION.txt ../PROBLEM-REPORT-FORM ../NEWS ../COPYING diff --git a/deps/acelite/ace/ace_for_tao.mpc b/deps/acelite/ace/ace_for_tao.mpc index 648049892..629b5c9d1 100644 --- a/deps/acelite/ace/ace_for_tao.mpc +++ b/deps/acelite/ace/ace_for_tao.mpc @@ -91,9 +91,11 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace, Monitor_Control_Types.cpp Monitor_Control_Action.cpp Monotonic_Time_Policy.cpp + MQX_Filesystem.cpp Mutex.cpp Notification_Strategy.cpp Notification_Queue.cpp + Null_Mutex.cpp Obchunk.cpp Object_Manager.cpp Object_Manager_Base.cpp @@ -327,6 +329,7 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace, Mem_Map.h Min_Max.h Monotonic_Time_Policy.h + MQX_Filesystem.h Null_Barrier.h Null_Condition.h Null_Mutex.h @@ -384,7 +387,7 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace, Documentation_Files { README - ../VERSION + ../VERSION.txt } Pkgconfig_Files { diff --git a/deps/acelite/ace/ace_wchar.cpp b/deps/acelite/ace/ace_wchar.cpp index f969c7885..7e33b1317 100644 --- a/deps/acelite/ace/ace_wchar.cpp +++ b/deps/acelite/ace/ace_wchar.cpp @@ -1,12 +1,7 @@ // -*- C++ -*- -// -// $Id: ace_wchar.cpp 91286 2010-08-05 09:04:31Z johnnyw $ - #include "ace/config-macros.h" #include "ace/ace_wchar.h" - - ACE_BEGIN_VERSIONED_NAMESPACE_DECL #if defined(ACE_HAS_ICONV) diff --git a/deps/acelite/ace/ace_wchar.h b/deps/acelite/ace/ace_wchar.h index ff884231b..7afc67332 100644 --- a/deps/acelite/ace/ace_wchar.h +++ b/deps/acelite/ace/ace_wchar.h @@ -4,8 +4,6 @@ /** * @file ace_wchar.h * - * $Id: ace_wchar.h 93597 2011-03-21 12:54:52Z johnnyw $ - * * @author Darrell Brunsch */ //============================================================================= @@ -230,6 +228,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL #define ACE_TEXT_CreateFileMapping ::CreateFileMappingW #define ACE_TEXT_CreateMutex ::CreateMutexW #define ACE_TEXT_CreateProcess ::CreateProcessW +#define ACE_TEXT_CreateProcessAsUser ::CreateProcessAsUserW #define ACE_TEXT_CreateSemaphore ::CreateSemaphoreW #define ACE_TEXT_CreateService ::CreateServiceW #define ACE_TEXT_ExpandEnvironmentStrings ::ExpandEnvironmentStringsW @@ -275,6 +274,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL #define ACE_TEXT_PdhExpandCounterPath ::PdhExpandCounterPathW #define ACE_TEXT_PdhOpenQuery ::PdhOpenQueryW #define ACE_TEXT_PdhAddCounter ::PdhAddCounterW +#define ACE_TEXT_gai_strerror ::gai_strerrorW #else /* ACE_USES_WCHAR */ #define ACE_LPSTR LPSTR @@ -289,6 +289,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL #define ACE_TEXT_CreateFileMapping ::CreateFileMappingA #define ACE_TEXT_CreateMutex ::CreateMutexA #define ACE_TEXT_CreateProcess ::CreateProcessA +#define ACE_TEXT_CreateProcessAsUser ::CreateProcessAsUserA #define ACE_TEXT_CreateSemaphore ::CreateSemaphoreA #define ACE_TEXT_CreateService ::CreateServiceA #define ACE_TEXT_ExpandEnvironmentStrings ::ExpandEnvironmentStringsA @@ -334,6 +335,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL #define ACE_TEXT_PdhExpandCounterPath ::PdhExpandCounterPathA #define ACE_TEXT_PdhOpenQuery ::PdhOpenQueryA #define ACE_TEXT_PdhAddCounter ::PdhAddCounterA +#define ACE_TEXT_gai_strerror ::gai_strerrorA #endif /* ACE_USES_WCHAR */ #endif /* ACE_WIN32 */ diff --git a/deps/acelite/ace/ace_wchar.inl b/deps/acelite/ace/ace_wchar.inl index 744b44f5e..438d6672d 100644 --- a/deps/acelite/ace/ace_wchar.inl +++ b/deps/acelite/ace/ace_wchar.inl @@ -1,7 +1,4 @@ // -*- C++ -*- -// -// $Id: ace_wchar.inl 80826 2008-03-04 14:51:23Z wotte $ - // These are always inlined // FUZZ: disable check_for_inline @@ -47,7 +44,7 @@ ACE_Wide_To_Ascii::convert (const wchar_t *wstr) while ((*wtemp) != 0) // Hopefully the string is null terminated! ++wtemp; - int const len = wtemp - wstr + 1; + size_t const len = wtemp - wstr + 1; # else /* ACE_WIN32 */ size_t const len = ::wcslen (wstr) + 1; # endif /* ACE_WIN32 */ diff --git a/deps/acelite/ace/config-aix-5.x.h b/deps/acelite/ace/config-aix-5.x.h index cfa2786f7..5969745ee 100644 --- a/deps/acelite/ace/config-aix-5.x.h +++ b/deps/acelite/ace/config-aix-5.x.h @@ -321,5 +321,16 @@ #define ACE_LACKS_ISCTYPE #define ACE_HAS_STRSIGNAL #define ACE_NEEDS_STRSIGNAL_RANGE_CHECK +#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN + + +#if defined (ACE_AIX_VERS) && (ACE_AIX_VERS < 503) +# define ACE_LACKS_UNSETENV +# define ACE_LACKS_LOG2 +# define ACE_LACKS_PTHREAD_ATTR_SETSTACK +#endif /* ACE_AIX_VERS < 503 */ + +#define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld" +#define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" #endif /* ACE_CONFIG_AIX_5_X_H */ diff --git a/deps/acelite/ace/config-all.h b/deps/acelite/ace/config-all.h index b6e8a0329..06d8eeb2b 100644 --- a/deps/acelite/ace/config-all.h +++ b/deps/acelite/ace/config-all.h @@ -4,7 +4,7 @@ /** * @file config-all.h * - * @author (Originally in OS.h)Doug Schmidt + * @author (Originally in OS.h)Doug Schmidt * @author Jesper S. M|ller * @author and a cast of thousands... */ diff --git a/deps/acelite/ace/config-android.h b/deps/acelite/ace/config-android.h index 6808ed669..d3d89f39d 100644 --- a/deps/acelite/ace/config-android.h +++ b/deps/acelite/ace/config-android.h @@ -1,11 +1,15 @@ // -*- C++ -*- -// The following configuration file is designed to work for Android -// platforms using GNU C++. +// Config Header file for Android NDK #ifndef ACE_CONFIG_ANDROID_H #define ACE_CONFIG_ANDROID_H #include /**/ "ace/pre.h" +// NOTE: We must be careful from now on to distinguish between the API level +// and NDK version. +// There is a large number of combinations of these two that can lead to +// problems. + // Location of the __ANDROID_API__ define // #include $NDK_ROOT/sysroot/usr/include/android/api-level.h #include "android/api-level.h" @@ -15,12 +19,130 @@ #endif #define ACE_ANDROID +#define ACE_PLATFORM_CONFIG config-android.h -#define ACE_HAS_SSIZE_T +#include "ace/config-linux-common.h" + +/* + * Android NDK Revision Macros + * + * Revsions Scheme Work Like This: + * Revision | __NDK_MAJOR__ | __NDK_MINOR__ + * r16 | 16 | 0 + * r16b | 16 | 1 + * r16c | 16 | 2 + * + * After r16, NDK version macros are defined in android/ndk-version.h Before + * that they must be defined in platform_macros.GNU before the include of + * platform_android.GNU. + */ +#define ACE_ANDROID_NDK_AT_LEAST(MAJ, MIN) \ + (__NDK_MAJOR__ > (MAJ) || (__NDK_MAJOR__ == (MAJ) && __NDK_MINOR__ >= (MIN))) + +#define ACE_ANDROID_NDK_EXACTLY(MAJ, MIN) \ + (__NDK_MAJOR__ == (MAJ) && __NDK_MINOR__ == (MIN)) + +#define ACE_ANDROID_NDK_LESS_THAN(MAJ, MIN) \ + (__NDK_MAJOR__ < (MAJ) || (__NDK_MAJOR__ == (MAJ) && __NDK_MINOR__ < (MIN))) + +#ifdef ACE_ANDROID_NDK_HAS_NDK_VERSION_H +# include "android/ndk-version.h" +#else +# ifndef __NDK_MAJOR__ +# error ndk-version.h is missing, __NDK_MAJOR__ for Android NDK must be defined! +# endif +# ifndef __NDK_MINOR__ +# error ndk-version.h is missing, __NDK_MINOR__ for Android NDK must be defined! +# endif +#endif + +// ucontext.h and clock_settime() were added in r10c +#if ACE_ANDROID_NDK_AT_LEAST(10, 2) +# define ACE_HAS_UCONTEXT_T +# define ACE_HAS_CLOCK_SETTIME +#else +# define ACE_LACKS_UCONTEXT_H +#endif + +// NDK has these by r12b +#if ACE_ANDROID_NDK_LESS_THAN(12, 1) +# define ACE_LACKS_GETHOSTENT +# define ACE_LACKS_LOCALECONV +# define ACE_LACKS_WCHAR_STD_NAMESPACE +// Used in tests/Sequence_Unit_Tests/string_sequence_tester.hpp +# define TAO_LACKS_WCHAR_CXX_STDLIB +#endif + +#if ACE_ANDROID_NDK_LESS_THAN(12, 1) || __ANDROID_API__ < 18 +# define ACE_LACKS_LOG2 +#endif + +#if ACE_ANDROID_NDK_LESS_THAN(12, 1) || __ANDROID_API__ < 21 +# define ACE_LACKS_SEARCH_H +# define ACE_LACKS_SYS_SEM_H +# define ACE_LACKS_SEMBUF_T +# define ACE_LACKS_SYS_MSG_H +# define ACE_LACKS_SYS_SHM_H +# define ACE_LACKS_SYSV_SHMEM +#else +# define ACE_HAS_SEMUN +#endif + +#if ACE_ANDROID_NDK_LESS_THAN(15, 0) && __ANDROID_API__ < 21 +// NOTE: The && is correct, SYS_GETTID is present in API 16 in r15 onwards +# ifdef ACE_HAS_GETTID +# undef ACE_HAS_GETTID +# endif +#endif + +// NDK has telldir() and seekdir() by 15c +#if ACE_ANDROID_NDK_LESS_THAN(15, 2) || __ANDROID_API__ < 23 +# define ACE_LACKS_TELLDIR +# define ACE_LACKS_SEEKDIR +#endif + +// strbuf was added by r16 +#if ACE_ANDROID_NDK_LESS_THAN(16, 0) +# ifdef ACE_HAS_STRBUF_T +# undef ACE_HAS_STRBUF_T +# endif +#endif + +// fd_mask was added in r17c +#if ACE_ANDROID_NDK_LESS_THAN(17, 2) +# define ACE_LACKS_FD_MASK +#endif + +#if __ANDROID_API__ < 21 +# define ACE_LACKS_RAND_R +# define ACE_LACKS_WCSTOLL +# define ACE_LACKS_WCSTOULL +# define ACE_LACKS_CONDATTR_SETCLOCK +# ifdef ACE_HAS_EVENT_POLL +# undef ACE_HAS_EVENT_POLL +# endif +#endif + +#if ACE_ANDROID_NDK_LESS_THAN(15, 0) +# define ACE_LACKS_STRUCT_IF_NAMEINDEX +#endif + +#if ACE_ANDROID_NDK_LESS_THAN(15, 0) || __ANDROID_API__ < 24 +# define ACE_LACKS_IF_NAMEINDEX +#endif + +// These were available before r18, but in r18 they are restricted to API >= 28 ¯\_(ツ)_/¯ +#if __ANDROID_API__ < 28 +# define ACE_LACKS_SETHOSTENT +# define ACE_LACKS_ENDHOSTENT +#endif + +#if !defined(ACE_HAS_GLIBC_2_2_3) && (ACE_ANDROID_NDK_AT_LEAST(15, 0) || __ANDROID_API__ >= 21) +# define ACE_HAS_CPU_SET_T +#endif // system errorno is a volatile int #define ACE_HAS_VOLATILE_ERRNO - #define ACE_ERRNO_TYPE volatile int // Android doesn't check is sig is out of range. @@ -38,35 +160,18 @@ #define ACE_USES_ULONG_FOR_STAT_TIME #define ACE_LACKS_NEW_H -#define ACE_LACKS_SEARCH_H #define ACE_LACKS_SIGINFO_H #define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYS_SHM_H #define ACE_LACKS_SYS_SYSCTL_H -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_CUSERID -#define ACE_LACKS_FD_MASK -#define ACE_LACKS_GETHOSTENT #define ACE_LACKS_GETLOADAVG #define ACE_LACKS_ISCTYPE -#define ACE_LACKS_LOG2 #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS #define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_PTHREAD_CANCEL -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SETINHERITSCHED #define ACE_LACKS_STRRECVFD +#define ACE_LACKS_PTHREAD_CANCEL // posix_limits.h explicitly says this +#define ACE_LACKS_SETINHERITSCHED // posix_limits.h explicitly says this #define ACE_LACKS_SWAB -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_WCSTOLL -#define ACE_LACKS_WCSTOULL - -#define ACE_LACKS_RAND_R // Android seems to have 64 keys of which Android itself use 5 #define ACE_DEFAULT_THREAD_KEYS 59 @@ -76,19 +181,6 @@ // Used in tests/Sequence_Unit_Tests/string_sequence_tester.hpp # define TAO_LACKS_WCHAR_CXX_STDLIB -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -#define ACE_PLATFORM_CONFIG config-android.h - -// Needed to differentiate between libc 5 and libc 6 (aka glibc). -#include - -#define ACE_HAS_PTHREADS_UNIX98_EXT - -#include "ace/config-posix.h" - // @todo JW, test if this works // #define ACE_HAS_POSIX_SEM // #define ACE_HAS_POSIX_SEM_TIMEOUT @@ -101,255 +193,17 @@ # undef ACE_HAS_AIO_CALLS #endif -// First the machine specific part -#if defined (__powerpc__) || defined (__x86_64__) -# if !defined (ACE_DEFAULT_BASE_ADDR) -# define ACE_DEFAULT_BASE_ADDR ((char *) 0x40000000) -# endif /* ! ACE_DEFAULT_BASE_ADDR */ -#endif /* ! __powerpc__ && ! __ia64 */ - #define ACE_HAS_SIGINFO_T #define ACE_HAS_SOCKLEN_T #define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_LSEEK64 -//#define ACE_LACKS_LSEEK64_PROTOTYPE - -#define ACE_HAS_P_READ_WRITE -// Use ACE's alternate cuserid() implementation since the use of the -// system cuserid() is discouraged. -#define ACE_HAS_ALT_CUSERID - -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) -# define ACE_HAS_ISASTREAM_PROTOTYPE -# define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE -# define ACE_HAS_CPU_SET_T -#endif /* __GLIBC__ > 2 || __GLIBC__ === 2 && __GLIBC_MINOR__ >= 3) */ - -// Then the compiler specific parts - -#if defined (__GNUG__) - // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so - // this must appear before its #include. -# define ACE_HAS_STRING_CLASS -# include "ace/config-g++-common.h" - -# define ACE_HAS_CUSTOM_EXPORT_MACROS -# define ACE_Proper_Export_Flag -# define ACE_IMPORT_SINGLETON_DECLARATION(T) __extension__ extern template class T -# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class SINGLETON_TYPE; -# define ACE_HAS_EXPLICIT_TEMPLATE_CLASS_INSTANTIATION - -#elif defined (__GNUC__) -/** - * GNU C compiler. - * - * We need to recognize the GNU C compiler since TAO has at least one - * C source header and file - * (TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.{h,c}) that may indirectly - * include this - */ -#else /* ! __GNUG__ && !__DECCXX && !__INTEL_COMPILER && && !__PGI */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler in ace/config-android.h -# endif /* __cplusplus */ -#endif /* ! __GNUG__*/ - -// Completely common part :-) - -// Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -#define ACE_HAS_SIGSUSPEND - -#define ACE_HAS_STRSIGNAL - -#ifndef ACE_HAS_POSIX_REALTIME_SIGNALS -# define ACE_HAS_POSIX_REALTIME_SIGNALS -#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ - -#define ACE_HAS_XPG4_MULTIBYTE_CHAR -#define ACE_HAS_VFWPRINTF - -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_ISWASCII - -#define ACE_HAS_3_PARAM_WCSTOK - -#define ACE_HAS_3_PARAM_READDIR_R - -#if !defined (ACE_DEFAULT_BASE_ADDR) -# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) -#endif /* ! ACE_DEFAULT_BASE_ADDR */ - -#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H -#define ACE_HAS_SYS_SYSINFO_H -#define ACE_HAS_LINUX_SYSINFO - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE -#define ACE_HAS_GETRUSAGE_PROTOTYPE - -#define ACE_HAS_BYTESWAP_H -#define ACE_HAS_BSWAP_16 -#define ACE_HAS_BSWAP_32 -#define ACE_HAS_BSWAP_64 - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// ONLY define this if you have config'd multicast into a 2.0.34 or -// prior kernel. It is enabled by default in 2.0.35 kernels. -#if !defined (ACE_HAS_IP_MULTICAST) -# define ACE_HAS_IP_MULTICAST -#endif /* ! ACE_HAS_IP_MULTICAST */ - -// At least for IPv4, Linux lacks perfect filtering. -#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ - -#define ACE_HAS_BIG_FD_SET - -// Linux defines struct msghdr in /usr/include/socket.h -#define ACE_HAS_MSG - -// Linux "improved" the interface to select() so that it modifies -// the struct timeval to reflect the amount of time not slept -// (see NOTES in Linux's select(2) man page). -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 65535 - -#define ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE 1 - -#define ACE_HAS_GETPAGESIZE 1 - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -// Platform supplies scandir() -#define ACE_HAS_SCANDIR +#define ACE_LACKS_CUSERID #define ACE_MMAP_NO_ZERO -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -#define ACE_HAS_POSIX_TIME - -#define ACE_HAS_GPERF - -#define ACE_HAS_DIRENT - -// Starting with FC9 rawhide this file is not available anymore but -// this define is set -#if defined _XOPEN_STREAMS && _XOPEN_STREAMS == -1 -# define ACE_LACKS_STROPTS_H -# define ACE_LACKS_STRRECVFD -#endif - -#if !defined (ACE_LACKS_STROPTS_H) -# define ACE_HAS_STRBUF_T -#endif - -#if defined (__ia64) || defined(__alpha) || defined (__x86_64__) || defined(__powerpc64__) -// On 64 bit platforms, the "long" type is 64-bits. Override the -// default 32-bit platform-specific format specifiers appropriately. -# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%lu" -# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld" -# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" -#endif /* __ia64 */ - -#define ACE_SIZEOF_WCHAR 4 - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// Linux implements sendfile(). -#define ACE_HAS_SENDFILE 1 - -#define ACE_HAS_VOIDPTR_MMAP - -#define ACE_HAS_VASPRINTF - -#define ACE_LACKS_PTHREAD_SCOPE_PROCESS - -// According to man pages Linux uses different (compared to UNIX systems) types -// for setting IP_MULTICAST_TTL and IPV6_MULTICAST_LOOP / IP_MULTICAST_LOOP -// in setsockopt/getsockopt. -#define ACE_HAS_IP_MULTICAST_TTL_AS_INT 1 -#define ACE_HAS_IPV6_MULTICAST_LOOP_AS_BOOL 1 -#define ACE_HAS_IP_MULTICAST_LOOP_AS_INT 1 - #define ACE_HAS_NETLINK #define ACE_HAS_SIOCGIFCONF -#if !defined (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO) -// Detect if getsockname() and getpeername() returns random values in -// the sockaddr_in::sin_zero field by evaluation of the kernel -// version. Since version 2.5.47 this problem is fixed. -# if !defined (ACE_LACKS_LINUX_VERSION_H) -# include -# endif /* !ACE_LACKS_LINUX_VERSION_H */ -# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,47)) -# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 0 -# else -# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 1 -# endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,47)) */ -#endif /* ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO */ - -#if !defined (ACE_HAS_EVENT_POLL) && !defined (ACE_HAS_DEV_POLL) -# if !defined (ACE_LACKS_LINUX_VERSION_H) -# include -# endif /* !ACE_LACKS_LINUX_VERSION_H */ -#endif - -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE -#define ACE_HAS_RECURSIVE_MUTEXES -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#define ACE_HAS_REENTRANT_FUNCTIONS - -#if __ANDROID_API__ >= 9 -# define ACE_HAS_TIMEZONE -#endif - -#if __ANDROID_API__ < 14 -# define ACE_LACKS_STD_WSTRING -# define ACE_LACKS_GETIPNODEBYADDR -# define ACE_LACKS_GETIPNODEBYNAME -#endif - -#if __ANDROID_API__ == 3 -# error Unsupported Android release 3 -#elif __ANDROID_API__ == 8 -# define ACE_LACKS_REGEX_H 1 -# define ACE_LACKS_CONDATTR 1 -#elif __ANDROID_API__ == 9 -#elif __ANDROID_API__ == 14 -#else -# error Unsupported Android release -#endif - #if !defined ACE_DEFAULT_TEMP_DIR # define ACE_DEFAULT_TEMP_DIR "/data/tmp" #endif @@ -358,6 +212,8 @@ # define TEST_DIR "/data" #endif +#define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE + #if !defined (ACE_AS_STATIC_LIBS) # if (__GNUC__ == 4 && __GNUC_MINOR__ == 4) # error Shared library support is not possible with GCC 4.4.x @@ -398,6 +254,10 @@ # undef _B #endif +// Disable newer features, result in runtime failures on Android +#define ACE_LACKS_GETADDRINFO +#define ACE_LACKS_GETNAMEINFO + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_ANDROID_H */ diff --git a/deps/acelite/ace/config-cygwin32.h b/deps/acelite/ace/config-cygwin32.h index 892707740..fd1b067ea 100644 --- a/deps/acelite/ace/config-cygwin32.h +++ b/deps/acelite/ace/config-cygwin32.h @@ -43,6 +43,21 @@ #include /**/ +#if CYGWIN_VERSION_API_MINOR >= 338 +// Code #defines added to support the latest (as of 6/2019) version of Cygwin +#define ACE_HAS_UCONTEXT_T 1 +#define ACE_LACKS_CUSERID 1 +#define ACE_HAS_WCHAR +#define ACE_DISABLE_MKTEMP +#define ACE_HAS_3_PARAM_WCSTOK +#define ACE_LACKS_WCSICMP +#define ACE_LACKS_WCSNICMP +#define ACE_LACKS_STRPTIME +#define ACE_LACKS_SWAB +#define ACE_LACKS_STD_WSTRING + +#endif + // Needed to differentiate between libc 5 and libc 6 (aka glibc). // It's there on all libc 5 systems I checked. #include /**/ diff --git a/deps/acelite/ace/config-face-conftest.h b/deps/acelite/ace/config-face-conftest.h new file mode 100644 index 000000000..4cf74e113 --- /dev/null +++ b/deps/acelite/ace/config-face-conftest.h @@ -0,0 +1,93 @@ +// ACE configuration for building on top of the FACE Conformance Test Suite's +// safety base replacement headers for libc and libstdc++. + +#ifndef ACE_MT_SAFE +#define ACE_MT_SAFE 1 +#endif + +#define ACE_EMULATE_POSIX_DEVCTL 0 +#define ACE_HOSTENT_H_ADDR h_addr_list[0] +#define ACE_PAGE_SIZE 4096 +#define ACE_SIZEOF_FLOAT 4 +#define ACE_SIZEOF_DOUBLE 8 +#define ACE_SIZEOF_LONG_DOUBLE 16 +#define ACE_SIZEOF_LONG 8 +#define ACE_SIZEOF_LONG_LONG 8 +#define ACE_THREAD_T_IS_A_STRUCT +#define ACE_DEFAULT_SEM_KEY {} + +#define ACE_HAS_3_PARAM_READDIR_R +#define ACE_HAS_CLOCK_GETTIME +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES +#define ACE_HAS_DIRENT +#define ACE_HAS_IPPORT_RESERVED +#define ACE_HAS_MSG +#define ACE_HAS_POSIX_TIME +#define ACE_HAS_POSIX_NONBLOCK +#define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE +#define ACE_HAS_PTHREADS +#define ACE_HAS_OPAQUE_PTHREAD_T +#define ACE_HAS_REENTRANT_FUNCTIONS +#define ACE_HAS_SIGINFO_T +#define ACE_HAS_SIGWAIT +#define ACE_HAS_STRBUF_T +#define ACE_HAS_STRERROR_R +#define ACE_HAS_STRERROR_R_XSI +#define ACE_HAS_THREAD_SPECIFIC_STORAGE +#define ACE_HAS_THREADS 1 +#define ACE_HAS_UCONTEXT_T + +#define ACE_LACKS_BSD_TYPES +#define ACE_LACKS_CADDR_T +#define ACE_LACKS_IFCONF +#define ACE_LACKS_IFREQ +#define ACE_LACKS_IP_MREQ +#define ACE_LACKS_ISCTYPE +#define ACE_LACKS_MEMORY_H +#define ACE_LACKS_SELECT // safetyBase headers are missing select() +#define ACE_LACKS_SETENV +#define ACE_LACKS_SIGINFO_H +#define ACE_LACKS_SYS_IOCTL_H +#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_SYS_SYSCTL_H +#define ACE_LACKS_TIMESPEC_T +#define ACE_LACKS_UCONTEXT_H +#define ACE_LACKS_UNSETENV +#define ACE_LACKS_USECONDS_T + +#define ACE_HAS_NEW_THROW_SPEC + +#ifndef stdin +# define stdin 0 +#endif + +#ifndef stderr +# define stderr 0 +#endif + +#ifndef stdout +# define stdout 0 +#endif + +#define NSIG 32 + +#define NFDBITS 64 +#define FD_ZERO(x) +#define FD_SET(x, y) +#define FD_CLR(x, y) +#define FD_ISSET(x ,y) 0 +#define ACE_FDS_BITS __0 +typedef long fd_mask; + +#define FIONBIO 0x5421 + +typedef unsigned long uintptr_t; + +#define __FACE_CONFORM____PTRDIFF_T__ +typedef long ptrdiff_t; + +#define __FACE_CONFORM____INTPTR_T__ +typedef long intptr_t; + +#include "ace/config-posix.h" +#include "ace/config-g++-common.h" diff --git a/deps/acelite/ace/config-face-safety.h b/deps/acelite/ace/config-face-safety.h new file mode 100644 index 000000000..b06fed1e5 --- /dev/null +++ b/deps/acelite/ace/config-face-safety.h @@ -0,0 +1,717 @@ +// Specialized configuration for FACE Safety Profiles +// See http://www.opengroup.org/face for more info about the Future Airborne +// Capability Environment + +// Using this header: +// In ace/config.h, #define ACE_FACE_SAFETY_BASE or ACE_FACE_SAFETY_EXTENDED +// Optionally #define ACE_FACE_DEV +// ACE_FACE_DEV is a development mode setting which produces an ACE library +// that allows debug logging (doesn't enforce ACE_NDEBUG) and ACE_OS::getenv(). + +// Maintaining this header: +// This version of the header is written for FACE technical standard 2.1. +// See Appendix A for a chart of POSIX calls that are excluded from the +// various profiles. +// The top half of this file is only included if the user enables Safety Base, +// so these are exclusions that apply to Base but not to Extended. +// The bottom half is included for either profile, so it contains restrictions +// that are common to both Based and Extended. +// Keep macro definitions in sorted order. Macros set by this file that are +// also set by some platform-specific config-*.h are "protected" from double +// definition by this construct: +//# ifndef ACE_LACKS_X +//# define ACE_LACKS_X +//# endif +// Macros that are undefined in this file are similarly guarded: +//# ifdef ACE_HAS_X +//# undef ACE_HAS_X +//# endif + +#ifdef ACE_FACE_SAFETY_BASE + +# ifndef ACE_FACE_SAFETY_EXTENDED +# define ACE_FACE_SAFETY_EXTENDED +# endif + +# ifndef ACE_HAS_ALLOC_HOOKS +# define ACE_HAS_ALLOC_HOOKS +# endif + +// Due to ACE_LACKS_PTHREAD_KEY_DELETE, ACE must explicitly clear out TSS +// when keyfree would have normally occurred. This prevents the system's +// TSS destructors running later, which could be after libACE unloading. +# ifndef ACE_HAS_BROKEN_THREAD_KEYFREE +# define ACE_HAS_BROKEN_THREAD_KEYFREE +# endif + +# ifndef ACE_HAS_REACTOR_NOTIFICATION_QUEUE +# define ACE_HAS_REACTOR_NOTIFICATION_QUEUE +# endif + +// TSS emulation required with ACE_LACKS_PTHREAD_JOIN +# ifndef ACE_HAS_TSS_EMULATION +# define ACE_HAS_TSS_EMULATION +# endif + +# define ACE_LACKS_ABORT +# define ACE_LACKS_EXIT +# define ACE_LACKS__EXIT +# define ACE_LACKS_FREE +# define ACE_LACKS_PTHREAD_EXIT +# define ACE_LACKS_PTHREAD_JOIN +# define ACE_LACKS_PTHREAD_KEY_DELETE +# define ACE_LACKS_PTHREAD_MUTEX_DESTROY +# define ACE_LACKS_REALLOC +# define ACE_LACKS_SEM_DESTROY +# define ACE_LACKS_SEM_UNLINK +# define ACE_LACKS_SETPID +# define ACE_LACKS_SLEEP +# define ACE_LACKS_SSCANF +# define ACE_LACKS_VA_FUNCTIONS +# define ACE_LACKS_VFPRINTF + +# ifndef ACE_LACKS_ACCEPT +# define ACE_LACKS_ACCEPT +# endif + +# ifndef ACE_LACKS_BSEARCH +# define ACE_LACKS_BSEARCH +# endif + +# ifndef ACE_LACKS_DUP2 +# define ACE_LACKS_DUP2 +# endif + +# ifndef ACE_LACKS_EXEC +# define ACE_LACKS_EXEC +# endif + +# ifndef ACE_LACKS_FCNTL +# define ACE_LACKS_FCNTL +# endif + +# ifndef ACE_LACKS_FORK +# define ACE_LACKS_FORK +# endif + +# ifndef ACE_LACKS_GETEGID +# define ACE_LACKS_GETEGID +# endif + +# if !defined ACE_LACKS_GETENV && !defined ACE_FACE_DEV +# define ACE_LACKS_GETENV +# endif + +# ifndef ACE_LACKS_GETEUID +# define ACE_LACKS_GETEUID +# endif + +# ifndef ACE_LACKS_GETGID +# define ACE_LACKS_GETGID +# endif + +# ifndef ACE_LACKS_GETPID +# define ACE_LACKS_GETPID +# endif + +# ifndef ACE_LACKS_GETPPID +# define ACE_LACKS_GETPPID +# endif + +# ifndef ACE_LACKS_GETUID +# define ACE_LACKS_GETUID +# endif + +# ifndef ACE_LACKS_KILL +# define ACE_LACKS_KILL +# endif + +# ifndef ACE_LACKS_LISTEN +# define ACE_LACKS_LISTEN +# endif + +# ifndef ACE_LACKS_LSTAT +# define ACE_LACKS_LSTAT +# endif + +# ifndef ACE_LACKS_MKFIFO +# define ACE_LACKS_MKFIFO +# endif + +# ifndef ACE_LACKS_PIPE +# define ACE_LACKS_PIPE +# endif + +# ifndef ACE_LACKS_PTHREAD_KILL +# define ACE_LACKS_PTHREAD_KILL +# endif + +# ifndef ACE_LACKS_PTHREAD_CANCEL +# define ACE_LACKS_PTHREAD_CANCEL +# endif + +# ifndef ACE_LACKS_PTHREAD_CLEANUP +# define ACE_LACKS_PTHREAD_CLEANUP +# endif + +# ifndef ACE_LACKS_RAISE +# define ACE_LACKS_RAISE +# endif + +# ifndef ACE_LACKS_SETDETACH +# define ACE_LACKS_SETDETACH +# endif + +# ifndef ACE_LACKS_SETEGID +# define ACE_LACKS_SETEGID +# endif + +# ifndef ACE_LACKS_SETEUID +# define ACE_LACKS_SETEUID +# endif + +# ifndef ACE_LACKS_SETGID +# define ACE_LACKS_SETGID +# endif + +# ifndef ACE_LACKS_SETSCHED +# define ACE_LACKS_SETSCHED +# endif + +# ifndef ACE_LACKS_SETUID +# define ACE_LACKS_SETUID +# endif + +# ifndef ACE_LACKS_STRFTIME +# define ACE_LACKS_STRFTIME +# endif + +# ifndef ACE_LACKS_STRTOLL +# define ACE_LACKS_STRTOLL +# endif + +# ifndef ACE_LACKS_SYSCONF +# define ACE_LACKS_SYSCONF +# endif + +# ifndef ACE_LACKS_UNAME +# define ACE_LACKS_UNAME +# endif + +# ifndef ACE_LACKS_VSNPRINTF +# define ACE_LACKS_VSNPRINTF +# endif + +# ifndef ACE_LACKS_WAITPID +# define ACE_LACKS_WAITPID +# endif + +# if !defined ACE_FACE_DEV && !defined ACE_NDEBUG +# define ACE_NDEBUG +# endif + +# define ACE_STDIO_USE_STDLIB_FOR_VARARGS + +#endif // ACE_FACE_SAFETY_BASE + +#ifdef ACE_FACE_SAFETY_EXTENDED + +# if defined ACE_WIN32 || defined ACE_HAS_WINCE +# error "FACE Safety profile not compatible with win32 or winCE" +# endif + +# ifndef ACE_EMULATE_POSIX_DEVCTL +# define ACE_EMULATE_POSIX_DEVCTL 1 +# endif + +# ifdef ACE_HAS_AIO_CALLS +# undef ACE_HAS_AIO_CALLS +# endif + +# ifdef ACE_HAS_DEV_POLL +# undef ACE_HAS_DEV_POLL +# endif + +# ifdef ACE_HAS_EVENT_POLL +# undef ACE_HAS_EVENT_POLL +# endif + +# ifdef ACE_HAS_ICONV +# undef ACE_HAS_ICONV +# endif + +# ifdef ACE_HAS_P_READ_WRITE +# undef ACE_HAS_P_READ_WRITE +# endif + +# ifdef ACE_HAS_RECURSIVE_MUTEXES +# undef ACE_HAS_RECURSIVE_MUTEXES +# endif + +# ifdef ACE_HAS_SCANDIR +# undef ACE_HAS_SCANDIR +# endif + +# ifdef ACE_HAS_STREAM_PIPES +# undef ACE_HAS_STREAM_PIPES +# endif + +# ifdef ACE_HAS_STRNLEN +# undef ACE_HAS_STRNLEN +# endif + +# ifdef ACE_HAS_SVR4_GETTIMEOFDAY +# undef ACE_HAS_SVR4_GETTIMEOFDAY +# endif + +# ifdef ACE_HAS_SYSV_IPC +# undef ACE_HAS_SYSV_IPC +# endif + +# ifdef ACE_HAS_TIMEZONE_GETTIMEOFDAY +# undef ACE_HAS_TIMEZONE_GETTIMEOFDAY +# endif + +# ifdef ACE_HAS_VFWPRINTF +# undef ACE_HAS_VFWPRINTF +# endif + +# ifdef ACE_HAS_VOIDPTR_GETTIMEOFDAY +# undef ACE_HAS_VOIDPTR_GETTIMEOFDAY +# endif + +# ifdef ACE_HAS_VSWPRINTF +# undef ACE_HAS_VSWPRINTF +# endif + +# ifdef ACE_HAS_VWPRINTF +# undef ACE_HAS_VWPRINTF +# endif + +# ifdef ACE_HAS_WCHAR +# undef ACE_HAS_WCHAR +# endif + +# ifdef ACE_HAS_XPG4_MULTIBYTE_CHAR +# undef ACE_HAS_XPG4_MULTIBYTE_CHAR +# endif + +# define ACE_LACKS_CTIME +# define ACE_LACKS_FDOPEN +# define ACE_LACKS_FGETPOS +# define ACE_LACKS_FPUTC +# define ACE_LACKS_FPUTS +# define ACE_LACKS_FSCANF +# define ACE_LACKS_FSETPOS +# define ACE_LACKS_GETC +# define ACE_LACKS_GETTIMEOFDAY +# define ACE_LACKS_IF_NAMEINDEX +# define ACE_LACKS_IF_NAMETOINDEX +# define ACE_LACKS_IOCTL +# define ACE_LACKS_LOCALECONV +# define ACE_LACKS_MUNMAP +# define ACE_LACKS_OPENLOG +# define ACE_LACKS_PRAGMA_ONCE +# define ACE_LACKS_PTHREAD_MUTEXATTR_SETTYPE +# define ACE_LACKS_PUTC +# define ACE_LACKS_PUTS +# define ACE_LACKS_RAND +# define ACE_LACKS_REWIND +# define ACE_LACKS_SHM_UNLINK +# define ACE_LACKS_SIGNAL +# define ACE_LACKS_SRAND +# define ACE_LACKS_STDERR +# define ACE_LACKS_STDIN +# define ACE_LACKS_STDOUT +# define ACE_LACKS_STRTOK +# define ACE_LACKS_UNGETC +# define ACE_LACKS_VA_COPY +# define ACE_LACKS_VPRINTF +# define ACE_LACKS_VSPRINTF + +# ifndef ACE_LACKS_ACE_IOSTREAM +# define ACE_LACKS_ACE_IOSTREAM +# endif + +# ifndef ACE_LACKS_ALPHASORT +# define ACE_LACKS_ALPHASORT +# endif + +# ifndef ACE_LACKS_ASCTIME +# define ACE_LACKS_ASCTIME +# endif + +# ifndef ACE_LACKS_CONDATTR_PSHARED +# define ACE_LACKS_CONDATTR_PSHARED +# endif + +# ifndef ACE_LACKS_CUSERID +# define ACE_LACKS_CUSERID +# endif + +# ifndef ACE_LACKS_DUP +# define ACE_LACKS_DUP +# endif + +# ifndef ACE_LACKS_EXECVP +# define ACE_LACKS_EXECVP +# endif + +# ifndef ACE_LACKS_GAI_STRERROR +# define ACE_LACKS_GAI_STRERROR +# endif + +# ifndef ACE_LACKS_GETHOSTBYADDR +# define ACE_LACKS_GETHOSTBYADDR +# endif + +# ifndef ACE_LACKS_GETHOSTBYADDR_R +# define ACE_LACKS_GETHOSTBYADDR_R +# endif + +# ifndef ACE_LACKS_GETHOSTBYNAME +# define ACE_LACKS_GETHOSTBYNAME +# endif + +# ifndef ACE_LACKS_GETHOSTENT +# define ACE_LACKS_GETHOSTENT +# endif + +# ifndef ACE_LACKS_GETOPT +# define ACE_LACKS_GETOPT +# endif + +# ifndef ACE_LACKS_GETPGID +# define ACE_LACKS_GETPGID +# endif + +# ifndef ACE_LACKS_GETPROTOBYNAME +# define ACE_LACKS_GETPROTOBYNAME +# endif + +# ifndef ACE_LACKS_GETPROTOBYNUMBER +# define ACE_LACKS_GETPROTOBYNUMBER +# endif + +# ifndef ACE_LACKS_GETSERVBYNAME +# define ACE_LACKS_GETSERVBYNAME +# endif + +# ifndef ACE_LACKS_GMTIME +# define ACE_LACKS_GMTIME +# endif + +# ifndef ACE_LACKS_INET_ADDR +# define ACE_LACKS_INET_ADDR +# endif + +# ifndef ACE_LACKS_INET_ATON +# define ACE_LACKS_INET_ATON +# endif + +# ifndef ACE_LACKS_INET_NTOA +# define ACE_LACKS_INET_NTOA +# endif + +# ifndef ACE_LACKS_IOSTREAM_TOTALLY +# define ACE_LACKS_IOSTREAM_TOTALLY +# endif + +# ifndef ACE_LACKS_ISASCII +# define ACE_LACKS_ISASCII +# endif + +# ifndef ACE_LACKS_ISATTY +# define ACE_LACKS_ISATTY +# endif + +# ifndef ACE_LACKS_ISBLANK +# define ACE_LACKS_ISBLANK +# endif + +# ifndef ACE_LACKS_ISWASCII +# define ACE_LACKS_ISWASCII +# endif + +# ifndef ACE_LACKS_ISWBLANK +# define ACE_LACKS_ISWBLANK +# endif + +# ifndef ACE_LACKS_ISWCTYPE +# define ACE_LACKS_ISWCTYPE +# endif + +# ifndef ACE_LACKS_LOCALTIME +# define ACE_LACKS_LOCALTIME +# endif + +# ifndef ACE_LACKS_LOG2 +# define ACE_LACKS_LOG2 +# endif + +# ifndef ACE_LACKS_MADVISE +# define ACE_LACKS_MADVISE +# endif + +# ifndef ACE_LACKS_MKSTEMP +# define ACE_LACKS_MKSTEMP +# endif + +# ifndef ACE_LACKS_MKTEMP +# define ACE_LACKS_MKTEMP +# endif + +# ifndef ACE_LACKS_MPROTECT +# define ACE_LACKS_MPROTECT +# endif + +# ifndef ACE_LACKS_MSYNC +# define ACE_LACKS_MSYNC +# endif + +# ifndef ACE_LACKS_MUTEXATTR_PSHARED +# define ACE_LACKS_MUTEXATTR_PSHARED +# endif + +# ifndef ACE_LACKS_PERROR +# define ACE_LACKS_PERROR +# endif + +# ifndef ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR +# define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR +# endif + +# ifndef ACE_LACKS_PTHREAD_CANCEL +# define ACE_LACKS_PTHREAD_CANCEL +# endif + +# ifndef ACE_LACKS_PUTENV +# define ACE_LACKS_PUTENV +# endif + +# ifndef ACE_LACKS_PWD_FUNCTIONS +# define ACE_LACKS_PWD_FUNCTIONS +# endif + +# ifndef ACE_LACKS_QSORT +# define ACE_LACKS_QSORT +# endif + +# ifndef ACE_LACKS_READLINK +# define ACE_LACKS_READLINK +# endif + +# ifndef ACE_LACKS_READV +# define ACE_LACKS_READV +# endif + +# ifndef ACE_LACKS_RECVMSG +# define ACE_LACKS_RECVMSG +# endif + +# ifndef ACE_LACKS_REALPATH +# define ACE_LACKS_REALPATH +# endif + +# ifndef ACE_LACKS_RLIMIT +# define ACE_LACKS_RLIMIT +# endif + +# ifndef ACE_LACKS_RWLOCK_T +# define ACE_LACKS_RWLOCK_T +# endif + +# ifndef ACE_LACKS_SBRK +# define ACE_LACKS_SBRK +# endif + +# ifndef ACE_LACKS_SEEKDIR +# define ACE_LACKS_SEEKDIR +# endif + +# ifndef ACE_LACKS_SENDMSG +# define ACE_LACKS_SENDMSG +# endif + +# ifndef ACE_LACKS_SETLOGMASK +# define ACE_LACKS_SETLOGMASK +# endif + +# ifndef ACE_LACKS_SETPGID +# define ACE_LACKS_SETPGID +# endif + +# ifndef ACE_LACKS_SETREGID +# define ACE_LACKS_SETREGID +# endif + +# ifndef ACE_LACKS_SETREUID +# define ACE_LACKS_SETREUID +# endif + +# ifndef ACE_LACKS_SETSID +# define ACE_LACKS_SETSID +# endif + +# ifndef ACE_LACKS_SIGPROCMASK +# define ACE_LACKS_SIGPROCMASK +# endif + +# ifndef ACE_LACKS_SOCKETPAIR +# define ACE_LACKS_SOCKETPAIR +# endif + +# ifndef ACE_LACKS_STD_WSTRING +# define ACE_LACKS_STD_WSTRING +# endif + +# ifndef ACE_LACKS_STRCASECMP +# define ACE_LACKS_STRCASECMP +# endif + +# ifndef ACE_LACKS_STRDUP +# define ACE_LACKS_STRDUP +# endif + +# ifndef ACE_LACKS_STRERROR +# define ACE_LACKS_STRERROR +# endif + +# ifndef ACE_LACKS_STRPTIME +# define ACE_LACKS_STRPTIME +# endif + +# ifndef ACE_LACKS_STRTOLL +# define ACE_LACKS_STRTOLL +# endif + +# ifndef ACE_LACKS_STRTOULL +# define ACE_LACKS_STRTOULL +# endif + +# ifndef ACE_LACKS_SWAB +# define ACE_LACKS_SWAB +# endif + +# ifndef ACE_LACKS_SYMLINKS +# define ACE_LACKS_SYMLINKS +# endif + +# ifndef ACE_LACKS_SYSTEM +# define ACE_LACKS_SYSTEM +# endif + +# ifndef ACE_LACKS_SYS_SHM_H +# define ACE_LACKS_SYS_SHM_H +# endif + +# ifndef ACE_LACKS_TELLDIR +# define ACE_LACKS_TELLDIR +# endif + +# ifndef ACE_LACKS_TMPNAM +# define ACE_LACKS_TMPNAM +# endif + +# ifndef ACE_LACKS_TEMPNAM +# define ACE_LACKS_TEMPNAM +# endif + +# ifndef ACE_LACKS_TRUNCATE +# define ACE_LACKS_TRUNCATE +# endif + +# ifndef ACE_LACKS_UNIX_SYSLOG +# define ACE_LACKS_UNIX_SYSLOG +# endif + +# ifndef ACE_LACKS_WAIT +# define ACE_LACKS_WAIT +# endif + +# ifndef ACE_LACKS_WCSCAT +# define ACE_LACKS_WCSCAT +# endif + +# ifndef ACE_LACKS_WCSCHR +# define ACE_LACKS_WCSCHR +# endif + +# ifndef ACE_LACKS_WCSCMP +# define ACE_LACKS_WCSCMP +# endif + +# ifndef ACE_LACKS_WCSCPY +# define ACE_LACKS_WCSCPY +# endif + +# ifndef ACE_LACKS_WCSCSPN +# define ACE_LACKS_WCSCSPN +# endif + +# ifndef ACE_LACKS_WCSDUP +# define ACE_LACKS_WCSDUP +# endif + +# ifndef ACE_LACKS_WCSLEN +# define ACE_LACKS_WCSLEN +# endif + +# ifndef ACE_LACKS_WCSNCAT +# define ACE_LACKS_WCSNCAT +# endif + +# ifndef ACE_LACKS_WCSNCMP +# define ACE_LACKS_WCSNCMP +# endif + +# ifndef ACE_LACKS_WCSNCPY +# define ACE_LACKS_WCSNCPY +# endif + +# ifndef ACE_LACKS_WCSNLEN +# define ACE_LACKS_WCSNLEN +# endif + +# ifndef ACE_LACKS_WCSPBRK +# define ACE_LACKS_WCSPBRK +# endif + +# ifndef ACE_LACKS_WCSRCHR +# define ACE_LACKS_WCSRCHR +# endif + +# ifndef ACE_LACKS_WCSRTOMBS +# define ACE_LACKS_WCSRTOMBS +# endif + +# ifndef ACE_LACKS_WCSSPN +# define ACE_LACKS_WCSSPN +# endif + +# ifndef ACE_LACKS_WCSSTR +# define ACE_LACKS_WCSSTR +# endif + +# ifndef ACE_LACKS_WCSTOK +# define ACE_LACKS_WCSTOK +# endif + +# ifndef ACE_LACKS_WCSLEN +# define ACE_LACKS_WCSLEN +# endif + +# ifndef ACE_LACKS_WRITEV +# define ACE_LACKS_WRITEV +# endif + +// due to ACE_LACKS_GETHOSTBYNAME: +# ifndef ACE_LOCALHOST +# define ACE_LOCALHOST ACE_TEXT ("127.0.0.1") +# endif + +# ifdef ACE_USES_GPROF +# undef ACE_USES_GPROF +# endif + +#endif // ACE_FACE_SAFETY_EXTENDED diff --git a/deps/acelite/ace/config-g++-common.h b/deps/acelite/ace/config-g++-common.h index e024997f4..9bbc68d1d 100644 --- a/deps/acelite/ace/config-g++-common.h +++ b/deps/acelite/ace/config-g++-common.h @@ -31,13 +31,17 @@ # define ACE_HAS_NEW_NOTHROW #endif /* __GNUC__ >= 3.3 */ -#if (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) -# if __cplusplus > 199711L -# define ACE_HAS_CPP11 -# endif -# if __cplusplus > 201103L -# define ACE_HAS_CPP14 -# endif +#if __cplusplus >= 201103L +# define ACE_HAS_CPP11 +#endif +#if __cplusplus >= 201402L +# define ACE_HAS_CPP14 +#endif +#if __cplusplus >= 201703L +# define ACE_HAS_CPP17 +#endif +#if __cplusplus >= 202002L +# define ACE_HAS_CPP20 #endif #if (defined (i386) || defined (__i386__)) && !defined (ACE_SIZEOF_LONG_DOUBLE) @@ -132,8 +136,9 @@ # endif # if defined (ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS) && ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS == 1 -# define ACE_EXPORT_SINGLETON_DECLARATION(T) template class ACE_Proper_Export_Flag T -# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class ACE_Proper_Export_Flag SINGLETON_TYPE ; +# define ACE_EXPORT_SINGLETON_DECLARATION(T) __extension__ extern template class ACE_Proper_Export_Flag T +# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class ACE_Proper_Export_Flag SINGLETON_TYPE ; +# define ACE_HAS_EXPLICIT_TEMPLATE_CLASS_INSTANTIATION # else /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */ # define ACE_EXPORT_SINGLETON_DECLARATION(T) \ _Pragma ("GCC visibility push(default)") \ diff --git a/deps/acelite/ace/config-hpux-11.00.h b/deps/acelite/ace/config-hpux-11.00.h index 995bfd987..48829300e 100644 --- a/deps/acelite/ace/config-hpux-11.00.h +++ b/deps/acelite/ace/config-hpux-11.00.h @@ -162,7 +162,6 @@ #define ACE_HAS_CLOCK_SETTIME #define ACE_LACKS_CLOCK_MONOTONIC -#define ACE_LACKS_MONOTONIC_TIME #define ACE_LACKS_PTHREAD_SCOPE_PROCESS diff --git a/deps/acelite/ace/config-kfreebsd.h b/deps/acelite/ace/config-kfreebsd.h index 79a2886a0..5341a54e2 100644 --- a/deps/acelite/ace/config-kfreebsd.h +++ b/deps/acelite/ace/config-kfreebsd.h @@ -1,7 +1,12 @@ #ifndef ACE_CONFIG_KFREEBSD_H -#define ACE_CONFIG_KFREEBSDH -#include "ace/config-g++-common.h" +#define ACE_CONFIG_KFREEBSD_H +// Make sure system defined macro (not related to ACE_OS::atop) +// is not defined during ACE compilation +#include +#undef atop + +#include "ace/config-g++-common.h" /* Uses ctime_r & asctime_r with only two parameters vs. three. */ #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1 @@ -234,9 +239,6 @@ /* Compiler requires extern "C" functions for signals. */ #define ACE_HAS_SIG_C_FUNC 1 -/* Define to 1 if platform has snprintf(). */ -#define ACE_HAS_SNPRINTF 1 - /* Define to 1 if `sin6_len' is a member of `sockaddr_in6'. */ #define ACE_HAS_SOCKADDR_IN6_SIN6_LEN 1 @@ -428,9 +430,6 @@ /* */ #define ACE_LACKS_UNBUFFERED_STREAMBUF 1 -/* Define to 1 if the system lacks the type `u_long_long_t'. */ -#define ACE_LACKS_U_LONGLONG_T 1 - /* Define to 1 if platform lacks wcsnicmp(). */ #define ACE_LACKS_WCSNICMP 1 @@ -543,7 +542,7 @@ #define LT_OBJDIR ".libs/" /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "ace-bugs@cs.wustl.edu" +#define PACKAGE_BUGREPORT "ace-bugs@list.isis.vanderbilt.edu" /* Define to the full name of this package. */ #define PACKAGE_NAME "ACE" @@ -610,7 +609,6 @@ /* Enable ACE inlining */ #define __ACE_INLINE__ 1 - -#endif /* ACE_CONFIG_KFREEBSDH */ +#endif /* ACE_CONFIG_KFREEBSD_H */ diff --git a/deps/acelite/ace/config-linux-common.h b/deps/acelite/ace/config-linux-common.h new file mode 100644 index 000000000..06b9e3587 --- /dev/null +++ b/deps/acelite/ace/config-linux-common.h @@ -0,0 +1,259 @@ +/** + * Common configuration for platforms using the Linux Kernel, specifically + * ACE_LINUX and ACE_ANDROID as of writing. config-android.h was originally + * based off config-linux.h and this file was created from the common parts of + * both. + */ +#ifndef ACE_CONFIG_LINUX_COMMON_H +#define ACE_CONFIG_LINUX_COMMON_H + +#if !defined (ACE_MT_SAFE) +# define ACE_MT_SAFE 1 +#endif + +// Compiler supports the ssize_t typedef. +#define ACE_HAS_SSIZE_T + +// Needed to differentiate between libc 5 and libc 6 (aka glibc). +#include + +#include "ace/config-posix.h" + +#ifndef ACE_DEFAULT_BASE_ADDR +# if defined (__powerpc__) || defined (__x86_64__) +# define ACE_DEFAULT_BASE_ADDR (reinterpret_cast< char* >(0x40000000)) +# elif defined (__ia64) +// Zero base address should work fine for Linux of IA-64: it just lets +// the kernel to choose the right value. +# define ACE_DEFAULT_BASE_ADDR (reinterpret_cast< char*>(0x0000000000000000)) +# else +# define ACE_DEFAULT_BASE_ADDR (reinterpret_cast< char* >(0x80000000)) +# endif +#endif /* ! ACE_DEFAULT_BASE_ADDR */ + +#define ACE_HAS_LSEEK64 + +#define ACE_HAS_P_READ_WRITE +// Use ACE's alternate cuserid() implementation since the use of the +// system cuserid() is discouraged. +#define ACE_HAS_ALT_CUSERID + +#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) +# define ACE_HAS_ISASTREAM_PROTOTYPE +# define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE +# define ACE_HAS_CPU_SET_T +# define ACE_HAS_GLIBC_2_2_3 +#endif /* __GLIBC__ > 2 || __GLIBC__ === 2 && __GLIBC_MINOR__ >= 3) */ + +#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 30) +# define ACE_LACKS_SYS_SYSCTL_H +#endif /* __GLIBC__ > 2 || __GLIBC__ === 2 && __GLIBC_MINOR__ >= 30) */ + +#if defined (__INTEL_COMPILER) +# include "ace/config-icc-common.h" +#elif defined (__GNUG__) + // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so + // this must appear before its #include. +# define ACE_HAS_STRING_CLASS +# include "ace/config-g++-common.h" +#elif defined (__SUNCC_PRO) || defined (__SUNPRO_CC) +# include "ace/config-suncc-common.h" +#elif defined (__PGI) +// Portable group compiler +# define ACE_HAS_CPLUSPLUS_HEADERS +# define ACE_HAS_STDCPP_STL_INCLUDES +# define ACE_HAS_STANDARD_CPP_LIBRARY 1 +# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 +# define ACE_LACKS_SWAB +#elif defined (__GNUC__) +/** + * GNU C compiler. + * + * We need to recognize the GNU C compiler since TAO has at least one + * C source header and file + * (TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.{h,c}) that may indirectly + * include this + */ +#else /* ! __GNUG__ && !__DECCXX && !__INTEL_COMPILER && && !__PGI */ +# ifdef __cplusplus /* Let it slide for C compilers. */ +# error unsupported compiler in ace/config-linux.h +# endif /* __cplusplus */ +#endif /* ! __GNUG__*/ + +// Platform/compiler has the sigwait(2) prototype +#define ACE_HAS_SIGWAIT + +#define ACE_HAS_SIGSUSPEND + +#define ACE_HAS_STRSIGNAL + +#ifndef ACE_HAS_POSIX_REALTIME_SIGNALS +# define ACE_HAS_POSIX_REALTIME_SIGNALS +#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ + +#define ACE_HAS_XPG4_MULTIBYTE_CHAR +#define ACE_HAS_VFWPRINTF + +#define ACE_LACKS_ITOW +#define ACE_LACKS_WCSICMP +#define ACE_LACKS_WCSNICMP +#define ACE_LACKS_ISWASCII + +#define ACE_HAS_3_PARAM_WCSTOK + +#define ACE_HAS_3_PARAM_READDIR_R + +#define ACE_HAS_ALLOCA + +// Compiler/platform has +#define ACE_HAS_ALLOCA_H +#define ACE_HAS_SYS_SYSINFO_H +#define ACE_HAS_LINUX_SYSINFO + +// Compiler/platform has the getrusage() system call. +#define ACE_HAS_GETRUSAGE +#define ACE_HAS_GETRUSAGE_PROTOTYPE + +#define ACE_HAS_BYTESWAP_H +#define ACE_HAS_BSWAP_16 +#define ACE_HAS_BSWAP_32 + +#if defined (__GNUC__) +# define ACE_HAS_BSWAP_64 +#endif + +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES + +// Optimize ACE_Handle_Set for select(). +#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT + +// ONLY define this if you have config'd multicast into a 2.0.34 or +// prior kernel. It is enabled by default in 2.0.35 kernels. +#if !defined (ACE_HAS_IP_MULTICAST) +# define ACE_HAS_IP_MULTICAST +#endif /* ! ACE_HAS_IP_MULTICAST */ + +// At least for IPv4, Linux lacks perfect filtering. +#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING +# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 +#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ + +#define ACE_HAS_BIG_FD_SET + +// Linux defines struct msghdr in /usr/include/socket.h +#define ACE_HAS_MSG + +// Linux "improved" the interface to select() so that it modifies +// the struct timeval to reflect the amount of time not slept +// (see NOTES in Linux's select(2) man page). +#define ACE_HAS_NONCONST_SELECT_TIMEVAL + +#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 65535 + +#define ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE 1 + +#define ACE_HAS_GETPAGESIZE 1 + +// Platform defines struct timespec but not timespec_t +#define ACE_LACKS_TIMESPEC_T + +// Platform supplies scandir() +#define ACE_HAS_SCANDIR + +// Compiler/platform contains the file. +#define ACE_HAS_SYS_SYSCALL_H + +#define ACE_HAS_TIMEZONE +#define ACE_HAS_TIMEZONE_GETTIMEOFDAY + +// Compiler/platform defines the sig_atomic_t typedef. +#define ACE_HAS_SIG_ATOMIC_T + +#define ACE_HAS_POSIX_TIME + +#define ACE_HAS_GPERF + +#define ACE_HAS_DIRENT + +// Starting with FC9 rawhide this file is not available anymore but +// this define is set +#if !defined(_XOPEN_STREAMS) || (defined _XOPEN_STREAMS && _XOPEN_STREAMS == -1) +# define ACE_LACKS_STROPTS_H +# define ACE_LACKS_STRRECVFD +#endif + +#if !defined (ACE_LACKS_STROPTS_H) +# define ACE_HAS_STRBUF_T +#endif + +#if defined (__ia64) || defined(__alpha) || defined (__x86_64__) || defined(__powerpc64__) || (defined(__mips__) && defined(__LP64__)) || defined (__aarch64__) +// On 64 bit platforms, the "long" type is 64-bits. Override the +// default 32-bit platform-specific format specifiers appropriately. +# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%lu" +# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld" +# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" +#endif /* __ia64 */ + +#define ACE_SIZEOF_WCHAR 4 + +// Platform has POSIX terminal interface. +#define ACE_HAS_TERMIOS + +// Linux implements sendfile(). +#define ACE_HAS_SENDFILE 1 + +#define ACE_HAS_VOIDPTR_MMAP + +#define ACE_HAS_VASPRINTF + +#define ACE_LACKS_PTHREAD_SCOPE_PROCESS + +// According to man pages Linux uses different (compared to UNIX systems) types +// for setting IP_MULTICAST_TTL and IPV6_MULTICAST_LOOP / IP_MULTICAST_LOOP +// in setsockopt/getsockopt. +// In the current (circa 2012) kernel source however there is an explicit check +// for IPV6_MULTICAST_LOOP being sizeof(int). Anything else is rejected so it must +// not be a passed a bool, irrespective of what the man pages (still) say. +// i.e. #define ACE_HAS_IPV6_MULTICAST_LOOP_AS_BOOL 1 is wrong +#define ACE_HAS_IP_MULTICAST_TTL_AS_INT 1 +#define ACE_HAS_IP_MULTICAST_LOOP_AS_INT 1 + +#define ACE_HAS_SVR4_DYNAMIC_LINKING +#define ACE_HAS_AUTOMATIC_INIT_FINI +#define ACE_HAS_RECURSIVE_MUTEXES +#define ACE_HAS_THREAD_SPECIFIC_STORAGE +#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS +#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R +#define ACE_HAS_REENTRANT_FUNCTIONS + +/* =========================================================================== + * By Kernel API Version + * =========================================================================== + */ + +#if !defined (ACE_LACKS_LINUX_VERSION_H) +# include +#endif /* !ACE_LACKS_LINUX_VERSION_H */ + +#if !defined (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO) +// Detect if getsockname() and getpeername() returns random values in +// the sockaddr_in::sin_zero field by evaluation of the kernel +// version. Since version 2.5.47 this problem is fixed. +# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,47)) +# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 0 +# else +# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 1 +# endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,47)) */ +#endif /* ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO */ + +#if !defined (ACE_HAS_EVENT_POLL) && !defined (ACE_HAS_DEV_POLL) +# if (LINUX_VERSION_CODE > KERNEL_VERSION (2,6,0)) +# define ACE_HAS_EVENT_POLL +# endif +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION (2,4,11)) +# define ACE_HAS_GETTID // See ACE_OS::thr_gettid() +#endif + +#endif /* ACE_CONFIG_LINUX_COMMON_H */ diff --git a/deps/acelite/ace/config-linux.h b/deps/acelite/ace/config-linux.h index b3b2f0c05..954d61f09 100644 --- a/deps/acelite/ace/config-linux.h +++ b/deps/acelite/ace/config-linux.h @@ -10,10 +10,6 @@ #define ACE_LINUX #endif /* ACE_LINUX */ -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - #if !defined (__ACE_INLINE__) # define __ACE_INLINE__ #endif /* ! __ACE_INLINE__ */ @@ -22,17 +18,14 @@ #define ACE_PLATFORM_CONFIG config-linux.h #endif -#define ACE_HAS_BYTESEX_H +#include "ace/config-linux-common.h" -// Needed to differentiate between libc 5 and libc 6 (aka glibc). -#include +#define ACE_HAS_BYTESEX_H #if (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500) # define ACE_HAS_PTHREADS_UNIX98_EXT #endif /* _XOPEN_SOURCE - 0 >= 500 */ -# include "ace/config-posix.h" - #if !defined (ACE_LACKS_LINUX_NPTL) // Temporary fix because NPTL kernels do have shm_open but there is a problem @@ -65,20 +58,6 @@ # undef ACE_HAS_AIO_CALLS #endif -// First the machine specific part - -#if defined (__powerpc__) || defined (__x86_64__) -# if !defined (ACE_DEFAULT_BASE_ADDR) -# define ACE_DEFAULT_BASE_ADDR (reinterpret_cast< char* >(0x40000000)) -# endif /* ! ACE_DEFAULT_BASE_ADDR */ -#elif defined (__ia64) -# if !defined (ACE_DEFAULT_BASE_ADDR) -// Zero base address should work fine for Linux of IA-64: it just lets -// the kernel to choose the right value. -# define ACE_DEFAULT_BASE_ADDR (reinterpret_cast< char*>(0x0000000000000000)) -# endif /* ! ACE_DEFAULT_BASE_ADDR */ -#endif /* ! __powerpc__ && ! __ia64 */ - // Then glibc/libc5 specific parts #if defined(__GLIBC__) || defined (__INTEL_COMPILER) @@ -115,6 +94,7 @@ # define ACE_LACKS_SIGINFO_H # define ACE_HAS_UCONTEXT_T # define ACE_HAS_SIGTIMEDWAIT +# define ACE_HAS_STRERROR_R #else /* ! __GLIBC__ */ // Fixes a problem with some non-glibc versions of Linux... @@ -122,147 +102,14 @@ # define ACE_LACKS_MSG_ACCRIGHTS #endif /* ! __GLIBC__ */ -#define ACE_HAS_LSEEK64 -//#define ACE_LACKS_LSEEK64_PROTOTYPE - -#define ACE_HAS_P_READ_WRITE -// Use ACE's alternate cuserid() implementation since the use of the -// system cuserid() is discouraged. -#define ACE_HAS_ALT_CUSERID - -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) -# define ACE_HAS_ISASTREAM_PROTOTYPE -# define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE -# define ACE_HAS_CPU_SET_T -#endif /* __GLIBC__ > 2 || __GLIBC__ === 2 && __GLIBC_MINOR__ >= 3) */ - -// Then the compiler specific parts - -#if defined (__INTEL_COMPILER) -# include "ace/config-icc-common.h" -#elif defined (__GNUG__) - // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so - // this must appear before its #include. -# define ACE_HAS_STRING_CLASS -# include "ace/config-g++-common.h" -# ifdef __clang__ -# undef ACE_HAS_GCC_ATOMIC_BUILTINS -# endif -#elif defined (__SUNCC_PRO) || defined (__SUNPRO_CC) -# include "ace/config-suncc-common.h" -#elif defined (__PGI) -// Portable group compiler -# define ACE_HAS_CPLUSPLUS_HEADERS -# define ACE_HAS_STDCPP_STL_INCLUDES -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_LACKS_SWAB -#elif defined (__GNUC__) -/** - * GNU C compiler. - * - * We need to recognize the GNU C compiler since TAO has at least one - * C source header and file - * (TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.{h,c}) that may indirectly - * include this - */ -#else /* ! __GNUG__ && !__DECCXX && !__INTEL_COMPILER && && !__PGI */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler in ace/config-linux.h -# endif /* __cplusplus */ -#endif /* ! __GNUG__*/ - // Completely common part :-) -// Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -#define ACE_HAS_SIGSUSPEND - #define ACE_HAS_UALARM -#define ACE_HAS_STRSIGNAL - -#ifndef ACE_HAS_POSIX_REALTIME_SIGNALS -# define ACE_HAS_POSIX_REALTIME_SIGNALS -#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ - -#define ACE_HAS_XPG4_MULTIBYTE_CHAR -#define ACE_HAS_VFWPRINTF - -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_ISWASCII - -#define ACE_HAS_3_PARAM_WCSTOK - -#define ACE_HAS_3_PARAM_READDIR_R - -#if !defined (ACE_DEFAULT_BASE_ADDR) -# define ACE_DEFAULT_BASE_ADDR (reinterpret_cast< char* >(0x80000000)) -#endif /* ! ACE_DEFAULT_BASE_ADDR */ - -#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H -#define ACE_HAS_SYS_SYSINFO_H -#define ACE_HAS_LINUX_SYSINFO - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE -#define ACE_HAS_GETRUSAGE_PROTOTYPE - -#define ACE_HAS_BYTESWAP_H -#define ACE_HAS_BSWAP_16 -#define ACE_HAS_BSWAP_32 - -#if defined (__GNUC__) -# define ACE_HAS_BSWAP_64 -#endif - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// ONLY define this if you have config'd multicast into a 2.0.34 or -// prior kernel. It is enabled by default in 2.0.35 kernels. -#if !defined (ACE_HAS_IP_MULTICAST) -# define ACE_HAS_IP_MULTICAST -#endif /* ! ACE_HAS_IP_MULTICAST */ - -// At least for IPv4, Linux lacks perfect filtering. -#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ - -#define ACE_HAS_BIG_FD_SET - -// Linux defines struct msghdr in /usr/include/socket.h -#define ACE_HAS_MSG - -// Linux "improved" the interface to select() so that it modifies -// the struct timeval to reflect the amount of time not slept -// (see NOTES in Linux's select(2) man page). -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 65535 - -#define ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE 1 - -#define ACE_HAS_GETPAGESIZE 1 - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -// Platform supplies scandir() -#define ACE_HAS_SCANDIR #if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 10) // Although the scandir man page says otherwise, this setting is correct. // The setting was fixed in 2.10, so do not use the hack after that. -#define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR +# define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR #endif // A conflict appears when including both and @@ -272,82 +119,19 @@ // Platform supports System V IPC (most versions of UNIX, but not Win32) #define ACE_HAS_SYSV_IPC -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Platform/compiler supports global timezone variable. -#define ACE_HAS_TIMEZONE - -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - // Compiler/platform defines a union semun for SysV shared memory. #define ACE_HAS_SEMUN -#define ACE_HAS_POSIX_TIME - -#define ACE_HAS_GPERF - -#define ACE_HAS_DIRENT - -// Starting with FC9 rawhide this file is not available anymore but -// this define is set -#if defined _XOPEN_STREAMS && _XOPEN_STREAMS == -1 -# define ACE_LACKS_STROPTS_H -# define ACE_LACKS_STRRECVFD -#endif - -#if !defined (ACE_LACKS_STROPTS_H) -# define ACE_HAS_STRBUF_T -#endif - -#if defined (__ia64) || defined(__alpha) || defined (__x86_64__) || defined(__powerpc64__) -// On 64 bit platforms, the "long" type is 64-bits. Override the -// default 32-bit platform-specific format specifiers appropriately. -# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%lu" -# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld" -# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" -#endif /* __ia64 */ - -#define ACE_SIZEOF_WCHAR 4 - #if defined (__powerpc__) && !defined (ACE_SIZEOF_LONG_DOUBLE) // 32bit PowerPC Linux uses 128bit long double # define ACE_SIZEOF_LONG_DOUBLE 16 #endif -#define ACE_LACKS_PTHREAD_SCOPE_PROCESS - #define ACE_LACKS_GETIPNODEBYADDR #define ACE_LACKS_GETIPNODEBYNAME -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// Linux implements sendfile(). -#define ACE_HAS_SENDFILE 1 - -#define ACE_HAS_VOIDPTR_MMAP - #define ACE_HAS_ICMP_SUPPORT 1 -#define ACE_HAS_VASPRINTF - -// According to man pages Linux uses different (compared to UNIX systems) types -// for setting IP_MULTICAST_TTL and IPV6_MULTICAST_LOOP / IP_MULTICAST_LOOP -// in setsockopt/getsockopt. -// In the current (circa 2012) kernel source however there is an explicit check -// for IPV6_MULTICAST_LOOP being sizeof(int). Anything else is rejected so it must -// not be a passed a bool, irrespective of what the man pages (still) say. -// i.e. #define ACE_HAS_IPV6_MULTICAST_LOOP_AS_BOOL 1 is wrong -#define ACE_HAS_IP_MULTICAST_TTL_AS_INT 1 -#define ACE_HAS_IP_MULTICAST_LOOP_AS_INT 1 - #if defined (ACE_LACKS_NETWORKING) # include "ace/config-posix-nonetworking.h" #else @@ -355,27 +139,6 @@ # define ACE_HAS_GETIFADDRS #endif -#if !defined (ACE_LACKS_LINUX_VERSION_H) -# include -#endif /* !ACE_LACKS_LINUX_VERSION_H */ - -#if !defined (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO) -// Detect if getsockname() and getpeername() returns random values in -// the sockaddr_in::sin_zero field by evaluation of the kernel -// version. Since version 2.5.47 this problem is fixed. -# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,47)) -# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 0 -# else -# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 1 -# endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,47)) */ -#endif /* ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO */ - -#if !defined (ACE_HAS_EVENT_POLL) && !defined (ACE_HAS_DEV_POLL) -# if (LINUX_VERSION_CODE > KERNEL_VERSION (2,6,0)) -# define ACE_HAS_EVENT_POLL -# endif -#endif - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,8)) # define ACE_HAS_SCHED_GETAFFINITY 1 # define ACE_HAS_SCHED_SETAFFINITY 1 @@ -386,22 +149,12 @@ // we have no choice. // RHEL4 fails (2.6.9) while RHEL5 works (2.6.18) #if !defined (ACE_LACKS_CONDATTR_SETCLOCK) -# if !defined (ACE_LACKS_LINUX_VERSION_H) -# include -# endif /* !ACE_LACKS_LINUX_VERSION_H */ # if (LINUX_VERSION_CODE < KERNEL_VERSION (2,6,18)) # define ACE_LACKS_CONDATTR_SETCLOCK # endif #endif -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE -#define ACE_HAS_RECURSIVE_MUTEXES -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#define ACE_HAS_REENTRANT_FUNCTIONS +#define ACE_HAS_MNTENT // To support UCLIBC #if defined (__UCLIBC__) diff --git a/deps/acelite/ace/config-lite.h b/deps/acelite/ace/config-lite.h index 3c64478d3..55d11f9a4 100644 --- a/deps/acelite/ace/config-lite.h +++ b/deps/acelite/ace/config-lite.h @@ -4,7 +4,7 @@ /** * @file config-lite.h * - * @author (Originally in OS.h)Doug Schmidt + * @author (Originally in OS.h)Doug Schmidt * @author Jesper S. M|ller * @author and a cast of thousands... * @@ -114,7 +114,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL // Once all C++ compilers support the standard reverse_iterator // adapters, we can drop this generator macro or at least drop the // MSVC++ or Sun Studio preprocessor conditional blocks. -#if defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5130 \ +#if defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5140 \ && !defined (_STLPORT_VERSION) // If we're not using the stlport4 C++ library (which has standard // iterators), we need to ensure this is included in order to test @@ -129,7 +129,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL typedef std::reverse_iterator reverse_iterator; \ typedef std::reverse_iterator const_reverse_iterator; -#elif defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5130 \ +#elif defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5140 \ && defined (_RWSTD_NO_CLASS_PARTIAL_SPEC) # define ACE_DECLARE_STL_REVERSE_ITERATORS \ typedef std::reverse_iterator file. +#define ACE_HAS_SYS_SYSCALL_H + +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES + +// Compiler/platform supports alloca(). +// Although ACE does have alloca() on this compiler/platform combination, it is +// disabled by default since it can be dangerous. Uncomment the following line +// if you ACE to use it. +//#define ACE_HAS_ALLOCA + +// Compiler/platform correctly calls init()/fini() for shared libraries. +#define ACE_HAS_AUTOMATIC_INIT_FINI + +// Explicit dynamic linking permits "lazy" symbol resolution +//#define ACE_HAS_RTLD_LAZY_V + +// platform supports POSIX O_NONBLOCK semantics +#define ACE_HAS_POSIX_NONBLOCK + +// platform supports IP multicast +#define ACE_HAS_IP_MULTICAST +#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 + +// Compiler/platform has the getrusage() system call. +#define ACE_HAS_GETRUSAGE + +// Compiler supports the ssize_t typedef. +#define ACE_HAS_SSIZE_T + +// Compiler/platform provides the sockio.h file. +#define ACE_HAS_SYS_SOCKIO_H + +// Defines the page size of the system. +#define ACE_HAS_GETPAGESIZE + +// Platform provides header. +#define ACE_HAS_SYS_FILIO_H + +// Platform/compiler supports timezone * as second parameter to gettimeofday(). +#define ACE_HAS_TIMEZONE_GETTIMEOFDAY + +#define ACE_LACKS_SYS_MSG_H +#define ACE_LACKS_SYSV_MSQ_PROTOS +#define ACE_HAS_MSG +#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG +#define ACE_HAS_NONCONST_MSGSND + +#if !defined (ACE_MT_SAFE) +# define ACE_MT_SAFE 1 +#endif + +#if ACE_MT_SAFE == 1 +// Yes, we do have threads. +# define ACE_HAS_THREADS +// And they're even POSIX pthreads +# define ACE_HAS_PTHREADS +# define ACE_HAS_THREAD_SPECIFIC_STORAGE +# define ACE_LACKS_THREAD_PROCESS_SCOPING +#endif /* ACE_MT_SAFE == 1 */ + +#define ACE_HAS_DIRENT +#define ACE_LACKS_POLL_H +#define ACE_LACKS_SEARCH_H + +#define ACE_LACKS_SETSCHED +//#define ACE_HAS_RECURSIVE_MUTEXES + +// Platform has POSIX terminal interface. +#define ACE_HAS_TERMIOS + +#define ACE_HAS_SEMUN +#define ACE_HAS_SIGINFO_T +#define ACE_LACKS_SIGINFO_H +#define ACE_HAS_UCONTEXT_T +#define ACE_HAS_GETIFADDRS +#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES +#define ACE_LACKS_UNNAMED_SEMAPHORE + +// dlcompat package (not part of base Darwin) is needed for dlopen(). +// You may download directly from sourceforge and install or use fink +// Fink installer puts libraries in /sw/lib and headers in /sw/include +// In order to install dlcompat do the following: +// - download fink from http://fink.sf.net +// - type: +// fink install dlcompat +// as of Dec 2002, if you use fink you will need to uncomment the next line +//#define ACE_NEEDS_DL_UNDERSCORE +#define ACE_HAS_SVR4_DYNAMIC_LINKING +#define ACE_LD_SEARCH_PATH ACE_TEXT ("DYLD_LIBRARY_PATH") +#define ACE_DLL_SUFFIX ACE_TEXT (".dylib") +#define ACE_LACKS_DLCLOSE + +// gperf seems to need this +#define ACE_HAS_NONSTATIC_OBJECT_MANAGER + +#if defined(__APPLE_CC__) && (__APPLE_CC__ < 1173) +#error "Compiler must be upgraded, see http://developer.apple.com" +#endif /* __APPLE_CC__ */ + +#endif /* ACE_CONFIG_MACOSX_H */ diff --git a/deps/acelite/ace/config-macosx-leopard.h b/deps/acelite/ace/config-macosx-leopard.h index 1b9b90d13..722a0f328 100644 --- a/deps/acelite/ace/config-macosx-leopard.h +++ b/deps/acelite/ace/config-macosx-leopard.h @@ -4,6 +4,8 @@ #ifndef ACE_CONFIG_MACOSX_LEOPARD_H #define ACE_CONFIG_MACOSX_LEOPARD_H +#include + #define ACE_HAS_MAC_OSX #define ACE_HAS_NET_IF_DL_H @@ -29,10 +31,6 @@ #define ACE_ISCTYPE_EQUIVALENT __isctype -#ifndef ACE_HAS_NONCONST_FD_ISSET -#define ACE_HAS_NONCONST_FD_ISSET -#endif - #define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR #define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" @@ -51,6 +49,7 @@ #define ACE_HAS_GPERF #define ACE_HAS_POSIX_SEM +#define ACE_HAS_SIOCGIFCONF #define ACE_HAS_SUNOS4_GETTIMEOFDAY @@ -205,9 +204,14 @@ #endif #define ACE_LACKS_CONDATTR_SETCLOCK + +#ifndef ACE_HAS_IPHONE +#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200 #define ACE_LACKS_CLOCKID_T #define ACE_LACKS_CLOCK_MONOTONIC #define ACE_LACKS_CLOCK_REALTIME +#endif +#endif // dlcompat package (not part of base Darwin) is needed for dlopen(). // You may download directly from sourceforge and install or use fink @@ -226,6 +230,8 @@ // gperf seems to need this //#define ACE_HAS_NONSTATIC_OBJECT_MANAGER +#define ACE_IOCTL_TYPE_ARG2 unsigned long + #if defined(__APPLE_CC__) && (__APPLE_CC__ < 1173) #error "Compiler must be upgraded, see http://developer.apple.com" #endif /* __APPLE_CC__ */ diff --git a/deps/acelite/ace/config-macosx-lion.h b/deps/acelite/ace/config-macosx-lion.h index 13d450f0a..055e08377 100644 --- a/deps/acelite/ace/config-macosx-lion.h +++ b/deps/acelite/ace/config-macosx-lion.h @@ -4,10 +4,6 @@ #include "ace/config-macosx-leopard.h" #ifdef __clang__ -# ifdef ACE_HAS_GCC_ATOMIC_BUILTINS -# undef ACE_HAS_GCC_ATOMIC_BUILTINS -# endif - # define ACE_ANY_OPS_USE_NAMESPACE #endif /* __clang__ */ diff --git a/deps/acelite/ace/config-macosx-mojave.h b/deps/acelite/ace/config-macosx-mojave.h new file mode 100644 index 000000000..49bea758a --- /dev/null +++ b/deps/acelite/ace/config-macosx-mojave.h @@ -0,0 +1,12 @@ +#ifndef ACE_CONFIG_MACOSX_MOJAVE_H +#define ACE_CONFIG_MACOSX_MOJAVE_H + +// Get access to IPV6_RECVPKTINFO +// See http://lxr.nginx.org/ident?_i=__APPLE_USE_RFC_3542 +#ifndef __APPLE_USE_RFC_3542 +#define __APPLE_USE_RFC_3542 +#endif + +#include "ace/config-macosx-highsierra.h" + +#endif // ACE_CONFIG_MACOSX_MOJAVE_H diff --git a/deps/acelite/ace/config-macosx-sierra.h b/deps/acelite/ace/config-macosx-sierra.h new file mode 100644 index 000000000..f4975a414 --- /dev/null +++ b/deps/acelite/ace/config-macosx-sierra.h @@ -0,0 +1,6 @@ +#ifndef ACE_CONFIG_MACOSX_SIERRA_H +#define ACE_CONFIG_MACOSX_SIERRA_H + +#include "ace/config-macosx-elcapitan.h" + +#endif // ACE_CONFIG_MACOSX_SIERRA_H diff --git a/deps/acelite/ace/config-macosx-snowleopard.h b/deps/acelite/ace/config-macosx-snowleopard.h index cd7798279..553056a9a 100644 --- a/deps/acelite/ace/config-macosx-snowleopard.h +++ b/deps/acelite/ace/config-macosx-snowleopard.h @@ -4,12 +4,7 @@ #include "ace/config-macosx-leopard.h" #ifdef __clang__ -#ifdef ACE_HAS_GCC_ATOMIC_BUILTINS -#undef ACE_HAS_GCC_ATOMIC_BUILTINS -#endif - #define ACE_ANY_OPS_USE_NAMESPACE - #endif #define ACE_LACKS_UCONTEXT_H diff --git a/deps/acelite/ace/config-macosx.h b/deps/acelite/ace/config-macosx.h index 729c7ffe1..13a853a93 100644 --- a/deps/acelite/ace/config-macosx.h +++ b/deps/acelite/ace/config-macosx.h @@ -1,178 +1,33 @@ -/* -*- C++ -*- */ -// This configuration file is designed to work with the MacOS X operating system, version 10.2 (Jaguar). +#ifndef ACE_CONFIG_MACOSX_ALL_H +#define ACE_CONFIG_MACOSX_ALL_H +#include -#ifndef ACE_CONFIG_MACOSX_H -#define ACE_CONFIG_MACOSX_H - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - -#define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" - -#if defined (ACE_HAS_PENTIUM) -# undef ACE_HAS_PENTIUM -#endif /* ACE_HAS_PENTIUM */ - -#if !defined (_THREAD_SAFE) -#define _THREAD_SAFE -#endif /* _THREAD_SAFE */ - -#define ACE_HAS_GPERF -#define ACE_HAS_POSIX_SEM - -//#define ACE_HAS_SVR4_TLI - -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_WCHAR_H - -#define ACE_SYS_SELECT_NEEDS_UNISTD_H - -// -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform supports SVR4 signal typedef -#define ACE_HAS_SVR4_SIGNAL_T - -//Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -//Platform supports sigsuspend() -#define ACE_HAS_SIGSUSPEND - -//#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#define ACE_LACKS_GETPGID -#define ACE_LACKS_RWLOCK_T - -#define ACE_HAS_SIOCGIFCONF - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -#define ACE_HAS_SYSCTL - -#define ACE_NEEDS_SCHED_H - -#define ACE_LACKS_MALLOC_H - -#define ACE_HAS_ALT_CUSERID - -// Platform supports POSIX timers via struct timespec. -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_UALARM - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -#define ACE_LACKS_STRRECVFD - -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Explicit dynamic linking permits "lazy" symbol resolution -//#define ACE_HAS_RTLD_LAZY_V - -// platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// platform supports IP multicast -#define ACE_HAS_IP_MULTICAST -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Defines the page size of the system. -#define ACE_HAS_GETPAGESIZE - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Platform/compiler supports timezone * as second parameter to gettimeofday(). -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYSV_MSQ_PROTOS -#define ACE_HAS_MSG -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_MSGSND - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 +#include "config-macosx-mojave.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 +#include "config-macosx-highsierra.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 +#include "config-macosx-sierra.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100 +#include "config-macosx-elcapitan.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 +#include "config-macosx-yosemite.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100900 +#include "config-macosx-mavericks.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100800 +#include "config-macosx-mountainlion.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100700 +#include "config-macosx-lion.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100600 +#include "config-macosx-snowleopard.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100500 +#include "config-macosx-leopard.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100400 +#include "config-macosx-tiger.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100300 +#include "config-macosx-panther.h" +#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100200 +#include "config-macosx-jaguar.h" #endif -#if ACE_MT_SAFE == 1 -// Yes, we do have threads. -# define ACE_HAS_THREADS -// And they're even POSIX pthreads -# define ACE_HAS_PTHREADS -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_LACKS_THREAD_PROCESS_SCOPING -#endif /* ACE_MT_SAFE == 1 */ - -#define ACE_HAS_DIRENT -#define ACE_LACKS_POLL_H -#define ACE_LACKS_SEARCH_H - -#define ACE_LACKS_SETSCHED -//#define ACE_HAS_RECURSIVE_MUTEXES - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -#define ACE_HAS_SEMUN -#define ACE_HAS_SIGINFO_T -#define ACE_LACKS_SIGINFO_H -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_GETIFADDRS -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES -#define ACE_LACKS_UNNAMED_SEMAPHORE - -// dlcompat package (not part of base Darwin) is needed for dlopen(). -// You may download directly from sourceforge and install or use fink -// Fink installer puts libraries in /sw/lib and headers in /sw/include -// In order to install dlcompat do the following: -// - download fink from http://fink.sf.net -// - type: -// fink install dlcompat -// as of Dec 2002, if you use fink you will need to uncomment the next line -//#define ACE_NEEDS_DL_UNDERSCORE -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_LD_SEARCH_PATH ACE_TEXT ("DYLD_LIBRARY_PATH") -#define ACE_DLL_SUFFIX ACE_TEXT (".dylib") -#define ACE_LACKS_DLCLOSE - -// gperf seems to need this -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER - -#if defined(__APPLE_CC__) && (__APPLE_CC__ < 1173) -#error "Compiler must be upgraded, see http://developer.apple.com" -#endif /* __APPLE_CC__ */ - -#endif /* ACE_CONFIG_MACOSX_H */ +#endif // ACE_CONFIG_MACOSX_ALL_H diff --git a/deps/acelite/ace/config-macros.h b/deps/acelite/ace/config-macros.h index d86733c50..21659d80c 100644 --- a/deps/acelite/ace/config-macros.h +++ b/deps/acelite/ace/config-macros.h @@ -4,7 +4,7 @@ /** * @file config-macros.h * - * @author (Originally in OS.h)Doug Schmidt + * @author (Originally in OS.h)Doug Schmidt * @author Jesper S. M|ller * @author and a cast of thousands... * @@ -19,15 +19,16 @@ #ifndef ACE_CONFIG_MACROS_H #define ACE_CONFIG_MACROS_H -#ifdef _WIN32 - #include "ace/config-win32.h" -#else - #include "ace/config.h" -#endif +#include "ace/config.h" +#include "ace/config-face-safety.h" #include "ace/Version.h" #include "ace/Versioned_Namespace.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include +#endif + #if !defined (ACE_HAS_EXCEPTIONS) #define ACE_HAS_EXCEPTIONS #endif /* !ACE_HAS_EXCEPTIONS */ @@ -113,12 +114,21 @@ # endif # endif /* ACE_HAS_DYNAMIC_LINKING */ +# if defined (ACE_HAS_DYNAMIC_LINKING) && ACE_HAS_DYNAMIC_LINKING == 0 && \ + defined (ACE_HAS_SVR4_DYNAMIC_LINKING) +# undef ACE_HAS_SVR4_DYNAMIC_LINKING +# endif /* ACE_HAS_DYNAMIC_LINKING == 0 */ + # if defined (ACE_USES_FIFO_SEM) # if defined (ACE_HAS_POSIX_SEM) || defined (ACE_LACKS_MKFIFO) || defined (ACE_LACKS_FCNTL) # undef ACE_USES_FIFO_SEM # endif # endif /* ACE_USES_FIFO_SEM */ +# ifndef ACE_LACKS_POSIX_DEVCTL +# define ACE_LACKS_POSIX_DEVCTL +# endif + // ========================================================================= // INLINE macros // @@ -246,7 +256,7 @@ #if !defined (ACE_UNUSED_ARG) # if defined (__GNUC__) && ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))) || (defined (__BORLANDC__) && defined (__clang__)) # define ACE_UNUSED_ARG(a) (void) (a) -# elif defined (__GNUC__) || defined (ghs) || defined (__hpux) || defined (__DECCXX) || defined (__rational__) || defined (__USLC__) || defined (ACE_RM544) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) +# elif defined (__GNUC__) || defined (ghs) || defined (__hpux) || defined (__DECCXX) || defined (__rational__) || defined (__USLC__) || defined (ACE_RM544) || defined (__DCC__) || defined (__PGI) // Some compilers complain about "statement with no effect" with (a). // This eliminates the warnings, and no code is generated for the null // conditional statement. @note that may only be true if -O is enabled, @@ -261,7 +271,7 @@ # endif /* ghs || __GNUC__ || ..... */ #endif /* !ACE_UNUSED_ARG */ -#if defined (_MSC_VER) || defined (ghs) || defined (__DECCXX) || defined(__BORLANDC__) || defined (ACE_RM544) || defined (__USLC__) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) || (defined (__HP_aCC) && (__HP_aCC < 39000 || __HP_aCC >= 60500)) +#if defined (_MSC_VER) || defined (ghs) || defined (__DECCXX) || defined(__BORLANDC__) || defined (ACE_RM544) || defined (__USLC__) || defined (__DCC__) || defined (__PGI) || (defined (__HP_aCC) && (__HP_aCC < 39000 || __HP_aCC >= 60500)) || defined (__IAR_SYSTEMS_ICC__) # define ACE_NOTREACHED(a) #else /* ghs || ..... */ # define ACE_NOTREACHED(a) a @@ -274,18 +284,175 @@ // ============================================================================ # if defined (ACE_HAS_ALLOC_HOOKS) -# define ACE_ALLOC_HOOK_DECLARE \ +# define ACE_ALLOC_HOOK_DECLARE \ void *operator new (size_t bytes); \ - void operator delete (void *ptr); + void *operator new (size_t bytes, void *ptr); \ + void *operator new (size_t bytes, const std::nothrow_t &) throw (); \ + void operator delete (void *ptr); \ + void operator delete (void *ptr, const std::nothrow_t &); \ + void *operator new[] (size_t size); \ + void operator delete[] (void *ptr); \ + void *operator new[] (size_t size, const std::nothrow_t &) throw (); \ + void operator delete[] (void *ptr, const std::nothrow_t &) + +# define ACE_GENERIC_ALLOCS(MAKE_PREFIX, CLASS) \ + MAKE_PREFIX (void *, CLASS)::operator new (size_t bytes) \ + { \ + void *const ptr = ACE_Allocator::instance ()->malloc (bytes); \ + if (ptr == 0) \ + throw std::bad_alloc (); \ + return ptr; \ + } \ + MAKE_PREFIX (void *, CLASS)::operator new (size_t, void *ptr) { return ptr; }\ + MAKE_PREFIX (void *, CLASS)::operator new (size_t bytes, \ + const std::nothrow_t &) throw () \ + { return ACE_Allocator::instance ()->malloc (bytes); } \ + MAKE_PREFIX (void, CLASS)::operator delete (void *ptr) \ + { if (ptr) ACE_Allocator::instance ()->free (ptr); } \ + MAKE_PREFIX (void, CLASS)::operator delete (void *ptr, \ + const std::nothrow_t &) \ + { if (ptr) ACE_Allocator::instance ()->free (ptr); } \ + MAKE_PREFIX (void *, CLASS)::operator new[] (size_t size) \ + { \ + void *const ptr = ACE_Allocator::instance ()->malloc (size); \ + if (ptr == 0) \ + throw std::bad_alloc (); \ + return ptr; \ + } \ + MAKE_PREFIX (void, CLASS)::operator delete[] (void *ptr) \ + { if (ptr) ACE_Allocator::instance ()->free (ptr); } \ + MAKE_PREFIX (void *, CLASS)::operator new[] (size_t size, \ + const std::nothrow_t &) throw ()\ + { return ACE_Allocator::instance ()->malloc (size); } \ + MAKE_PREFIX (void, CLASS)::operator delete[] (void *ptr, \ + const std::nothrow_t &) \ + { if (ptr) ACE_Allocator::instance ()->free (ptr); } + +# define ACE_ALLOC_HOOK_HELPER(RET, CLASS) RET CLASS +# define ACE_ALLOC_HOOK_DEFINE(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tt(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tt(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tt, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tc(RET, CLASS) template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tc(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tc, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Ty(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Ty(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Ty, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tyc(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tyc(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tyc, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tycc(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tycc(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tycc, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tcy(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tcy(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tcy, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tcyc(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tcyc(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tcyc, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tca(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tca(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tca, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tco(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tco(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tco, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tcoccc(RET, CLASS) \ + template RET \ + CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tcoccc(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tcoccc, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tcc(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tcc(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tcc, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tccc(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tccc(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tccc, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tccct(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tccct(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tccct, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tc4(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tc4(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tc4, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tc5(RET, CLASS) \ + template RET \ + CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tc5(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tc5, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tc6(RET, CLASS) \ + template RET \ + CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tc6(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tc6, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tc7(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tc7(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tc7, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tcs(RET, CLASS) \ + template RET CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tcs(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tcs, CLASS) + +# define ACE_ALLOC_HOOK_HELPER_Tmcc(RET, CLASS) \ + template RET \ + CLASS +# define ACE_ALLOC_HOOK_DEFINE_Tmcc(CLASS) \ + ACE_GENERIC_ALLOCS (ACE_ALLOC_HOOK_HELPER_Tmcc, CLASS) - // Note that these are just place holders for now. Some day they - // may be be replaced by . -# define ACE_ALLOC_HOOK_DEFINE(CLASS) \ - void *CLASS::operator new (size_t bytes) { return ::new char[bytes]; } \ - void CLASS::operator delete (void *ptr) { delete [] ((char *) ptr); } # else -# define ACE_ALLOC_HOOK_DECLARE struct __Ace {} /* Just need a dummy... */ -# define ACE_ALLOC_HOOK_DEFINE(CLASS) +# define ACE_ALLOC_HOOK_DECLARE struct Ace_ {} /* Just need a dummy... */ +# define ACE_ALLOC_HOOK_DEFINE(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tt(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tc(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tcc(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tccc(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tccct(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tc4(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tc5(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tc6(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tc7(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Ty(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tyc(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tycc(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tcy(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tcyc(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tca(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tco(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tcoccc(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tcs(CLASS) +# define ACE_ALLOC_HOOK_DEFINE_Tmcc(CLASS) # endif /* ACE_HAS_ALLOC_HOOKS */ // ============================================================================ @@ -526,4 +693,29 @@ extern "C" u_long CLS##_Export _get_dll_unload_policy (void) \ # define ACE_HAS_REACTOR_NOTIFICATION_QUEUE #endif +// If config.h declared a lack of process-shared mutexes but was silent about +// process-shared condition variables, ACE must not attempt to use a +// process-shared condition variable (which always requires a mutex too). +#if defined ACE_LACKS_MUTEXATTR_PSHARED && !defined ACE_LACKS_CONDATTR_PSHARED +# define ACE_LACKS_CONDATTR_PSHARED +#endif + +#ifdef ACE_LACKS_CONDATTR_SETCLOCK +# ifdef ACE_HAS_CONDATTR_SETCLOCK +# undef ACE_HAS_CONDATTR_SETCLOCK +# endif +# ifdef ACE_HAS_POSIX_MONOTONIC_CONDITIONS +# undef ACE_HAS_POSIX_MONOTONIC_CONDITIONS +# endif +# ifdef ACE_HAS_MONOTONIC_CONDITIONS +# undef ACE_HAS_MONOTONIC_CONDITIONS +# endif +#endif + +#if defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC) && !defined (ACE_LACKS_CLOCK_MONOTONIC) +# ifndef ACE_HAS_MONOTONIC_TIME_POLICY +# define ACE_HAS_MONOTONIC_TIME_POLICY +# endif +#endif + #endif /* ACE_CONFIG_MACROS_H */ diff --git a/deps/acelite/ace/config-mqx.h b/deps/acelite/ace/config-mqx.h new file mode 100644 index 000000000..da4c5b2ab --- /dev/null +++ b/deps/acelite/ace/config-mqx.h @@ -0,0 +1,509 @@ +#ifndef CONFIG_MQX_H +#define CONFIG_MQX_H + +// This macro is required in order to build the SOCK_Connector_Test +#define ACE_LACKS_GETHOSTENT + +#if defined(ACE_MQX_DLIB_FULL) +# define MQX_SUPPRESS_FILE_DEF 1 +# define MQX_SUPPRESS_STDIO_MACROS 1 +#endif + +#define MQX_STD_TIME_API 0 + +#include +#define _SIGNAL + +#include +#include +#include +#include + +// These headers do not have the proper guards for C++ +extern "C" { +// Allowing p_time.h to be included causes conflicts +// with time.h +#define __p_time_h__ + +#include +#include +#include +#include +} + +#if MQX_STD_TIME_API == 0 +# define ACE_LACKS_LOCALTIME_R +#endif + +#if !defined (ACE_DEFAULT_MAP_SIZE) +# define ACE_DEFAULT_MAP_SIZE 64 +#endif /* ACE_DEFAULT_MAP_SIZE */ + +#if !defined (ACE_MAXLOGMSGLEN) +# define ACE_MAXLOGMSGLEN 1024 +#endif /* ACE_MAXLOGMSGLEN */ + +#if !defined (ACE_DEFAULT_ACCEPTOR_USE_SELECT) +# define ACE_DEFAULT_ACCEPTOR_USE_SELECT 0 +#endif /* ACE_DEFAULT_ACCEPTOR_USE_SELECT */ + +#define ACE_CHDIR_EQUIVALENT MQX_Filesystem::inst().chdir +#define ACE_RMDIR_EQUIVALENT MQX_Filesystem::inst().rmdir +#define ACE_GETCWD_EQUIVALENT MQX_Filesystem::inst().getcwd +#define ACE_UNLINK_EQUIVALENT MQX_Filesystem::inst().unlink +#define ACE_MKDIR_EQUIVALENT MQX_Filesystem::inst().mkdir +#define ACE_RENAME_EQUIVALENT MQX_Filesystem::inst().rename + +#define ACE_MQX +#define ACE_TEMPLATES_REQUIRE_SOURCE +#define ACE_PAGE_SIZE 4096 +#define ACE_SOCKET_LEN uint16_t +#define ACE_SOCKOPT_LEN socklen_t +typedef int SOCKET; + +#define ACE_UNUSED_ARG(X) + +// Add a check for null pointer before calling free(). This is not +// completely necessary, but MQX will set a task error of MQX_INVALID_POINTER +// if we call free with a null pointer. +#define ACE_FREE_FUNC(X) if ((X) != 0) ::free(X) + +#define ACE_USES_SOCKET_H + +#define ACE_LACKS_SIGINFO_H +#define ACE_LACKS_NEW_H +#define ACE_LACKS_UNISTD_H +#define ACE_LACKS_FCNTL_H +#define ACE_LACKS_UCONTEXT_H +#define ACE_LACKS_SEARCH_H +#define ACE_LACKS_PWD_H +#define ACE_LACKS_PTHREAD_H +#define ACE_LACKS_SCHED_H +#define ACE_LACKS_SEMAPHORE_H +#define ACE_LACKS_STROPTS_H +#define ACE_LACKS_DLFCN_H +#define ACE_LACKS_NETDB_H +#define ACE_LACKS_DIRENT_H +#define ACE_LACKS_STRINGS_H +#define ACE_LACKS_SYSLOG_H +#define ACE_LACKS_POLL_H +#define ACE_LACKS_REGEX_H + +#define ACE_LACKS_SYS_TYPES_H +#define ACE_LACKS_SYS_STAT_H +#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_SYS_TIME_H +#define ACE_LACKS_SYS_RESOURCE_H +#define ACE_LACKS_SYS_WAIT_H +#define ACE_LACKS_SYS_UTSNAME_H +#define ACE_LACKS_SYS_MMAN_H +#define ACE_LACKS_SYS_IPC_H +#define ACE_LACKS_SYS_SEM_H +#define ACE_LACKS_SYS_UIO_H +#define ACE_LACKS_SYS_SOCKET_H +#define ACE_LACKS_SYS_IOCTL_H +#define ACE_LACKS_SYS_SELECT_H +#define ACE_LACKS_SYS_UN_H +#define ACE_LACKS_SYS_MSG_H +#define ACE_LACKS_SYS_SHM_H +#define ACE_LACKS_SYS_SYSCTL_H + +#define ACE_LACKS_NETINET_IN_H +#define ACE_LACKS_NETINET_TCP_H +#define ACE_LACKS_NET_IF_H +#define ACE_LACKS_ARPA_INET_H + +#define ACE_HAS_THREADS +#define ACE_HAS_PTHREADS +#define ACE_LACKS_COND_T +#define ACE_LACKS_RWLOCK_T +#define ACE_MT_SAFE 1 +#define ACE_LACKS_SIGPROCMASK +#define ACE_LACKS_CONDATTR +#define ACE_LACKS_PTHREAD_CLEANUP +#define ACE_HAS_SIGINFO_T +#define ACE_HAS_POSIX_SEM +#define ACE_HAS_POSIX_SEM_TIMEOUT +#define ACE_LACKS_PTHREAD_CANCEL +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES +#define ACE_HAS_THREAD_SPECIFIC_STORAGE +#define ACE_LACKS_NAMED_POSIX_SEM +#define ACE_DEFAULT_SEM_KEY { 1234 } +// MQX POSIX has this, but it doesn't appear to work +#define ACE_LACKS_SETINHERITSCHED +typedef pthread_mutex_t ACE_mutex_t; +typedef pthread_mutexattr_t ACE_mutexattr_t; + +#if !defined(ACE_MQX_DLIB_FULL) +#define ACE_LACKS_FGETWC +#define ACE_LACKS_FGETWS +#define ACE_LACKS_FPUTWS +#define ACE_LACKS_FGETPOS +#define ACE_LACKS_FSETPOS +#define ACE_LACKS_FREOPEN +#define ACE_LACKS_FDOPEN +#define ACE_LACKS_FILENO +#define ACE_LACKS_LOCALECONV + +#define BUFSIZ 512 + +#undef ungetc +#undef sscanf +#undef snprintf +#undef vsnprintf +#undef getchar +#undef putchar +#undef status + +#define getc(X) _io_fgetc(X) +#define ungetc(X,Y) _io_fungetc(X,Y) + +#ifdef fgetc +#undef fgetc +inline int fgetc(FILE* f) { + return _io_fgetc(f); +} +#endif +#ifdef fread +#undef fread +inline size_t fread(void* ptr, size_t so, size_t no,FILE* f) { + return (_io_read((f),(ptr),(so)*(no))/(so)); +} +#endif +#ifdef fwrite +#undef fwrite +inline size_t fwrite(const void* ptr, size_t so, size_t no, FILE* f) { + return (_io_write((f),(void*)(ptr),(so)*(no))/(so)); +} +#endif +#ifdef puts +#undef puts +#define def_puts +#endif +#ifdef getline +#undef getline +inline int getline(char* x, int y) { + return _io_fgetline(stdin, x, y); +} +#endif +#ifdef read +#undef read +inline int read(FILE* f, const void* b, int a) { + return _io_read(f, (void*)b, a); +} +#endif +#ifdef write +#undef write +inline int write(FILE* f, void* b, int a) { + return _io_write(f, b, a); +} +#endif +#ifdef printf +#undef printf +#define def_printf +#endif +#ifdef sprintf +#undef sprintf +#define def_sprintf +#endif +#ifdef fprintf +#undef fprintf +inline int fprintf(FILE* s, const char* f, ...) { + va_list argp; + va_start(argp, f); + const int r = _io_vfprintf(s, f, argp); + va_end (argp); + return r; +} +#endif +#ifdef vprintf +#undef vprintf +#define def_vprintf +#endif +#ifdef vsprintf +#undef vsprintf +#define def_vsprintf +#endif +#ifdef vfprintf +#undef vfprintf +inline int vfprintf(FILE* s, const char* f, va_list argp) { + return _io_vfprintf(s, f, argp); +} +#endif +#ifdef fclose +#undef fclose +inline int fclose(FILE* f) { + return _io_fclose(f); +} +#endif +#ifdef fflush +#undef fflush +inline int fflush(FILE* f) { + return _io_fflush(f); +} +#endif +#ifdef fgets +#undef fgets +inline char* fgets(char* b, int a, FILE* f) { + return _io_fgets(b, a, f); +} +#endif +#ifdef fputs +#undef fputs +inline int fputs(const char* s, FILE* f) { + return _io_fputs(s, f); +} +#endif +#ifdef fopen +#undef fopen +inline FILE* fopen(const char* f, const char* m) { + return _io_fopen(f, m); +} +#endif +#ifdef fseek +#undef fseek +inline int fseek(FILE* f, long o, int s) { + return _io_fseek(f, o, s); +} +#endif +#ifdef ftell +#undef ftell +inline int ftell(FILE* f) { + return _io_ftell(f); +} +#endif +#ifdef ioctl +#undef ioctl +inline int ioctl(FILE* f, unsigned int r, void* p) +{ + return _io_ioctl(f, r, p); +} +#endif + +#include + +#ifdef def_printf +#undef def_printf +inline int printf(const char* f, ...) { + va_list argp; + va_start(argp, f); + const int r = _io_vprintf(f, argp); + va_end (argp); + return r; +} +#endif +#ifdef def_sprintf +#undef def_sprintf +inline int sprintf(char* s, const char* f, ...) { + va_list argp; + va_start(argp, f); + const int r = _io_vsprintf(s, f, argp); + va_end (argp); + return r; +} +#endif +#ifdef def_vprintf +#undef def_vprintf +inline int vprintf(const char* f, va_list argp) { + return _io_vprintf(f, argp); +} +#endif +#ifdef def_vsprintf +#undef def_vsprintf +inline int vsprintf(char* s, const char* f, va_list argp) { + return _io_vsprintf(s, f, argp); +} +#endif +#ifdef def_puts +#undef def_puts +inline int puts(const char* str) { + return _io_fputs(str, stdout); +} +#endif +#endif + +#define ACE_HAS_LINGER_MS +#define ACE_HAS_WCHAR +#define ACE_SIZEOF_WCHAR 4 +#define ACE_HAS_SSIZE_T +#define ACE_HAS_SIG_ATOMIC_T +#define ACE_HAS_POSIX_TIME +#define ACE_HAS_SOCKLEN_T +#define ACE_HAS_DIRENT + +#define ACE_NEW_THROWS_EXCEPTIONS +#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB +#define ACE_TEXT_WIN32_FIND_DATA MFS_SEARCH_DATA + +#define ACE_LACKS_UNIX_SIGNALS +#define ACE_LACKS_SO_DONTROUTE +#define ACE_LACKS_WCSDUP +#define ACE_LACKS_WCSTOK +#define ACE_LACKS_ITOW +#define ACE_LACKS_WCSICMP +#define ACE_LACKS_WCSNICMP +#define ACE_LACKS_INET_NTOA +#define ACE_LACKS_RAND_R +#define ACE_LACKS_PUTENV +#define ACE_LACKS_PWD_FUNCTIONS +#define ACE_LACKS_SETSID +#define ACE_LACKS_SETGID +#define ACE_LACKS_GETEGID +#define ACE_LACKS_GETGID +#define ACE_LACKS_GETEUID +#define ACE_LACKS_SETEGID +#define ACE_LACKS_SETEUID +#define ACE_LACKS_SETREUID +#define ACE_LACKS_SETREGID +#define ACE_LACKS_SETUID +#define ACE_LACKS_GETUID +#define ACE_LACKS_GETPGID +#define ACE_LACKS_SETPGID +#define ACE_LACKS_GETPPID +#define ACE_LACKS_GETPID +#define ACE_LACKS_EXEC +#define ACE_LACKS_FORK +#define ACE_LACKS_GETOPT +#define ACE_LACKS_SBRK +#define ACE_LACKS_PIPE +#define ACE_DISABLE_NOTIFY_PIPE_DEFAULT 1 +#define ACE_LACKS_ISATTY +#define ACE_LACKS_ALARM +#define ACE_LACKS_SYSCONF +#define ACE_LACKS_SWAB +#define ACE_LACKS_CADDR_T +#define ACE_LACKS_SETENV +#define ACE_LACKS_UNSETENV +#define ACE_LACKS_CUSERID +#define ACE_LACKS_MADVISE +#define ACE_LACKS_MMAP +#define ACE_LACKS_MPROTECT +#define ACE_LACKS_MSYNC +#define ACE_LACKS_MUNMAP +#define ACE_LACKS_STRPTIME +#define ACE_LACKS_GMTIME_R +#define ACE_LACKS_ASCTIME_R +#define ACE_LACKS_TZSET +#define ACE_LACKS_IOVEC +#define ACE_LACKS_ISASCII +#define ACE_LACKS_ISCTYPE +#define ACE_LACKS_READV +#define ACE_LACKS_WRITEV +#define ACE_LACKS_RECVMSG +#define ACE_LACKS_SENDMSG +#define ACE_LACKS_SOCKETPAIR +#define ACE_LACKS_GETHOSTBYADDR +#define ACE_LACKS_GETHOSTBYADDR_R +#define ACE_LACKS_GETHOSTBYNAME +#define ACE_LACKS_GETSERVBYNAME +#define ACE_LACKS_GETSERVBYNAME_R +#define ACE_LACKS_GAI_STRERROR +#define ACE_LACKS_GETPROTOBYNUMBER +#define ACE_LACKS_GETPROTOBYNUMBER_R +#define ACE_LACKS_GETPROTOBYNAME +#define ACE_LACKS_GETPROTOBYNAME_R +#define ACE_LACKS_STRUCT_DIR +#define ACE_LACKS_HOSTENT +#define ACE_LACKS_PROTOENT +#define ACE_LACKS_SERVENT +#define ACE_LACKS_RLIMIT +#define ACE_LACKS_WAIT +#define ACE_LACKS_WAITPID +#define ACE_LACKS_SIGEMPTYSET +#define ACE_LACKS_SIGADDSET +#define ACE_LACKS_IOSTREAM_TOTALLY +#define ACE_LACKS_ACE_IOSTREAM +#define ACE_LACKS_UNIX_SYSLOG +#define ACE_LACKS_UNAME +#define ACE_LACKS_IFCONF +#define ACE_LACKS_IFREQ +#define ACE_LACKS_STRRECVFD +#define ACE_MKDIR_LACKS_MODE + +// POSIX +#define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE +#define ACE_LACKS_SEMBUF_T +#define ACE_LACKS_UNIX_DOMAIN_SOCKETS +#define ACE_LACKS_KILL +#define NSIG 64 +#define FD_SETSIZE RTCSCFG_FD_SETSIZE +#define FD_SET RTCS_FD_SET +#define FD_CLR RTCS_FD_CLR +#define FD_ZERO RTCS_FD_ZERO +#define FD_ISSET RTCS_FD_ISSET +#define NFDBITS (sizeof (fd_mask) * 8) +typedef long fd_mask; +struct fd_set: public rtcs_fd_set { + fd_set() + : fds_bits(fd_array) { + } + uint32_t* fds_bits; +}; + +// File System Related +#define ACE_LACKS_MKTEMP +#define ACE_LACKS_MKSTEMP +#define ACE_LACKS_ACCESS +#define ACE_LACKS_REALPATH +#define ACE_LACKS_LSTAT +#define ACE_LACKS_MKFIFO +#define ACE_LACKS_UMASK +#define ACE_LACKS_DUP +#define ACE_LACKS_DUP2 +#define ACE_LACKS_FSYNC +#define ACE_LACKS_FTRUNCATE +#define ACE_LACKS_READLINK +#define ACE_LACKS_TRUNCATE +#define ACE_LACKS_TEMPNAM +#define ACE_LACKS_FCNTL +#define ACE_LACKS_REWINDDIR +#define ACE_LACKS_OPENDIR +#define ACE_LACKS_READDIR +#define ACE_LACKS_SEEKDIR +#define ACE_LACKS_TELLDIR +#define ACE_LACKS_CLOSEDIR +#define ACE_LACKS_ALPHASORT + +#define ACE_DEFINE_MISSING_ERRNOS + +#define O_NDELAY 1 + +struct stat +{ + long st_size; + long st_mtime; + long st_mode; + long st_nlink; +}; + +typedef unsigned int uid_t; +typedef unsigned int gid_t; +typedef long off_t; +typedef long loff_t; +typedef unsigned int mode_t; +typedef struct timespec timespec_t; + +struct timeval +{ + int tv_sec; + suseconds_t tv_usec; +}; + +#define MAXSYMLINKS 1 + +#define FIONBIO 0 + +#define S_IFMT 00170000 +#define S_IFREG 00100000 +#define S_IFDIR 00040000 +#define S_IFCHR 00020000 +#define ACE_LACKS_MODE_MASKS + +#define IP_TTL 0 +#define IP_TOS 0 + +#define ACE_IPPROTO_TCP SOL_TCP +#define TCP_NODELAY OPT_NOWAIT + +#endif + diff --git a/deps/acelite/ace/config-posix.h b/deps/acelite/ace/config-posix.h index 781b7a8da..655194e09 100644 --- a/deps/acelite/ace/config-posix.h +++ b/deps/acelite/ace/config-posix.h @@ -58,6 +58,11 @@ # define ACE_HAS_PTHREADS # endif /* ACE_HAS_PTHREADS */ +# if defined (_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION-0 != -1) +# if !defined (ACE_HAS_CONDATTR_SETCLOCK) && !defined (ACE_LACKS_CONDATTR_SETCLOCK) +# define ACE_HAS_CONDATTR_SETCLOCK +# endif +# endif # endif /* _POSIX_THREADS */ # endif /* ACE_HAS_THREADS */ #endif /* !ACE_MT_SAFE */ @@ -68,4 +73,19 @@ # endif /* ACE_HAS_POSIX_MESSAGE_PASSING */ #endif /* _POSIX_MESSAGE_PASSING */ +#if defined (_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 != -1) +# if !defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC) && !defined (ACE_LACKS_CLOCK_MONOTONIC) +# define ACE_HAS_CLOCK_GETTIME_MONOTONIC +# endif +#endif + +#if defined (ACE_HAS_CONDATTR_SETCLOCK) && defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC) +# if !defined (ACE_HAS_POSIX_MONOTONIC_CONDITIONS) +# define ACE_HAS_POSIX_MONOTONIC_CONDITIONS +# endif +# if !defined (ACE_HAS_MONOTONIC_CONDITIONS) +# define ACE_HAS_MONOTONIC_CONDITIONS +# endif +#endif + #endif /* ACE_CONFIG_POSIX_H */ diff --git a/deps/acelite/ace/config-qnx.h b/deps/acelite/ace/config-qnx.h index bedcdd26e..6fd507bad 100644 --- a/deps/acelite/ace/config-qnx.h +++ b/deps/acelite/ace/config-qnx.h @@ -133,7 +133,6 @@ #define ACE_LACKS_SYS_SHM_H #define ACE_LACKS_TIMESPEC_T #define ACE_LACKS_T_ERRNO -#define ACE_LACKS_U_LONGLONG_T #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS #define ACE_HAS_SYS_SOCKIO_H 1 #define ACE_HAS_SYSCTL diff --git a/deps/acelite/ace/config-suncc-common.h b/deps/acelite/ace/config-suncc-common.h index 86677fb64..ff4d38c42 100644 --- a/deps/acelite/ace/config-suncc-common.h +++ b/deps/acelite/ace/config-suncc-common.h @@ -48,5 +48,10 @@ #define ACE_TEMPLATES_REQUIRE_SOURCE +// Solaris Studio 12.4 implements symbol lookup correctly. +#if defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130) +#define ACE_ANY_OPS_USE_NAMESPACE +#endif + #include /**/ "ace/post.h" #endif /* ACE_SUNCC_COMMON_H */ diff --git a/deps/acelite/ace/config-sunos5.10.h b/deps/acelite/ace/config-sunos5.10.h index febdc0e62..99b12cbc6 100644 --- a/deps/acelite/ace/config-sunos5.10.h +++ b/deps/acelite/ace/config-sunos5.10.h @@ -20,6 +20,9 @@ # undef ACE_LACKS_ALPHASORT #endif +#undef ACE_LACKS_GETADDRINFO +#undef ACE_LACKS_GETNAMEINFO + // Solaris 10 offers a useable log2() unlike previous Solaris versions. #if defined (ACE_LACKS_LOG2) # undef ACE_LACKS_LOG2 @@ -56,4 +59,9 @@ #define ACE_HAS_SOLARIS_ATOMIC_LIB +// Solaris Studio 12.4 implements symbol lookup correctly. +#if defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130) +#define ACE_ANY_OPS_USE_NAMESPACE +#endif + #endif /* ACE_CONFIG_H */ diff --git a/deps/acelite/ace/config-sunos5.9.h b/deps/acelite/ace/config-sunos5.9.h index 08fe85252..53cb350fb 100644 --- a/deps/acelite/ace/config-sunos5.9.h +++ b/deps/acelite/ace/config-sunos5.9.h @@ -11,6 +11,8 @@ #include "ace/config-sunos5.8.h" #define ACE_HAS_SENDFILE 1 +#define ACE_LACKS_GETADDRINFO +#define ACE_LACKS_GETNAMEINFO #define ACE_LACKS_THR_CONCURRENCY_FUNCS #endif /* ACE_CONFIG_H */ diff --git a/deps/acelite/ace/config-vxworks.h b/deps/acelite/ace/config-vxworks.h index 9d0ea65e2..e9b35930a 100644 --- a/deps/acelite/ace/config-vxworks.h +++ b/deps/acelite/ace/config-vxworks.h @@ -34,6 +34,8 @@ # elif (_WRS_VXWORKS_MINOR == 9) # define ACE_VXWORKS 0x690 # endif +# elif (_WRS_VXWORKS_MAJOR == 7) +# define ACE_VXWORKS 0x700 # endif # endif #endif /* ! ACE_VXWORKS */ @@ -50,8 +52,10 @@ # include "ace/config-vxworks6.8.h" #elif (ACE_VXWORKS == 0x690) # include "ace/config-vxworks6.9.h" +#elif (ACE_VXWORKS == 0x700) +# include "ace/config-vxworks7.0.h" #else -#error Unknown or unsupported VxWorks version +# error Unknown or unsupported VxWorks version #endif // Adapt to system argument changes added at VxWorks 6.9 and 64-bit. diff --git a/deps/acelite/ace/config-vxworks6.4.h b/deps/acelite/ace/config-vxworks6.4.h index d55dfc193..260c559a5 100644 --- a/deps/acelite/ace/config-vxworks6.4.h +++ b/deps/acelite/ace/config-vxworks6.4.h @@ -88,6 +88,7 @@ // OS-specific configuration #define ACE_HAS_4_4BSD_SENDMSG_RECVMSG #define ACE_HAS_3_PARAM_READDIR_R +#define ACE_HAS_NET_IF_DL_H #define ACE_HAS_NONCONST_GETBY #define ACE_HAS_NONCONST_INET_ADDR #define ACE_HAS_NONCONST_SWAB @@ -269,6 +270,7 @@ #define ACE_LACKS_WCSNCPY #define ACE_LACKS_WCSPBRK #define ACE_LACKS_WCSRCHR + #define ACE_LACKS_WCSRTOMBS #define ACE_LACKS_WCSSPN #define ACE_LACKS_WCSSTR #define ACE_LACKS_WCSTOK diff --git a/deps/acelite/ace/config-vxworks7.0.h b/deps/acelite/ace/config-vxworks7.0.h new file mode 100644 index 000000000..948bfccf9 --- /dev/null +++ b/deps/acelite/ace/config-vxworks7.0.h @@ -0,0 +1,33 @@ +/* -*- C++ -*- */ +// The following configuration file is designed to work for VxWorks +// 7.0 platforms using one of these compilers: +// 1) The GNU g++ compiler that is shipped with VxWorks 7.0 +// (other compilers not yet tested) + +#ifndef ACE_CONFIG_VXWORKS_7_0_H +#define ACE_CONFIG_VXWORKS_7_0_H +#include /**/ "ace/pre.h" + +#if !defined (ACE_VXWORKS) +# define ACE_VXWORKS 0x700 +#endif /* ! ACE_VXWORKS */ + +#include "ace/config-vxworks6.9.h" + +#define ACE_HAS_AUTOMATIC_INIT_FINI + +#if defined ACE_HAS_PTHREADS && !defined __RTP__ +# define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS +#endif + +#ifndef ACE_LACKS_REGEX_H +# define ACE_LACKS_REGEX_H +#endif + +#ifndef __RTP__ +# define ACE_LACKS_ALARM +#endif + +#include /**/ "ace/post.h" +#endif /* ACE_CONFIG_VXWORKS_7_0_H */ + diff --git a/deps/acelite/ace/config-win32-borland.h b/deps/acelite/ace/config-win32-borland.h index 316dcb263..88b54d708 100644 --- a/deps/acelite/ace/config-win32-borland.h +++ b/deps/acelite/ace/config-win32-borland.h @@ -35,11 +35,11 @@ # define ACE_CC_PREPROCESSOR_ARGS "-q -Sl -o%s" #endif -// Automatically define WIN32 macro if the compiler tells us it is our -// target platform. -# if defined (__WIN32__) && !defined (WIN32) +#if !defined (WIN32) +# if defined (__WIN32__) || defined (_WIN32) # define WIN32 1 # endif +#endif // When building a VCL application, the main VCL header file should be // included before anything else. You can define ACE_HAS_VCL=1 in your @@ -48,7 +48,7 @@ # include /**/ # endif -#if defined (__clang__) +#if defined (_WIN64) # define ACE_HAS_BCC64 #else # define ACE_HAS_BCC32 @@ -95,6 +95,7 @@ #define ACE_LACKS_SYS_SEM_H #define ACE_LACKS_SYS_IOCTL_H #define ACE_LACKS_STROPTS_H +#define ACE_LACKS_WCSRTOMBS #undef ACE_LACKS_STRUCT_DIR #undef ACE_LACKS_CLOSEDIR @@ -114,7 +115,6 @@ # define ACE_HAS_TIME_T_LONG_MISMATCH #endif -#define ACE_EXPORT_NESTED_CLASSES 1 #define ACE_HAS_CPLUSPLUS_HEADERS 1 #define ACE_HAS_NONCONST_SELECT_TIMEVAL #define ACE_HAS_SIG_ATOMIC_T @@ -126,8 +126,10 @@ #define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 #define ACE_HAS_NEW_NOTHROW #define ACE_TEMPLATES_REQUIRE_SOURCE 1 -#define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%Lu" -#define ACE_INT64_FORMAT_SPECIFIER_ASCII "%Ld" +#if defined (ACE_HAS_BCC32) +# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%Lu" +# define ACE_INT64_FORMAT_SPECIFIER_ASCII "%Ld" +#endif #define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 #define ACE_USES_STD_NAMESPACE_FOR_ABS 1 #define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS) @@ -143,17 +145,22 @@ # endif /* !__MT__ */ #endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ -#if (__BORLANDC__ <= 0x680) +#if (__BORLANDC__ <= 0x750) # define ACE_LACKS_ISWCTYPE # define ACE_LACKS_ISCTYPE #endif -#if (__BORLANDC__ >= 0x650) && (__BORLANDC__ <= 0x680) +#if (__BORLANDC__ >= 0x640) && (__BORLANDC__ <= 0x750) # define ACE_LACKS_STRTOK_R #endif -#if (__BORLANDC__ <= 0x680) +#if (__BORLANDC__ <= 0x740) # define ACE_LACKS_LOCALTIME_R +# define ACE_LACKS_GMTIME_R +#endif + +#if (__BORLANDC__ <= 0x750) +# define ACE_LACKS_ASCTIME_R #endif #define ACE_WCSDUP_EQUIVALENT ::_wcsdup @@ -164,16 +171,43 @@ #define ACE_HAS_ITOA 1 #if defined (ACE_HAS_BCC64) -# if (__BORLANDC__ < 0x680) +# if (__BORLANDC__ <= 0x730) # define ACE_LACKS_SWAB # endif #endif #if defined (ACE_HAS_BCC32) +// The bcc32 compiler can't handle assembly in inline methods or +// templates (E2211). When we build for pentium optimized and we are inlining +// then we disable inline assembly +# if defined (ACE_HAS_PENTIUM) && defined(__ACE_INLINE__) && !defined(__clang__) +# define ACE_LACKS_INLINE_ASSEMBLY +# endif # define ACE_SIZEOF_LONG_DOUBLE 10 # define ACE_NEEDS_DL_UNDERSCORE #endif +#ifdef __clang__ +# define ACE_ANY_OPS_USE_NAMESPACE +# define ACE_HAS_BUILTIN_BSWAP16 +# define ACE_HAS_BUILTIN_BSWAP32 +# define ACE_HAS_BUILTIN_BSWAP64 +# define ACE_LACKS_INLINE_ASSEMBLY + +# if __cplusplus >= 201103L +# define ACE_HAS_CPP11 +# endif +# if __cplusplus >= 201402L +# define ACE_HAS_CPP14 +# endif +# if __cplusplus >= 201703L +# define ACE_HAS_CPP17 +# endif +# if __cplusplus >= 202002L +# define ACE_HAS_CPP20 +# endif +#endif /* __clang__ */ + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_BORLAND_H */ diff --git a/deps/acelite/ace/config-win32-common.h b/deps/acelite/ace/config-win32-common.h index 0e3a0b96c..31b3bffd3 100644 --- a/deps/acelite/ace/config-win32-common.h +++ b/deps/acelite/ace/config-win32-common.h @@ -40,8 +40,8 @@ # define ACE_WIN64 // MPC template adds _AMD64_ but user projects not generated using MPC -// may want to use _AMD64_ as well. Ensure it's there in all cases. -# ifndef _AMD64_ +// may want to use _AMD64_ as well. Ensure it's there in all non ARM cases +# if !defined (_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) # define _AMD64_ # endif @@ -55,10 +55,6 @@ # endif /* !_FILE_OFFSET_BITS */ #endif /* _WIN64 || WIN64 */ -#if !defined (_WIN32_WINNT) -# define _WIN32_WINNT 0x0501 // pretend it's at least Windows XP or Win2003 -#endif - // If the invoking procedure turned off debugging by setting NDEBUG, then // also set ACE_NDEBUG, unless the user has already set it. #if defined (NDEBUG) @@ -71,7 +67,7 @@ // be defined, if your application uses MFC. // Setting applies to : building ACE // Runtime restrictions: MFC DLLs must be installed -// Additonal notes : If both ACE_HAS_MFC and ACE_MT_SAFE are +// Additional notes : If both ACE_HAS_MFC and ACE_MT_SAFE are // defined, the MFC DLL (not the static lib) // will be used from ACE. #if !defined (ACE_HAS_MFC) @@ -143,7 +139,7 @@ #define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; #define ACE_IMPORT_SINGLETON_DECLARATION(T) extern template class T #define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE ; -#endif /* !__BORLANDC__ */ +#endif /* !ACE_HAS_CUSTOM_EXPORT_MACROS || ACE_HAS_CUSTOM_EXPORT_MACROS==0 */ // Define ACE_HAS_WINSOCK2 to 0 in your config.h file if you do *not* // want to compile with WinSock 2.0. @@ -154,7 +150,7 @@ // By default, we use non-static object manager on Win32. That is, // the object manager is allocated in main's stack memory. If this // does not suit your need, i.e., if your programs depend on the use -// of static object manager, you neet to disable the behavior by adding +// of static object manager, you need to disable the behavior by adding // // #undef ACE_HAS_NONSTATIC_OBJECT_MANAGER // @@ -167,7 +163,7 @@ // either: // // 1. Using static object manager (as described above), however, using -// the non-static object manager is prefered, therefore, +// the non-static object manager is preferred, therefore, // 2. Instantiate the non-static object manager yourself by either 1) // call ACE::init () at the beginning and ACE::fini () at the end, // _or_ 2) instantiate the ACE_Object_Manager in your CWinApp @@ -235,10 +231,15 @@ #define ACE_HAS_DIRENT #define ACE_HAS_MSG +#define ACE_HAS_NONCONST_INET_NTOP #define ACE_HAS_RECURSIVE_MUTEXES #define ACE_HAS_SOCKADDR_MSG_NAME #define ACE_HAS_THREAD_SAFE_ACCEPT +/* MS is phasing out the GetVersion API so let's prepare */ +/* For now all releases still provide it. */ +#define ACE_HAS_WIN32_GETVERSION + /* LACKS dir-related facilities */ #define ACE_LACKS_READDIR_R #define ACE_LACKS_REWINDDIR @@ -248,6 +249,8 @@ #define ACE_LACKS_CLOCKID_T #define ACE_LACKS_CLOCK_REALTIME #define ACE_LACKS_CLOCK_MONOTONIC +#define ACE_HAS_MONOTONIC_TIME_POLICY +#define ACE_HAS_MONOTONIC_CONDITIONS /* LACKS gid/pid/sid/uid facilities */ #define ACE_LACKS_GETPGID @@ -275,6 +278,10 @@ #define ACE_LACKS_GETIPNODEBYNAME_IPV6 #define ACE_LACKS_KILL #define ACE_LACKS_INET_ATON +#if _WIN32_WINNT < 0x0600 +# define ACE_LACKS_INET_NTOP +# define ACE_LACKS_INET_PTON +#endif #define ACE_LACKS_MADVISE #define ACE_LACKS_MKFIFO #define ACE_LACKS_MODE_MASKS @@ -528,9 +535,9 @@ # else # pragma comment(lib, "ws2_32.lib") # pragma comment(lib, "mswsock.lib") -//# if defined (ACE_HAS_IPV6) +# if defined (ACE_HAS_IPV6) # pragma comment(lib, "iphlpapi.lib") -//# endif +# endif # endif /* ACE_HAS_WINCE */ # endif /* _MSC_VER */ @@ -555,6 +562,15 @@ # define ACE_WSOCK_VERSION 1, 1 #endif /* ACE_HAS_WINSOCK2 */ +#if _WIN32_WINNT >= 0x400 +# define ACE_HAS_WIN32_TRYLOCK +#endif +#if _WIN32_WINNT < 0x600 +# define ACE_LACKS_IF_NAMETOINDEX +#endif +#define ACE_LACKS_IF_NAMEINDEX +#define ACE_LACKS_STRUCT_IF_NAMEINDEX + // Platform supports IP multicast on Winsock 2 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) # define ACE_HAS_IP_MULTICAST @@ -563,10 +579,12 @@ #if !defined (ACE_HAS_WINCE) # define ACE_HAS_INTERLOCKED_EXCHANGEADD #endif -#define ACE_HAS_WIN32_TRYLOCK #if !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP) -# define ACE_HAS_SIGNAL_OBJECT_AND_WAIT + +# if _WIN32_WINNT >= 0x400 +# define ACE_HAS_SIGNAL_OBJECT_AND_WAIT +# endif // If CancelIO is undefined get the updated sp2-sdk from MS # define ACE_HAS_CANCEL_IO @@ -654,7 +672,7 @@ #if (WINVER>=0x0600) // Windows Server 2008 definitions go here -// Windows Vista defintions go here +// Windows Vista definitions go here # if ! defined(ACE_DEFAULT_THREAD_KEYS) # define ACE_DEFAULT_THREAD_KEYS 1088 # endif // ! defined(ACE_DEFAULT_THREAD_KEYS) diff --git a/deps/acelite/ace/config-win32-dmc.h b/deps/acelite/ace/config-win32-dmc.h index 832ecf0f9..1a31077a5 100644 --- a/deps/acelite/ace/config-win32-dmc.h +++ b/deps/acelite/ace/config-win32-dmc.h @@ -42,7 +42,6 @@ #define ACE_WCSDUP_EQUIVALENT ::_wcsdup // This section above was extracted from config-win32-msvc -#define ACE_EXPORT_NESTED_CLASSES 1 #define ACE_HAS_CPLUSPLUS_HEADERS 1 #define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 #define ACE_HAS_SIG_ATOMIC_T 1 diff --git a/deps/acelite/ace/config-win32-mingw.h b/deps/acelite/ace/config-win32-mingw.h index 36b61cf48..63a783869 100644 --- a/deps/acelite/ace/config-win32-mingw.h +++ b/deps/acelite/ace/config-win32-mingw.h @@ -87,6 +87,8 @@ #define ACE_LACKS_PDHMSG_H #define ACE_LACKS_STRTOK_R #define ACE_LACKS_LOCALTIME_R +#define ACE_LACKS_GMTIME_R +#define ACE_LACKS_ASCTIME_R #define ACE_HAS_NONCONST_WCSDUP #define ACE_HAS_WINSOCK2_GQOS #define ACE_ISCTYPE_EQUIVALENT ::_isctype diff --git a/deps/acelite/ace/config-win32-mingw64.h b/deps/acelite/ace/config-win32-mingw64.h index 939b2663d..b801b10a7 100644 --- a/deps/acelite/ace/config-win32-mingw64.h +++ b/deps/acelite/ace/config-win32-mingw64.h @@ -122,9 +122,13 @@ #define ACE_LACKS_PDHMSG_H #define ACE_LACKS_STRTOK_R #define ACE_LACKS_LOCALTIME_R +#define ACE_LACKS_GMTIME_R +#define ACE_LACKS_ASCTIME_R #define ACE_HAS_NONCONST_WCSDUP #define ACE_ISCTYPE_EQUIVALENT ::_isctype +#define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE + #define ACE_INT64_FORMAT_SPECIFIER_ASCII "%I64d" #define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%I64u" diff --git a/deps/acelite/ace/config-win32-msvc-14.h b/deps/acelite/ace/config-win32-msvc-14.h index 7aeaf75d5..e674c9703 100644 --- a/deps/acelite/ace/config-win32-msvc-14.h +++ b/deps/acelite/ace/config-win32-msvc-14.h @@ -38,5 +38,19 @@ // Visual Studio 2015 has 3 parameter wcstok #define ACE_HAS_3_PARAM_WCSTOK +// Visual Studio 2015 has adequate C++11 support +#define ACE_HAS_CPP11 + +#define ACE_PUTENV_EQUIVALENT ::_putenv +#define ACE_TEMPNAM_EQUIVALENT ::_tempnam +#define ACE_STRDUP_EQUIVALENT ::_strdup +#define ACE_MKDIR_EQUIVALENT ::_mkdir +#define ACE_ACCESS_EQUIVALENT ::_access +#define ACE_CHDIR_EQUIVALENT ::_chdir +#define ACE_RMDIR_EQUIVALENT ::_rmdir +#define ACE_GETCWD_EQUIVALENT ::_getcwd +#define ACE_SWAB_EQUIVALENT ::_swab +#define ACE_UNLINK_EQUIVALENT ::_unlink + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MSVC_14_H */ diff --git a/deps/acelite/ace/config-win32-msvc-141.h b/deps/acelite/ace/config-win32-msvc-141.h new file mode 100644 index 000000000..c6376395d --- /dev/null +++ b/deps/acelite/ace/config-win32-msvc-141.h @@ -0,0 +1,37 @@ +/* -*- C++ -*- */ +//============================================================================= +/** + * @file config-win32-msvc-141.h + * + * @brief Microsoft Visual C++ 14.1 configuration file. + * + * This file is the ACE configuration file for Microsoft Visual C++ 14.1 (as released with Visual Studio 2017). + * + * @note Do not include this file directly, include config-win32.h instead. + */ +//============================================================================= + +#ifndef ACE_CONFIG_WIN32_MSVC_141_H +#define ACE_CONFIG_WIN32_MSVC_141_H +#include /**/ "ace/pre.h" + +#ifndef ACE_CONFIG_WIN32_H +#error Use config-win32.h in config.h instead of this header +#endif /* ACE_CONFIG_WIN32_H */ + +#ifndef ACE_WIN32_VC141 +# define ACE_WIN32_VC141 +#endif + +#include "ace/config-win32-msvc-14.h" + +#if _MSVC_LANG >= 201402L +# define ACE_HAS_CPP14 +#endif /* _MSVC_LANG >= 201402L */ + +#if _MSVC_LANG >= 201703L +# define ACE_HAS_CPP17 +#endif /* _MSVC_LANG >= 201703L */ + +#include /**/ "ace/post.h" +#endif /* ACE_CONFIG_WIN32_MSVC_141_H */ diff --git a/deps/acelite/ace/config-win32-msvc-142.h b/deps/acelite/ace/config-win32-msvc-142.h new file mode 100644 index 000000000..af47ad9f7 --- /dev/null +++ b/deps/acelite/ace/config-win32-msvc-142.h @@ -0,0 +1,29 @@ +/* -*- C++ -*- */ +//============================================================================= +/** + * @file config-win32-msvc-142.h + * + * @brief Microsoft Visual C++ 14.2 configuration file. + * + * This file is the ACE configuration file for Microsoft Visual C++ 14.2 (as released with Visual Studio 2019). + * + * @note Do not include this file directly, include config-win32.h instead. + */ +//============================================================================= + +#ifndef ACE_CONFIG_WIN32_MSVC_142_H +#define ACE_CONFIG_WIN32_MSVC_142_H +#include /**/ "ace/pre.h" + +#ifndef ACE_CONFIG_WIN32_H +#error Use config-win32.h in config.h instead of this header +#endif /* ACE_CONFIG_WIN32_H */ + +#ifndef ACE_WIN32_VC142 +# define ACE_WIN32_VC142 +#endif + +#include "ace/config-win32-msvc-141.h" + +#include /**/ "ace/post.h" +#endif /* ACE_CONFIG_WIN32_MSVC_142_H */ diff --git a/deps/acelite/ace/config-win32-msvc-7.h b/deps/acelite/ace/config-win32-msvc-7.h index 7aac881e6..9db4d3920 100644 --- a/deps/acelite/ace/config-win32-msvc-7.h +++ b/deps/acelite/ace/config-win32-msvc-7.h @@ -47,7 +47,6 @@ #define ACE_LACKS_STRPTIME #define ACE_LACKS_STRTOK_R -#define ACE_LACKS_LOCALTIME_R #define ACE_HAS_SIG_ATOMIC_T #define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES diff --git a/deps/acelite/ace/config-win32-msvc.h b/deps/acelite/ace/config-win32-msvc.h index dfa1f85da..5736e5691 100644 --- a/deps/acelite/ace/config-win32-msvc.h +++ b/deps/acelite/ace/config-win32-msvc.h @@ -38,7 +38,11 @@ #endif /* _WIN32_WCE */ //FUZZ: disable check_for_msc_ver -#if (_MSC_VER >= 1900) +#if (_MSC_VER >= 1920) +# include "ace/config-win32-msvc-142.h" +#elif (_MSC_VER >= 1910) +# include "ace/config-win32-msvc-141.h" +#elif (_MSC_VER >= 1900) # include "ace/config-win32-msvc-14.h" #elif (_MSC_VER >= 1800) # include "ace/config-win32-msvc-12.h" @@ -99,7 +103,9 @@ #define ACE_LACKS_NETDB_H #define ACE_LACKS_NET_IF_H #define ACE_LACKS_NETINET_IN_H -#define ACE_LACKS_STDINT_H +#if !defined (ACE_WIN32_VC14) +# define ACE_LACKS_STDINT_H +#endif #define ACE_LACKS_STROPTS_H #define ACE_LACKS_SYS_IOCTL_H #define ACE_LACKS_SYS_IPC_H @@ -123,6 +129,10 @@ #define ACE_LACKS_TERMIOS_H #define ACE_LACKS_REGEX_H +#define ACE_LACKS_LOCALTIME_R +#define ACE_LACKS_GMTIME_R +#define ACE_LACKS_ASCTIME_R + #define ACE_INT64_FORMAT_SPECIFIER_ASCII "%I64d" #define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%I64u" diff --git a/deps/acelite/ace/config.h b/deps/acelite/ace/config.h new file mode 100644 index 000000000..13ca2132c --- /dev/null +++ b/deps/acelite/ace/config.h @@ -0,0 +1,14 @@ +#ifndef __ACE_CONFIG_H__ +#define __ACE_CONFIG_H__ + +#if defined(_WIN32) +# include "ace/config-win32.h" +#elif defined(__linux) || defined(__linux__) +# include "ace/config-linux.h" +#elif defined(__FreeBSD__) +# include "ace/config-freebsd.h" +#elif defined(__APPLE__) +# include "ace/config-macosx.h" +#endif + +#endif \ No newline at end of file diff --git a/deps/acelite/ace/os_include/net/os_if.h b/deps/acelite/ace/os_include/net/os_if.h index cdcbacabd..be467aa2b 100644 --- a/deps/acelite/ace/os_include/net/os_if.h +++ b/deps/acelite/ace/os_include/net/os_if.h @@ -24,6 +24,9 @@ #if !defined (ACE_LACKS_NET_IF_H) # include /**/ +# if defined (m_flags) +# undef m_flags +# endif /* m_flags */ # if defined (ACE_HAS_NET_IF_DL_H) # include /**/ # endif /* ACE_HAS_NET_IF_DL_H */ @@ -37,6 +40,7 @@ #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) # include /**/ +# include /**/ #endif /* ACE_HAS_WINSOCK2 */ // Place all additions (especially function declarations) within extern "C" {} @@ -98,6 +102,10 @@ struct ifconf { # define IFF_BROADCAST 0x2 #endif /* IFF_BROADCAST */ +#if defined (ACE_LACKS_STRUCT_IF_NAMEINDEX) +struct if_nameindex { int dummy; }; +#endif + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/deps/acelite/ace/os_include/netinet/os_in.h b/deps/acelite/ace/os_include/netinet/os_in.h index 31d6d650b..f71e75753 100644 --- a/deps/acelite/ace/os_include/netinet/os_in.h +++ b/deps/acelite/ace/os_include/netinet/os_in.h @@ -43,7 +43,7 @@ extern "C" # if defined (ACE_HAS_PHARLAP_RT) # define ACE_IPPROTO_TCP SOL_SOCKET -# else +# elif !defined (ACE_IPPROTO_TCP) # define ACE_IPPROTO_TCP IPPROTO_TCP # endif /* ACE_HAS_PHARLAP_RT */ @@ -93,7 +93,7 @@ extern "C" }; # endif /* ACE_LACKS_IP_MREQ */ -#if !defined (IPPORT_RESERVED) +#if !defined (ACE_HAS_IPPORT_RESERVED) && !defined (IPPORT_RESERVED) # define IPPORT_RESERVED 1024 #endif /* !IPPORT_RESERVED */ diff --git a/deps/acelite/ace/os_include/os_dirent.h b/deps/acelite/ace/os_include/os_dirent.h index b5ce357e8..650fb402d 100644 --- a/deps/acelite/ace/os_include/os_dirent.h +++ b/deps/acelite/ace/os_include/os_dirent.h @@ -64,8 +64,10 @@ struct ACE_DIR { /// The name of the directory we are looking into ACE_TCHAR *directory_name_; +#if !defined (ACE_MQX) /// Remember the handle between calls. HANDLE current_handle_; +#endif /// The struct for the results ACE_DIRENT *dirent_; diff --git a/deps/acelite/ace/os_include/os_errno.h b/deps/acelite/ace/os_include/os_errno.h index 729844d92..d132d7388 100644 --- a/deps/acelite/ace/os_include/os_errno.h +++ b/deps/acelite/ace/os_include/os_errno.h @@ -31,6 +31,10 @@ #include /**/ #endif /* ACE_VXWORKS */ +#ifndef ACE_CUSTOM_ERRNO_BASE +# define ACE_CUSTOM_ERRNO_BASE 1000 +#endif + // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus extern "C" @@ -281,7 +285,7 @@ extern "C" void herror (const char *str); #endif /* ACE_HAS_H_ERRNO */ -#if defined (ACE_LACKS_ERRNO_H) +#if defined (ACE_LACKS_ERRNO_H) || defined (ACE_DEFINE_MISSING_ERRNOS) # if !defined (EPERM) # define EPERM 1 # endif /* EPERM */ @@ -378,7 +382,7 @@ void herror (const char *str); # if !defined (ERANGE) # define ERANGE 34 # endif /* ERANGE */ -# if !defined (EDEADLK) +# if !defined (EDEADLK) && !defined (ACE_MQX) // Conflicts with EILSEQ # define EDEADLK 36 # endif /* EDEADLK */ # if !defined (ENAMETOOLONG) @@ -393,7 +397,38 @@ void herror (const char *str); # if !defined (ENOTEMPTY) # define ENOTEMPTY 41 # endif /* ENOTEMPTY */ -#endif /* ACE_LACKS_ERRNO_H */ +# ifndef ETIME +# define ETIME 62 +# endif +# ifndef ECOMM +# define ECOMM 70 +# endif +# ifndef EAFNOSUPPORT +# define EAFNOSUPPORT 97 +# endif +# ifndef EADDRIUNSE +# define EADDRINUSE 98 +# endif +# ifndef ENETUNREACH +# define ENETUNREACH 101 +# endif +# ifndef ECONNRESET +# define ECONNRESET 104 +# endif +# ifndef ENOBUFS +# define ENOBUFS 105 +# endif +# ifndef EISCONN +# define EISCONN 106 +# endif +# ifndef ECONNREFUSED +# define ECONNREFUSED 111 +# endif +# ifndef EINPROGRESS +# define EINPROGRESS 115 +# endif + +#endif /* ACE_DEFINE_MISSING_ERRNOS */ #if defined (ACE_LACKS_T_ERRNO) extern int t_errno; @@ -425,7 +460,7 @@ extern int t_errno; #endif /* ECOMM */ #if !defined (EDEADLK) -# define EDEADLK 1000 /* Some large number.... */ +# define EDEADLK (ACE_CUSTOM_ERRNO_BASE) + 1 #endif /* !EDEADLK */ #if !defined (ENXIO) /* Needed in SOCK_Dgram_Mcast */ @@ -448,6 +483,15 @@ extern int t_errno; # define ECANCELED 125 #endif /* ECANCELED */ +#ifndef ESHUTDOWN +#define ESHUTDOWN ECANCELED +#endif + +#ifdef ACE_MQX +# define EWOULDBLOCK EAGAIN +# define ELOOP (ACE_CUSTOM_ERRNO_BASE) + 2 +#endif + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/deps/acelite/ace/os_include/os_netdb.h b/deps/acelite/ace/os_include/os_netdb.h index 716bf5725..320e8f191 100644 --- a/deps/acelite/ace/os_include/os_netdb.h +++ b/deps/acelite/ace/os_include/os_netdb.h @@ -24,6 +24,7 @@ #include "ace/os_include/netinet/os_in.h" #include "ace/os_include/os_limits.h" +#include "ace/os_include/sys/os_socket.h" // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus @@ -63,6 +64,55 @@ struct servent { }; #endif /* ACE_LACKS_SERVENT */ +#ifdef ACE_LACKS_ADDRINFO + struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + ACE_SOCKET_LEN ai_addrlen; + sockaddr *ai_addr; + char *ai_canonname; + addrinfo *ai_next; + }; +#endif + +#ifndef AI_V4MAPPED +# define AI_V4MAPPED 0x8 +#endif + +#ifndef AI_ADDRCONFIG +# define AI_ADDRCONFIG 0x20 +#endif + +#ifndef EAI_NONAME +# define EAI_NONAME -2 /* Error result from getaddrinfo(): no addr for name */ +#endif + +#ifndef EAI_AGAIN +# define EAI_AGAIN -3 /* Error result from getaddrinfo(): try again later */ +#endif + +#ifndef EAI_FAIL +# define EAI_FAIL -4 /* Error result from getaddrinfo(): non-recoverable */ +#endif + +#ifndef EAI_FAMILY +# define EAI_FAMILY -6 /* Error result from getaddrinfo(): family not supp. */ +#endif + +#ifndef EAI_MEMORY +# define EAI_MEMORY -10 /* Error result from getaddrinfo(): out of memory */ +#endif + +#ifndef EAI_SYSTEM +# define EAI_SYSTEM -11 /* Error result from getaddrinfo(): see errno */ +#endif + +#ifndef EAI_OVERFLOW +# define EAI_OVERFLOW -12 /* Error result from getaddrinfo(): buffer overflow */ +#endif + #if defined (ACE_HAS_STRUCT_NETDB_DATA) typedef char ACE_HOSTENT_DATA[sizeof(struct hostent_data)]; typedef char ACE_SERVENT_DATA[sizeof(struct servent_data)]; diff --git a/deps/acelite/ace/os_include/os_pthread.h b/deps/acelite/ace/os_include/os_pthread.h index b88b800cf..5693cb880 100644 --- a/deps/acelite/ace/os_include/os_pthread.h +++ b/deps/acelite/ace/os_include/os_pthread.h @@ -35,6 +35,7 @@ #endif /* ACE_HAS_PRIOCNTL */ #include "ace/os_include/sys/os_types.h" +#include "ace/os_include/os_stdint.h" // This needs to go here *first* to avoid problems with AIX. # if defined (ACE_HAS_PTHREADS) @@ -43,11 +44,8 @@ # undef ACE_DONT_INCLUDE_ACE_SIGNAL_H # endif /* ACE_HAS_PTHREADS */ - #if !defined (ACE_LACKS_PTHREAD_H) - extern "C" { # include /**/ - } #endif /* !ACE_LACKS_PTHREAD_H */ #if defined (ACE_HAS_PTHREAD_NP_H) @@ -294,7 +292,7 @@ # define THR_EXPLICIT_SCHED 0x00800000 # define THR_SCHED_IO 0x01000000 -# if !defined (ACE_HAS_STHREADS) +# if !defined (ACE_HAS_STHREADS) && !defined (ACE_MQX) # if !defined (ACE_HAS_POSIX_SEM) && !defined (ACE_USES_FIFO_SEM) // This needs to be moved out of here. @@ -339,7 +337,7 @@ public: # endif /* !ACE_HAS_POSIX_SEM */ # endif /* !ACE_HAS_STHREADS */ -# if defined (ACE_HAS_PTHREADS_UNIX98_EXT) +# if defined (ACE_HAS_PTHREADS_UNIX98_EXT) && !defined (ACE_LACKS_RWLOCK_T) typedef pthread_rwlock_t ACE_rwlock_t; # endif /* ACE_HAS_PTHREADS_UNIX98_EXT */ diff --git a/deps/acelite/ace/os_include/os_sched.h b/deps/acelite/ace/os_include/os_sched.h index c69b75315..7880bd3f1 100644 --- a/deps/acelite/ace/os_include/os_sched.h +++ b/deps/acelite/ace/os_include/os_sched.h @@ -37,7 +37,7 @@ extern "C" #if !defined (__cpu_set_t_defined) || !defined (ACE_HAS_CPU_SET_T) #if defined (ACE_HAS_CPUSET_T) typedef cpuset_t cpu_set_t; -#else +#elif !defined (ACE_HAS_CPU_SET_T) # define ACE_CPU_SETSIZE 1024 typedef struct { diff --git a/deps/acelite/ace/os_include/os_semaphore.h b/deps/acelite/ace/os_include/os_semaphore.h index ef9cf00a0..98e5f2109 100644 --- a/deps/acelite/ace/os_include/os_semaphore.h +++ b/deps/acelite/ace/os_include/os_semaphore.h @@ -50,6 +50,11 @@ extern "C" /// POSIX semaphore, else its an unnamed POSIX semaphore). char *name_; + /// Do not unlink the named semaphore. This lets the logical entity + /// of the semaphore outlive any one process that opens it. The semaphore + /// must be manually unlinked with ACE_OS::sema_unlink(). + bool avoid_unlink_; + # if defined (ACE_LACKS_NAMED_POSIX_SEM) /// this->sema_ doesn't always get created dynamically if a platform /// doesn't support named posix semaphores. We use this flag to diff --git a/deps/acelite/ace/os_include/os_stdint.h b/deps/acelite/ace/os_include/os_stdint.h index 1c9bc20b7..d2150b1db 100644 --- a/deps/acelite/ace/os_include/os_stdint.h +++ b/deps/acelite/ace/os_include/os_stdint.h @@ -34,7 +34,8 @@ extern "C" // BSD style types #if defined (ACE_LACKS_SYS_TYPES_H) \ - || (defined (__GLIBC__) && !defined (_BSD_SOURCE)) + || (defined (__GLIBC__) && !defined (_BSD_SOURCE)) \ + || defined (ACE_LACKS_BSD_TYPES) typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; diff --git a/deps/acelite/ace/os_include/os_stdlib.h b/deps/acelite/ace/os_include/os_stdlib.h index d08af453c..fbeec6809 100644 --- a/deps/acelite/ace/os_include/os_stdlib.h +++ b/deps/acelite/ace/os_include/os_stdlib.h @@ -23,6 +23,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/os_include/os_stddef.h" +#include "ace/os_include/os_stdint.h" #include "ace/os_include/sys/os_wait.h" #if defined (ACE_HAS_ALLOCA_H) diff --git a/deps/acelite/ace/os_include/os_stropts.h b/deps/acelite/ace/os_include/os_stropts.h index 3312bbc77..4ed4c4b44 100644 --- a/deps/acelite/ace/os_include/os_stropts.h +++ b/deps/acelite/ace/os_include/os_stropts.h @@ -87,6 +87,18 @@ extern "C" # define SIOCGIFADDR 0 # endif /* SIOCGIFADDR */ +# if !defined (SIOCGIFCONF) +# define SIOCGIFCONF 0 +# endif /* SIOCGIFCONF */ + +# if !defined (SIOCGIFFLAGS) +# define SIOCGIFFLAGS 0 +# endif /* SIOCGIFFLAGS */ + +# if !defined (SIOCGIFHWADDR) +# define SIOCGIFHWADDR 0 +# endif /* SIOCGIFHWADDR */ + # if !defined (ACE_HAS_STRBUF_T) struct strbuf { diff --git a/deps/acelite/ace/os_include/os_unistd.h b/deps/acelite/ace/os_include/os_unistd.h index 942a40c43..55235d303 100644 --- a/deps/acelite/ace/os_include/os_unistd.h +++ b/deps/acelite/ace/os_include/os_unistd.h @@ -51,6 +51,18 @@ # include /**/ #endif /* ACE_VXWORKS */ +#ifdef ACE_MQX +# if !defined (STDIN_FILENO) && defined (_LLIO_STDIN) +# define STDIN_FILENO (_LLIO_STDIN) +# endif +# if !defined (STDOUT_FILENO) && defined (_LLIO_STDOUT) +# define STDOUT_FILENO (_LLIO_STDOUT) +# endif +# if !defined (STDERR_FILENO) && defined (_LLIO_STDERR) +# define STDERR_FILENO (_LLIO_STDERR) +# endif +#endif + // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus extern "C" diff --git a/deps/acelite/ace/os_include/sys/os_sem.h b/deps/acelite/ace/os_include/sys/os_sem.h index 1b3cc860a..7efec988f 100644 --- a/deps/acelite/ace/os_include/sys/os_sem.h +++ b/deps/acelite/ace/os_include/sys/os_sem.h @@ -23,6 +23,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/os_include/sys/os_ipc.h" +#include "ace/os_include/os_stdint.h" #if !defined (ACE_LACKS_SYS_SEM_H) # include /**/ diff --git a/deps/acelite/ace/os_include/sys/os_socket.h b/deps/acelite/ace/os_include/sys/os_socket.h index 19b0eadb7..8f134c576 100644 --- a/deps/acelite/ace/os_include/sys/os_socket.h +++ b/deps/acelite/ace/os_include/sys/os_socket.h @@ -28,6 +28,10 @@ # include /**/ #endif /* !ACE_LACKS_SYS_SOCKET_H */ +#if defined (ACE_USES_SOCKET_H) +# include /**/ +#endif /* ACE_USES_SOCKET_H */ + #if defined (ACE_USES_SOCKLIB_H) # include /**/ #endif /* ACE_USES_SOCKLIB_H */ @@ -73,7 +77,7 @@ extern "C" struct msghdr { /// Optional address - sockaddr * msg_name; + sockaddr *msg_name; /// Size of address int msg_namelen; @@ -88,9 +92,49 @@ extern "C" caddr_t msg_accrights; int msg_accrightslen; + + /// Control messages, set msg_control to 0 if not using: + void *msg_control; + int msg_controllen; }; + + typedef WSACMSGHDR cmsghdr; #endif /* ACE_WIN32 */ + // Using msghdr::msg_control and msghdr::msg_controllen portably: + // For a parameter of size n, reserve space for ACE_CMSG_SPACE(n) bytes. + // This can be extended to the sum of ACE_CMSG_SPACE(n_i) for multiple + // parameters. + // Pass that buffer's address and length as msg_control/msg_controllen when + // invoking sendmsg/recvmsg. The buffer's address must be aligned to hold an + // object of type cmsghdr at the beginning of the buffer. + // If the send or recv succeeds, examine the + // resulting cmsg structure using the following macros with signatures: + // cmsghdr *ACE_CMSG_FIRSTHDR(msghdr *m) + // cmsghdr *ACE_CMSG_NXTHDR(msghdr *m, cmsghdr *c) + // unsigned char *ACE_CMSG_DATA(cmsghdr *c) + +#ifdef ACE_WIN32 +# define ACE_CMSG_SPACE WSA_CMSG_SPACE +# define ACE_CMSG_FIRSTHDR(msg) \ + (((unsigned) (msg)->msg_controllen >= sizeof (WSACMSGHDR)) \ + ? (LPWSACMSGHDR) (msg)->msg_control : (LPWSACMSGHDR) 0) +# define ACE_CMSG_NXTHDR(msg, cmsg) \ + (((cmsg) == 0) ? ACE_CMSG_FIRSTHDR (msg) \ + : ((((PUCHAR) (cmsg) + WSA_CMSGHDR_ALIGN ((cmsg)->cmsg_len) \ + + sizeof (WSACMSGHDR)) > (PUCHAR) ((msg)->msg_control) \ + + (msg)->msg_controllen) \ + ? (LPWSACMSGHDR) 0 \ + : (LPWSACMSGHDR) ((PUCHAR) (cmsg) \ + + WSA_CMSGHDR_ALIGN ((cmsg)->cmsg_len)))) +# define ACE_CMSG_DATA WSA_CMSG_DATA +#else +# define ACE_CMSG_SPACE CMSG_SPACE +# define ACE_CMSG_FIRSTHDR CMSG_FIRSTHDR +# define ACE_CMSG_NXTHDR CMSG_NXTHDR +# define ACE_CMSG_DATA CMSG_DATA +#endif + #if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) // Control message size to pass a file descriptor. # define ACE_BSD_CONTROL_MSG_LEN sizeof (struct cmsghdr) + sizeof (ACE_HANDLE) @@ -215,6 +259,7 @@ extern "C" #define ACE_HAS_SOCK_BUF_SIZE_MAX_VALUE SSIZE_MAX #endif /* ACE_HAS_SOCK_BUF_SIZE_MAX_VALUE */ +#if !defined (ACE_SOCKET_LEN) #if defined (ACE_HAS_SOCKLEN_T) # if defined (__hpux) /* @@ -240,6 +285,7 @@ typedef size_t ACE_SOCKET_LEN; #else typedef int ACE_SOCKET_LEN; #endif /* ACE_HAS_SIZET_SOCKET_LEN */ +#endif /* ACE_SOCKET_LEN */ #if defined (ACE_HAS_NETLINK) # include /**/ diff --git a/deps/acelite/ace/os_include/sys/os_types.h b/deps/acelite/ace/os_include/sys/os_types.h index bff05e48e..94acc1d25 100644 --- a/deps/acelite/ace/os_include/sys/os_types.h +++ b/deps/acelite/ace/os_include/sys/os_types.h @@ -74,10 +74,9 @@ typedef double ACE_timer_t; typedef offset_t ACE_LOFF_T; #elif defined (WIN32) typedef __int64 ACE_LOFF_T; -#elif (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x690)) || \ +#elif (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x700)) || \ defined (ACE_LYNXOS_MAJOR) || \ - (defined (ACE_OPENVMS) && !defined (_LARGEFILE)) || \ - defined (__TANDEM) + (defined (ACE_OPENVMS) && !defined (_LARGEFILE)) typedef long long ACE_LOFF_T; #else typedef loff_t ACE_LOFF_T; diff --git a/deps/acelite/ace/post.h b/deps/acelite/ace/post.h index b08fe02ad..bea9b56ef 100644 --- a/deps/acelite/ace/post.h +++ b/deps/acelite/ace/post.h @@ -15,7 +15,7 @@ # pragma pack (pop) #elif defined (__BORLANDC__) # pragma option pop -# if (__BORLANDC__ >= 0x660) && (__BORLANDC__ <= 0x680) +# if (__BORLANDC__ >= 0x660) && (__BORLANDC__ <= 0x730) # pragma option pop # endif # pragma nopushoptwarn diff --git a/deps/acelite/ace/pre.h b/deps/acelite/ace/pre.h index 647fa3d67..ccb8c553b 100644 --- a/deps/acelite/ace/pre.h +++ b/deps/acelite/ace/pre.h @@ -17,7 +17,7 @@ # pragma pack (push, 8) #elif defined (__BORLANDC__) # pragma option push -a8 -b -Ve- -Vx- -w-rvl -w-rch -w-ccc -w-obs -w-aus -w-pia -w-inl -w-sig -# if (__BORLANDC__ >= 0x660) && (__BORLANDC__ <= 0x680) +# if (__BORLANDC__ >= 0x660) && (__BORLANDC__ <= 0x730) // False warning: Function defined with different linkage, reported to // Embarcadero as QC 117740 # pragma option push -w-8127 diff --git a/deps/acelite/ace/svcconfgen.mpc b/deps/acelite/ace/svcconfgen.mpc index c90153709..6129aad98 100644 --- a/deps/acelite/ace/svcconfgen.mpc +++ b/deps/acelite/ace/svcconfgen.mpc @@ -4,8 +4,8 @@ project(ace_svcconf_gen) { verbatim(gnuace, local) { "Svc_Conf_y.cpp: Svc_Conf.y" "ifeq ($(notdir $(YACC)), bison)" - " $(YACC) -l -d Svc_Conf.y" - " sed -e 's/fprintf/ACE_OS::fprintf/g' \\" // Use ACE's fprintf, not library's + " $(YACC) -l -d Svc_Conf.y" + " sed -e 's/fprintf/ACE_OS::fprintf/g' \\" // Use ACE's fprintf, not library's " -e 's/\\t/ /g' \\" // Eliminate tabs (replace with 2 spaces) " -e 's/yy/ace_yy/g' \\" " -e 's/->ace_yyerrno/->yyerrno/g' \\" // This reverses the ace_ prefix where it @@ -16,18 +16,18 @@ project(ace_svcconf_gen) { " -e 's/ace_yyerror[ ]*([ ]*YY_/ace_yyerror (ACE_SVC_CONF_PARAM->yyerrno, ACE_SVC_CONF_PARAM->yylineno, YY_/g' \\" " -e 's@#include @@' \\" " -e 's/Svc_Conf\\.tab\\.c/Svc_Conf_y.cpp/g' $@" - " $(RM) -f Svc_Conf.tab.c Svc_Conf_y.cpp.orig" + " $(RM) -f Svc_Conf.tab.c Svc_Conf_y.cpp.orig" "else" - " @echo 'ERROR: You must use bison 1.35 or higher to process this file'" - " @/bin/false" + " @echo 'ERROR: You must use bison 1.35 or higher to process this file'" + " @/bin/false" "endif" "Svc_Conf_Token_Table.h: Svc_Conf.y Svc_Conf_y.cpp" "ifeq ($(notdir $(YACC)), bison)" - " mv Svc_Conf.tab.h Svc_Conf_Token_Table.h" + " mv Svc_Conf.tab.h Svc_Conf_Token_Table.h" "else" - " @echo 'ERROR: You must use bison 1.35 or higher to process this file'" - " @/bin/false" + " @echo 'ERROR: You must use bison 1.35 or higher to process this file'" + " @/bin/false" "endif" } } diff --git a/src/common/Common.h b/src/common/Common.h index 9b8779f66..e6495db5a 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -107,7 +107,6 @@ #define I32FMT "%08I32X" #define I64FMT "%016I64X" -#define snprintf _snprintf #define atoll _atoi64 #define vsnprintf _vsnprintf #define llabs _abs64