zeroc-ice 3.6b1 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{ext/ice/BZIP_LICENSE → BZIP2_LICENSE} +0 -0
- data/ICE_LICENSE +8 -14
- data/LICENSE +2 -1
- data/{ext/ice/MCPP_LICENSE → MCPP_LICENSE} +2 -9
- data/bin/slice2rb +1 -1
- data/ext/Communicator.cpp +1 -1
- data/ext/Communicator.h +1 -1
- data/ext/Config.h +1 -22
- data/ext/Connection.cpp +125 -13
- data/ext/Connection.h +1 -1
- data/ext/Endpoint.cpp +62 -3
- data/ext/Endpoint.h +1 -1
- data/ext/ImplicitContext.cpp +1 -1
- data/ext/ImplicitContext.h +1 -1
- data/ext/Init.cpp +8 -1
- data/ext/Logger.cpp +1 -1
- data/ext/Logger.h +1 -1
- data/ext/ObjectFactory.cpp +1 -1
- data/ext/ObjectFactory.h +1 -1
- data/ext/Operation.cpp +1 -1
- data/ext/Operation.h +1 -1
- data/ext/Properties.cpp +1 -1
- data/ext/Properties.h +1 -1
- data/ext/Proxy.cpp +1 -1
- data/ext/Proxy.h +1 -1
- data/ext/Slice.cpp +1 -1
- data/ext/Slice.h +1 -1
- data/ext/Types.cpp +65 -17
- data/ext/Types.h +4 -1
- data/ext/Util.cpp +49 -58
- data/ext/Util.h +1 -1
- data/ext/extconf.rb +17 -15
- data/ext/ice/cpp/include/Ice/ACMF.h +1 -1
- data/ext/ice/cpp/include/Ice/Application.h +1 -1
- data/ext/ice/cpp/include/Ice/AsyncResult.h +1 -1
- data/ext/ice/cpp/include/Ice/AsyncResultF.h +1 -1
- data/ext/ice/cpp/include/Ice/BasicStream.h +1 -1
- data/ext/ice/cpp/include/Ice/BatchRequestInterceptor.h +52 -0
- data/ext/ice/cpp/include/Ice/BatchRequestQueueF.h +25 -0
- data/ext/ice/cpp/include/Ice/Buffer.h +1 -1
- data/ext/ice/cpp/include/Ice/BuiltinSequences.h +12 -4
- data/ext/ice/cpp/include/Ice/Communicator.h +12 -4
- data/ext/ice/cpp/include/Ice/CommunicatorAsync.h +1 -1
- data/ext/ice/cpp/include/Ice/CommunicatorF.h +12 -4
- data/ext/ice/cpp/include/Ice/Config.h +13 -8
- data/ext/ice/cpp/include/Ice/Connection.h +41 -16
- data/ext/ice/cpp/include/Ice/ConnectionAsync.h +1 -1
- data/ext/ice/cpp/include/Ice/ConnectionF.h +12 -4
- data/ext/ice/cpp/include/Ice/ConnectionFactoryF.h +1 -1
- data/ext/ice/cpp/include/Ice/ConnectionIF.h +1 -1
- data/ext/ice/cpp/include/Ice/Current.h +12 -4
- data/ext/ice/cpp/include/Ice/DefaultObjectFactory.h +1 -1
- data/ext/ice/cpp/include/Ice/DeprecatedStringConverter.h +1 -1
- data/ext/ice/cpp/include/Ice/DispatchInterceptor.h +1 -1
- data/ext/ice/cpp/include/Ice/Dispatcher.h +1 -1
- data/ext/ice/cpp/include/Ice/DynamicLibrary.h +1 -1
- data/ext/ice/cpp/include/Ice/DynamicLibraryF.h +1 -1
- data/ext/ice/cpp/include/Ice/Endpoint.h +16 -6
- data/ext/ice/cpp/include/Ice/EndpointF.h +12 -4
- data/ext/ice/cpp/include/Ice/EndpointTypes.h +12 -4
- data/ext/ice/cpp/include/Ice/Exception.h +3 -3
- data/ext/ice/cpp/include/Ice/FacetMap.h +12 -4
- data/ext/ice/cpp/include/Ice/FactoryTable.h +1 -1
- data/ext/ice/cpp/include/Ice/FactoryTableInit.h +1 -1
- data/ext/ice/cpp/include/Ice/Format.h +1 -1
- data/ext/ice/cpp/include/Ice/Functional.h +1 -1
- data/ext/ice/cpp/include/Ice/GCObject.h +5 -1
- data/ext/ice/cpp/include/Ice/Handle.h +1 -1
- data/ext/ice/cpp/include/Ice/Ice.h +4 -3
- data/ext/ice/cpp/include/Ice/Identity.h +13 -5
- data/ext/ice/cpp/include/Ice/ImplicitContext.h +12 -4
- data/ext/ice/cpp/include/Ice/ImplicitContextF.h +12 -4
- data/ext/ice/cpp/include/Ice/Incoming.h +1 -1
- data/ext/ice/cpp/include/Ice/IncomingAsync.h +1 -1
- data/ext/ice/cpp/include/Ice/IncomingAsyncF.h +1 -1
- data/ext/ice/cpp/include/Ice/Initialize.h +4 -2
- data/ext/ice/cpp/include/Ice/InstanceF.h +1 -1
- data/ext/ice/cpp/include/Ice/Instrumentation.h +12 -4
- data/ext/ice/cpp/include/Ice/InstrumentationF.h +12 -4
- data/ext/ice/cpp/include/Ice/LocalException.h +12 -4
- data/ext/ice/cpp/include/Ice/LocalObject.h +1 -1
- data/ext/ice/cpp/include/Ice/LocalObjectF.h +1 -1
- data/ext/ice/cpp/include/Ice/Locator.h +137 -129
- data/ext/ice/cpp/include/Ice/LocatorF.h +12 -4
- data/ext/ice/cpp/include/Ice/Logger.h +12 -4
- data/ext/ice/cpp/include/Ice/LoggerF.h +12 -4
- data/ext/ice/cpp/include/Ice/LoggerUtil.h +1 -1
- data/ext/ice/cpp/include/Ice/Metrics.h +144 -136
- data/ext/ice/cpp/include/Ice/MetricsAdminI.h +1 -1
- data/ext/ice/cpp/include/Ice/MetricsFunctional.h +1 -1
- data/ext/ice/cpp/include/Ice/MetricsObserverI.h +35 -26
- data/ext/ice/cpp/include/Ice/NativePropertiesAdmin.h +1 -1
- data/ext/ice/cpp/include/Ice/Object.h +1 -1
- data/ext/ice/cpp/include/Ice/ObjectAdapter.h +12 -4
- data/ext/ice/cpp/include/Ice/ObjectAdapterF.h +12 -4
- data/ext/ice/cpp/include/Ice/ObjectAdapterFactoryF.h +1 -1
- data/ext/ice/cpp/include/Ice/ObjectF.h +1 -1
- data/ext/ice/cpp/include/Ice/ObjectFactory.h +12 -4
- data/ext/ice/cpp/include/Ice/ObjectFactoryF.h +12 -4
- data/ext/ice/cpp/include/Ice/ObjectFactoryManagerF.h +1 -1
- data/ext/ice/cpp/include/Ice/ObserverHelper.h +1 -1
- data/ext/ice/cpp/include/Ice/Outgoing.h +67 -39
- data/ext/ice/cpp/include/Ice/OutgoingAsync.h +31 -34
- data/ext/ice/cpp/include/Ice/OutgoingAsyncF.h +4 -4
- data/ext/ice/cpp/include/Ice/Plugin.h +12 -4
- data/ext/ice/cpp/include/Ice/PluginF.h +12 -4
- data/ext/ice/cpp/include/Ice/Process.h +36 -28
- data/ext/ice/cpp/include/Ice/ProcessF.h +12 -4
- data/ext/ice/cpp/include/Ice/Properties.h +12 -4
- data/ext/ice/cpp/include/Ice/PropertiesAdmin.h +86 -78
- data/ext/ice/cpp/include/Ice/PropertiesF.h +12 -4
- data/ext/ice/cpp/include/Ice/Protocol.h +1 -1
- data/ext/ice/cpp/include/Ice/Proxy.h +6 -2
- data/ext/ice/cpp/include/Ice/ProxyF.h +1 -1
- data/ext/ice/cpp/include/Ice/ProxyFactoryF.h +1 -1
- data/ext/ice/cpp/include/Ice/ProxyHandle.h +1 -1
- data/ext/ice/cpp/include/Ice/ReferenceF.h +1 -1
- data/ext/ice/cpp/include/Ice/RemoteLogger.h +137 -129
- data/ext/ice/cpp/include/Ice/RequestHandlerF.h +1 -1
- data/ext/ice/cpp/include/Ice/ResponseHandlerF.h +1 -1
- data/ext/ice/cpp/include/Ice/Router.h +37 -29
- data/ext/ice/cpp/include/Ice/RouterF.h +12 -4
- data/ext/ice/cpp/include/Ice/ServantLocator.h +12 -4
- data/ext/ice/cpp/include/Ice/ServantLocatorF.h +12 -4
- data/ext/ice/cpp/include/Ice/ServantManagerF.h +1 -1
- data/ext/ice/cpp/include/Ice/Service.h +1 -1
- data/ext/ice/cpp/include/Ice/SliceChecksumDict.h +12 -4
- data/ext/ice/cpp/include/Ice/SliceChecksums.h +1 -1
- data/ext/ice/cpp/include/Ice/SlicedData.h +1 -6
- data/ext/ice/cpp/include/Ice/SlicedDataF.h +1 -1
- data/ext/ice/cpp/include/Ice/Stream.h +3 -5
- data/ext/ice/cpp/include/Ice/StreamF.h +1 -1
- data/ext/ice/cpp/include/Ice/StreamHelpers.h +1 -1
- data/ext/ice/cpp/include/Ice/ThreadPoolF.h +1 -1
- data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +1 -1
- data/ext/ice/cpp/include/Ice/Version.h +14 -6
- data/ext/ice/cpp/include/IceSSL/Config.h +19 -1
- data/ext/ice/cpp/include/IceSSL/ConnectionInfo.h +61 -7
- data/ext/ice/cpp/include/IceSSL/EndpointInfo.h +52 -5
- data/ext/ice/cpp/include/IceSSL/IceSSL.h +2 -2
- data/ext/ice/cpp/include/IceSSL/Plugin.h +32 -26
- data/ext/ice/cpp/include/IceUtil/AbstractMutex.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Atomic.h +186 -0
- data/ext/ice/cpp/include/IceUtil/Cache.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Cond.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Config.h +31 -20
- data/ext/ice/cpp/include/IceUtil/CountDownLatch.h +1 -1
- data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +1 -1
- data/ext/ice/cpp/include/IceUtil/DisableWarnings.h +9 -2
- data/ext/ice/cpp/include/IceUtil/Exception.h +4 -3
- data/ext/ice/cpp/include/IceUtil/Functional.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Handle.h +1 -1
- data/ext/ice/cpp/include/IceUtil/IceUtil.h +2 -2
- data/ext/ice/cpp/include/IceUtil/IconvStringConverter.h +1 -1
- data/ext/ice/cpp/include/IceUtil/InputUtil.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Iterator.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Lock.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Monitor.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Mutex.h +1 -1
- data/ext/ice/cpp/include/IceUtil/MutexProtocol.h +1 -1
- data/ext/ice/cpp/include/IceUtil/MutexPtrLock.h +1 -1
- data/ext/ice/cpp/include/IceUtil/MutexPtrTryLock.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Optional.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Options.h +1 -1
- data/ext/ice/cpp/include/IceUtil/OutputUtil.h +8 -11
- data/ext/ice/cpp/include/IceUtil/PopDisableWarnings.h +1 -1
- data/ext/ice/cpp/include/IceUtil/PushDisableWarnings.h +5 -1
- data/ext/ice/cpp/include/IceUtil/Random.h +1 -1
- data/ext/ice/cpp/include/IceUtil/RecMutex.h +1 -1
- data/ext/ice/cpp/include/IceUtil/SHA1.h +8 -26
- data/ext/ice/cpp/include/IceUtil/ScannerConfig.h +5 -5
- data/ext/ice/cpp/include/IceUtil/ScopedArray.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Shared.h +3 -37
- data/ext/ice/cpp/include/IceUtil/StringUtil.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Thread.h +1 -1
- data/ext/ice/cpp/include/IceUtil/ThreadException.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Time.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Timer.h +1 -1
- data/ext/ice/cpp/include/IceUtil/UUID.h +1 -1
- data/ext/ice/cpp/include/IceUtil/UndefSysMacros.h +1 -1
- data/ext/ice/cpp/include/IceUtil/UniquePtr.h +1 -1
- data/ext/ice/cpp/include/Slice/CPlusPlusUtil.h +7 -6
- data/ext/ice/cpp/include/Slice/Checksum.h +1 -1
- data/ext/ice/cpp/include/Slice/CsUtil.h +1 -1
- data/ext/ice/cpp/include/Slice/DotNetNames.h +1 -1
- data/ext/ice/cpp/include/Slice/FileTracker.h +1 -1
- data/ext/ice/cpp/include/Slice/JavaUtil.h +3 -1
- data/ext/ice/cpp/include/Slice/ObjCUtil.h +127 -0
- data/ext/ice/cpp/include/Slice/PHPUtil.h +1 -1
- data/ext/ice/cpp/include/Slice/Parser.h +18 -12
- data/ext/ice/cpp/include/Slice/Preprocessor.h +6 -4
- data/ext/ice/cpp/include/Slice/PythonUtil.h +1 -1
- data/ext/ice/cpp/include/Slice/RubyUtil.h +1 -1
- data/ext/ice/cpp/include/Slice/Util.h +20 -2
- data/ext/ice/cpp/src/Ice/ACM.cpp +1 -1
- data/ext/ice/cpp/src/Ice/ACM.h +1 -1
- data/ext/ice/cpp/src/Ice/Acceptor.cpp +1 -1
- data/ext/ice/cpp/src/Ice/Acceptor.h +1 -1
- data/ext/ice/cpp/src/Ice/AcceptorF.h +1 -1
- data/ext/ice/cpp/src/Ice/AsyncResult.cpp +1 -1
- data/ext/ice/cpp/src/Ice/Base64.cpp +1 -1
- data/ext/ice/cpp/src/Ice/Base64.h +1 -1
- data/ext/ice/cpp/src/Ice/BasicStream.cpp +7 -5
- data/ext/ice/cpp/src/Ice/BatchRequestQueue.cpp +227 -0
- data/ext/ice/cpp/src/Ice/BatchRequestQueue.h +59 -0
- data/ext/ice/cpp/src/Ice/Buffer.cpp +3 -3
- data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +10 -4
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +82 -282
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.h +8 -21
- data/ext/ice/cpp/src/Ice/Communicator.cpp +11 -5
- data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +6 -6
- data/ext/ice/cpp/src/Ice/CommunicatorI.h +1 -1
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +42 -180
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.h +10 -19
- data/ext/ice/cpp/src/Ice/ConnectRequestHandlerF.h +25 -0
- data/ext/ice/cpp/src/Ice/Connection.cpp +17 -11
- data/ext/ice/cpp/src/Ice/ConnectionF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +137 -51
- data/ext/ice/cpp/src/Ice/ConnectionFactory.h +18 -8
- data/ext/ice/cpp/src/Ice/ConnectionI.cpp +105 -391
- data/ext/ice/cpp/src/Ice/ConnectionI.h +25 -23
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +5 -29
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.h +3 -8
- data/ext/ice/cpp/src/Ice/Connector.cpp +1 -1
- data/ext/ice/cpp/src/Ice/Connector.h +1 -1
- data/ext/ice/cpp/src/Ice/ConnectorF.h +1 -1
- data/ext/ice/cpp/src/Ice/Current.cpp +10 -4
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +1 -1
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.h +1 -1
- data/ext/ice/cpp/src/Ice/DefaultsAndOverridesF.h +1 -1
- data/ext/ice/cpp/src/Ice/DeprecatedStringConverter.cpp +1 -1
- data/ext/ice/cpp/src/Ice/DispatchInterceptor.cpp +1 -1
- data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +1 -1
- data/ext/ice/cpp/src/Ice/Endpoint.cpp +17 -11
- data/ext/ice/cpp/src/Ice/EndpointF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +19 -1
- data/ext/ice/cpp/src/Ice/EndpointFactory.h +13 -1
- data/ext/ice/cpp/src/Ice/EndpointFactoryF.h +1 -1
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.cpp +1 -1
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.h +1 -1
- data/ext/ice/cpp/src/Ice/EndpointFactoryManagerF.h +1 -1
- data/ext/ice/cpp/src/Ice/EndpointI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/EndpointI.h +33 -1
- data/ext/ice/cpp/src/Ice/EndpointIF.h +1 -1
- data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +10 -4
- data/ext/ice/cpp/src/Ice/EventHandler.cpp +1 -1
- data/ext/ice/cpp/src/Ice/EventHandler.h +4 -1
- data/ext/ice/cpp/src/Ice/EventHandlerF.h +1 -1
- data/ext/ice/cpp/src/Ice/Exception.cpp +20 -11
- data/ext/ice/cpp/src/Ice/FacetMap.cpp +10 -4
- data/ext/ice/cpp/src/Ice/FactoryTable.cpp +1 -1
- data/ext/ice/cpp/src/Ice/FactoryTableInit.cpp +2 -2
- data/ext/ice/cpp/src/Ice/GCObject.cpp +1 -1
- data/ext/ice/cpp/src/Ice/HashUtil.h +1 -1
- data/ext/ice/cpp/src/Ice/HttpParser.cpp +27 -15
- data/ext/ice/cpp/src/Ice/HttpParser.h +4 -6
- data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +7 -1
- data/ext/ice/cpp/src/Ice/IPEndpointI.h +2 -1
- data/ext/ice/cpp/src/Ice/IPEndpointIF.h +1 -1
- data/ext/ice/cpp/src/Ice/Identity.cpp +11 -5
- data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +11 -5
- data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/ImplicitContextI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/ImplicitContextI.h +1 -1
- data/ext/ice/cpp/src/Ice/Incoming.cpp +22 -20
- data/ext/ice/cpp/src/Ice/IncomingAsync.cpp +1 -1
- data/ext/ice/cpp/src/Ice/IncomingRequest.h +1 -1
- data/ext/ice/cpp/src/Ice/Initialize.cpp +31 -5
- data/ext/ice/cpp/src/Ice/Instance.cpp +102 -59
- data/ext/ice/cpp/src/Ice/Instance.h +28 -2
- data/ext/ice/cpp/src/Ice/Instrumentation.cpp +20 -14
- data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/InstrumentationI.h +1 -1
- data/ext/ice/cpp/src/Ice/LocalException.cpp +10 -4
- data/ext/ice/cpp/src/Ice/LocalObject.cpp +1 -1
- data/ext/ice/cpp/src/Ice/Locator.cpp +83 -77
- data/ext/ice/cpp/src/Ice/LocatorF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +77 -69
- data/ext/ice/cpp/src/Ice/LocatorInfo.h +1 -1
- data/ext/ice/cpp/src/Ice/LocatorInfoF.h +1 -1
- data/ext/ice/cpp/src/Ice/Logger.cpp +11 -5
- data/ext/ice/cpp/src/Ice/LoggerAdminI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/LoggerAdminI.h +1 -1
- data/ext/ice/cpp/src/Ice/LoggerF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/LoggerI.cpp +10 -8
- data/ext/ice/cpp/src/Ice/LoggerI.h +1 -1
- data/ext/ice/cpp/src/Ice/LoggerUtil.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Metrics.cpp +122 -116
- data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/MetricsObserverI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/Network.cpp +63 -19
- data/ext/ice/cpp/src/Ice/Network.h +10 -3
- data/ext/ice/cpp/src/Ice/NetworkF.h +1 -1
- data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +1 -1
- data/ext/ice/cpp/src/Ice/NetworkProxy.h +1 -1
- data/ext/ice/cpp/src/Ice/NetworkProxyF.h +1 -1
- data/ext/ice/cpp/src/Ice/Object.cpp +1 -1
- data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +11 -5
- data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +9 -9
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.h +2 -2
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +3 -3
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +5 -5
- data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +11 -5
- data/ext/ice/cpp/src/Ice/ObjectFactoryF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/ObjectFactoryManager.cpp +9 -10
- data/ext/ice/cpp/src/Ice/ObjectFactoryManager.h +1 -1
- data/ext/ice/cpp/src/Ice/ObserverHelper.cpp +1 -1
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.cpp +6 -5
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.h +1 -1
- data/ext/ice/cpp/src/Ice/Outgoing.cpp +209 -254
- data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +120 -106
- data/ext/ice/cpp/src/Ice/Plugin.cpp +12 -6
- data/ext/ice/cpp/src/Ice/PluginF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +21 -2
- data/ext/ice/cpp/src/Ice/Process.cpp +25 -19
- data/ext/ice/cpp/src/Ice/ProcessF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/Properties.cpp +11 -5
- data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +39 -33
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.h +1 -1
- data/ext/ice/cpp/src/Ice/PropertiesF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/PropertiesI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/PropertiesI.h +1 -1
- data/ext/ice/cpp/src/Ice/PropertyNames.cpp +12 -8
- data/ext/ice/cpp/src/Ice/PropertyNames.h +2 -2
- data/ext/ice/cpp/src/Ice/Protocol.cpp +7 -7
- data/ext/ice/cpp/src/Ice/ProtocolInstance.cpp +9 -6
- data/ext/ice/cpp/src/Ice/ProtocolInstance.h +25 -7
- data/ext/ice/cpp/src/Ice/ProtocolInstanceF.h +1 -1
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +1 -1
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.h +1 -1
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +1 -1
- data/ext/ice/cpp/src/Ice/Proxy.cpp +32 -13
- data/ext/ice/cpp/src/Ice/ProxyFactory.cpp +1 -1
- data/ext/ice/cpp/src/Ice/ProxyFactory.h +1 -1
- data/ext/ice/cpp/src/Ice/Reference.cpp +101 -86
- data/ext/ice/cpp/src/Ice/Reference.h +16 -9
- data/ext/ice/cpp/src/Ice/ReferenceFactory.cpp +1 -1
- data/ext/ice/cpp/src/Ice/ReferenceFactory.h +1 -1
- data/ext/ice/cpp/src/Ice/ReferenceFactoryF.h +1 -1
- data/ext/ice/cpp/src/Ice/RegisterPlugins.cpp +28 -0
- data/ext/ice/cpp/src/Ice/RegisterPlugins.h +25 -0
- data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +92 -86
- data/ext/ice/cpp/src/Ice/ReplyStatus.h +1 -1
- data/ext/ice/cpp/src/Ice/RequestHandler.cpp +1 -1
- data/ext/ice/cpp/src/Ice/RequestHandler.h +4 -8
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.cpp +24 -16
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.h +5 -4
- data/ext/ice/cpp/src/Ice/ResponseHandler.cpp +1 -1
- data/ext/ice/cpp/src/Ice/ResponseHandler.h +3 -3
- data/ext/ice/cpp/src/Ice/RetryQueue.cpp +16 -5
- data/ext/ice/cpp/src/Ice/RetryQueue.h +3 -2
- data/ext/ice/cpp/src/Ice/RetryQueueF.h +1 -1
- data/ext/ice/cpp/src/Ice/Router.cpp +27 -21
- data/ext/ice/cpp/src/Ice/RouterF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/RouterInfo.cpp +1 -1
- data/ext/ice/cpp/src/Ice/RouterInfo.h +1 -1
- data/ext/ice/cpp/src/Ice/RouterInfoF.h +1 -1
- data/ext/ice/cpp/src/Ice/Selector.cpp +480 -1
- data/ext/ice/cpp/src/Ice/Selector.h +130 -1
- data/ext/ice/cpp/src/Ice/ServantLocator.cpp +11 -5
- data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +10 -4
- data/ext/ice/cpp/src/Ice/ServantManager.cpp +29 -23
- data/ext/ice/cpp/src/Ice/ServantManager.h +1 -1
- data/ext/ice/cpp/src/Ice/SharedContext.h +1 -1
- data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +10 -4
- data/ext/ice/cpp/src/Ice/SliceChecksums.cpp +1 -1
- data/ext/ice/cpp/src/Ice/SlicedData.cpp +1 -1
- data/ext/ice/cpp/src/Ice/Stream.cpp +1 -1
- data/ext/ice/cpp/src/Ice/StreamI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/StreamI.h +1 -1
- data/ext/ice/cpp/src/Ice/StreamSocket.cpp +30 -22
- data/ext/ice/cpp/src/Ice/StreamSocket.h +7 -4
- data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +1 -1
- data/ext/ice/cpp/src/Ice/SysLoggerI.cpp +1 -1
- data/ext/ice/cpp/src/Ice/SysLoggerI.h +1 -1
- data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +8 -8
- data/ext/ice/cpp/src/Ice/TcpAcceptor.h +1 -1
- data/ext/ice/cpp/src/Ice/TcpConnector.cpp +1 -1
- data/ext/ice/cpp/src/Ice/TcpConnector.h +1 -1
- data/ext/ice/cpp/src/Ice/TcpEndpointI.cpp +21 -38
- data/ext/ice/cpp/src/Ice/TcpEndpointI.h +5 -6
- data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +29 -4
- data/ext/ice/cpp/src/Ice/TcpTransceiver.h +7 -2
- data/ext/ice/cpp/src/Ice/ThreadPool.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ThreadPool.h +1 -1
- data/ext/ice/cpp/src/Ice/TraceLevels.cpp +2 -2
- data/ext/ice/cpp/src/Ice/TraceLevels.h +1 -1
- data/ext/ice/cpp/src/Ice/TraceLevelsF.h +1 -1
- data/ext/ice/cpp/src/Ice/TraceUtil.cpp +16 -7
- data/ext/ice/cpp/src/Ice/TraceUtil.h +1 -1
- data/ext/ice/cpp/src/Ice/Transceiver.cpp +1 -1
- data/ext/ice/cpp/src/Ice/Transceiver.h +2 -1
- data/ext/ice/cpp/src/Ice/TransceiverF.h +1 -1
- data/ext/ice/cpp/src/Ice/UdpConnector.cpp +1 -1
- data/ext/ice/cpp/src/Ice/UdpConnector.h +1 -1
- data/ext/ice/cpp/src/Ice/UdpEndpointI.cpp +13 -39
- data/ext/ice/cpp/src/Ice/UdpEndpointI.h +2 -5
- data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +46 -10
- data/ext/ice/cpp/src/Ice/UdpTransceiver.h +3 -2
- data/ext/ice/cpp/src/Ice/Version.cpp +12 -6
- data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +1 -1
- data/ext/ice/cpp/src/Ice/WSAcceptor.h +1 -1
- data/ext/ice/cpp/src/Ice/WSConnector.cpp +1 -1
- data/ext/ice/cpp/src/Ice/WSConnector.h +1 -1
- data/ext/ice/cpp/src/Ice/WSEndpoint.cpp +6 -38
- data/ext/ice/cpp/src/Ice/WSEndpoint.h +12 -1
- data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +31 -35
- data/ext/ice/cpp/src/Ice/WSTransceiver.h +13 -1
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +66 -60
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +106 -100
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.cpp +1 -1
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.h +1 -1
- data/ext/ice/cpp/src/IceDiscovery/LookupI.cpp +76 -36
- data/ext/ice/cpp/src/IceDiscovery/LookupI.h +1 -1
- data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +19 -6
- data/ext/ice/cpp/src/IceDiscovery/PluginI.h +1 -1
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +452 -0
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +732 -0
- data/ext/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +520 -0
- data/ext/ice/cpp/src/IceLocatorDiscovery/PluginI.h +36 -0
- data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +8 -8
- data/ext/ice/cpp/src/IceSSL/AcceptorI.h +1 -1
- data/ext/ice/cpp/src/IceSSL/Certificate.cpp +49 -47
- data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +13 -5
- data/ext/ice/cpp/src/IceSSL/ConnectorI.cpp +1 -1
- data/ext/ice/cpp/src/IceSSL/ConnectorI.h +1 -1
- data/ext/ice/cpp/src/IceSSL/EndpointI.cpp +10 -38
- data/ext/ice/cpp/src/IceSSL/EndpointI.h +4 -3
- data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +13 -5
- data/ext/ice/cpp/src/IceSSL/Instance.cpp +2 -2
- data/ext/ice/cpp/src/IceSSL/Instance.h +1 -1
- data/ext/ice/cpp/src/IceSSL/InstanceF.h +1 -1
- data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +107 -111
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +130 -47
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +11 -3
- data/ext/ice/cpp/src/IceSSL/PluginI.cpp +8 -14
- data/ext/ice/cpp/src/IceSSL/PluginI.h +1 -1
- data/ext/ice/cpp/src/IceSSL/RFC2253.cpp +1 -1
- data/ext/ice/cpp/src/IceSSL/RFC2253.h +1 -1
- data/ext/ice/cpp/src/IceSSL/SChannelEngine.cpp +238 -156
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +93 -66
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.h +7 -3
- data/ext/ice/cpp/src/IceSSL/SSLEngine.cpp +2 -2
- data/ext/ice/cpp/src/IceSSL/SSLEngine.h +32 -35
- data/ext/ice/cpp/src/IceSSL/SSLEngineF.h +1 -1
- data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +244 -360
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +59 -29
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +8 -4
- data/ext/ice/cpp/src/IceSSL/TrustManager.cpp +1 -1
- data/ext/ice/cpp/src/IceSSL/TrustManager.h +1 -1
- data/ext/ice/cpp/src/IceSSL/TrustManagerF.h +1 -1
- data/ext/ice/cpp/src/IceSSL/Util.cpp +427 -620
- data/ext/ice/cpp/src/IceSSL/Util.h +72 -15
- data/ext/ice/cpp/src/IceUtil/ArgVector.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/ArgVector.h +1 -1
- data/ext/ice/cpp/src/IceUtil/Cond.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.h +1 -1
- data/ext/ice/cpp/src/IceUtil/CountDownLatch.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/CtrlCHandler.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/Exception.cpp +105 -96
- data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +2 -1
- data/ext/ice/cpp/src/IceUtil/FileUtil.h +9 -1
- data/ext/ice/cpp/src/IceUtil/InputUtil.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/MutexProtocol.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/Options.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +12 -25
- data/ext/ice/cpp/src/IceUtil/Random.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/SHA1.cpp +72 -10
- data/ext/ice/cpp/src/IceUtil/Shared.cpp +3 -132
- data/ext/ice/cpp/src/IceUtil/StopWatch.h +1 -1
- data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/Thread.cpp +16 -1
- data/ext/ice/cpp/src/IceUtil/ThreadException.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/Time.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/Timer.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/UUID.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/Unicode.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/Unicode.h +1 -1
- data/ext/ice/cpp/src/Slice/CPlusPlusUtil.cpp +62 -55
- data/ext/ice/cpp/src/Slice/Checksum.cpp +1 -1
- data/ext/ice/cpp/src/Slice/CsUtil.cpp +8 -29
- data/ext/ice/cpp/src/Slice/DotNetNames.cpp +1 -1
- data/ext/ice/cpp/src/Slice/FileTracker.cpp +1 -1
- data/ext/ice/cpp/src/Slice/Grammar.cpp +1 -1
- data/ext/ice/cpp/src/Slice/GrammarUtil.h +1 -1
- data/ext/ice/cpp/src/Slice/JavaUtil.cpp +145 -172
- data/ext/ice/cpp/src/Slice/MD5.cpp +1 -1
- data/ext/ice/cpp/src/Slice/MD5.h +1 -1
- data/ext/ice/cpp/src/Slice/ObjCUtil.cpp +1310 -0
- data/ext/ice/cpp/src/Slice/PHPUtil.cpp +1 -1
- data/ext/ice/cpp/src/Slice/Parser.cpp +65 -187
- data/ext/ice/cpp/src/Slice/Preprocessor.cpp +61 -9
- data/ext/ice/cpp/src/Slice/Python.cpp +36 -3
- data/ext/ice/cpp/src/Slice/PythonUtil.cpp +10 -10
- data/ext/ice/cpp/src/Slice/Ruby.cpp +34 -3
- data/ext/ice/cpp/src/Slice/RubyUtil.cpp +8 -7
- data/ext/ice/cpp/src/Slice/Scanner.cpp +1 -1
- data/ext/ice/cpp/src/Slice/Util.cpp +137 -30
- data/ext/ice/mcpp/LICENSE +29 -0
- data/ext/ice/mcpp/Makefile +60 -0
- data/ext/ice/mcpp/Makefile.mak +46 -0
- data/ext/ice/mcpp/README.md +30 -0
- data/ext/ice/mcpp/config.h +89 -0
- data/ext/ice/mcpp/configed.H +1 -146
- data/ext/ice/mcpp/directive.c +115 -410
- data/ext/ice/mcpp/eval.c +38 -377
- data/ext/ice/mcpp/expand.c +155 -852
- data/ext/ice/mcpp/internal.H +10 -44
- data/ext/ice/mcpp/main.c +6 -345
- data/ext/ice/mcpp/mbchar.c +17 -654
- data/ext/ice/mcpp/mcpp.gyp +62 -0
- data/ext/ice/mcpp/support.c +116 -943
- data/ext/ice/mcpp/system.H +0 -23
- data/ext/ice/mcpp/system.c +81 -2321
- data/ice.gemspec +3 -4
- data/lib/Glacier2.rb +1 -1
- data/lib/Glacier2/Metrics.rb +2 -2
- data/lib/Glacier2/PermissionsVerifier.rb +2 -2
- data/lib/Glacier2/PermissionsVerifierF.rb +2 -2
- data/lib/Glacier2/Router.rb +2 -2
- data/lib/Glacier2/RouterF.rb +2 -2
- data/lib/Glacier2/SSLInfo.rb +2 -2
- data/lib/Glacier2/Session.rb +2 -2
- data/lib/Ice.rb +1 -1
- data/lib/Ice/BuiltinSequences.rb +2 -2
- data/lib/Ice/Communicator.rb +2 -2
- data/lib/Ice/CommunicatorF.rb +2 -2
- data/lib/Ice/Connection.rb +26 -14
- data/lib/Ice/ConnectionF.rb +2 -2
- data/lib/Ice/Current.rb +2 -2
- data/lib/Ice/Endpoint.rb +4 -2
- data/lib/Ice/EndpointF.rb +2 -2
- data/lib/Ice/EndpointTypes.rb +2 -2
- data/lib/Ice/FacetMap.rb +2 -2
- data/lib/Ice/Identity.rb +2 -2
- data/lib/Ice/ImplicitContext.rb +2 -2
- data/lib/Ice/ImplicitContextF.rb +2 -2
- data/lib/Ice/Instrumentation.rb +2 -2
- data/lib/Ice/InstrumentationF.rb +2 -2
- data/lib/Ice/LocalException.rb +2 -2
- data/lib/Ice/Locator.rb +2 -2
- data/lib/Ice/LocatorF.rb +2 -2
- data/lib/Ice/Logger.rb +2 -2
- data/lib/Ice/LoggerF.rb +2 -2
- data/lib/Ice/Metrics.rb +2 -2
- data/lib/Ice/ObjectAdapterF.rb +2 -2
- data/lib/Ice/ObjectFactory.rb +2 -2
- data/lib/Ice/ObjectFactoryF.rb +2 -2
- data/lib/Ice/Plugin.rb +2 -2
- data/lib/Ice/PluginF.rb +2 -2
- data/lib/Ice/Process.rb +2 -2
- data/lib/Ice/ProcessF.rb +2 -2
- data/lib/Ice/Properties.rb +2 -2
- data/lib/Ice/PropertiesAdmin.rb +2 -2
- data/lib/Ice/PropertiesF.rb +2 -2
- data/lib/Ice/Router.rb +2 -2
- data/lib/Ice/RouterF.rb +2 -2
- data/lib/Ice/SliceChecksumDict.rb +2 -2
- data/lib/Ice/Version.rb +2 -2
- data/lib/IceBox.rb +1 -1
- data/lib/IceBox/IceBox.rb +2 -2
- data/lib/IceGrid.rb +1 -1
- data/lib/IceGrid/Admin.rb +2 -2
- data/lib/IceGrid/Descriptor.rb +2 -2
- data/lib/IceGrid/Exception.rb +2 -2
- data/lib/IceGrid/FileParser.rb +2 -2
- data/lib/IceGrid/Locator.rb +2 -2
- data/lib/IceGrid/Observer.rb +2 -2
- data/lib/IceGrid/Query.rb +2 -2
- data/lib/IceGrid/Registry.rb +2 -2
- data/lib/IceGrid/Session.rb +2 -2
- data/lib/IceGrid/UserAccountMapper.rb +2 -2
- data/lib/IcePatch2.rb +1 -1
- data/lib/IcePatch2/FileInfo.rb +52 -2
- data/lib/IcePatch2/FileServer.rb +33 -4
- data/lib/IceStorm.rb +1 -1
- data/lib/IceStorm/IceStorm.rb +2 -2
- data/lib/IceStorm/Metrics.rb +2 -2
- data/slice/Freeze/BackgroundSaveEvictor.ice +2 -2
- data/slice/Freeze/CatalogData.ice +2 -2
- data/slice/Freeze/Connection.ice +2 -2
- data/slice/Freeze/ConnectionF.ice +2 -2
- data/slice/Freeze/DB.ice +2 -2
- data/slice/Freeze/Evictor.ice +2 -2
- data/slice/Freeze/EvictorF.ice +2 -2
- data/slice/Freeze/EvictorStorage.ice +2 -2
- data/slice/Freeze/Exception.ice +2 -2
- data/slice/Freeze/Transaction.ice +2 -2
- data/slice/Freeze/TransactionalEvictor.ice +2 -2
- data/slice/Glacier2/Metrics.ice +7 -6
- data/slice/Glacier2/PermissionsVerifier.ice +4 -3
- data/slice/Glacier2/PermissionsVerifierF.ice +3 -2
- data/slice/Glacier2/Router.ice +4 -3
- data/slice/Glacier2/RouterF.ice +3 -2
- data/slice/Glacier2/SSLInfo.ice +3 -2
- data/slice/Glacier2/Session.ice +12 -11
- data/slice/Ice/BuiltinSequences.ice +4 -3
- data/slice/Ice/Communicator.ice +22 -25
- data/slice/Ice/CommunicatorF.ice +3 -2
- data/slice/Ice/Connection.ice +39 -11
- data/slice/Ice/ConnectionF.ice +3 -2
- data/slice/Ice/Current.ice +4 -3
- data/slice/Ice/Endpoint.ice +11 -3
- data/slice/Ice/EndpointF.ice +3 -2
- data/slice/Ice/EndpointTypes.ice +3 -2
- data/slice/Ice/FacetMap.ice +3 -2
- data/slice/Ice/Identity.ice +3 -2
- data/slice/Ice/ImplicitContext.ice +3 -2
- data/slice/Ice/ImplicitContextF.ice +3 -2
- data/slice/Ice/Instrumentation.ice +4 -2
- data/slice/Ice/InstrumentationF.ice +4 -2
- data/slice/Ice/LocalException.ice +29 -10
- data/slice/Ice/Locator.ice +5 -3
- data/slice/Ice/LocatorF.ice +3 -2
- data/slice/Ice/Logger.ice +3 -2
- data/slice/Ice/LoggerF.ice +3 -2
- data/slice/Ice/Metrics.ice +15 -14
- data/slice/Ice/ObjectAdapter.ice +5 -4
- data/slice/Ice/ObjectAdapterF.ice +3 -2
- data/slice/Ice/ObjectFactory.ice +3 -2
- data/slice/Ice/ObjectFactoryF.ice +3 -2
- data/slice/Ice/Plugin.ice +3 -2
- data/slice/Ice/PluginF.ice +3 -2
- data/slice/Ice/Process.ice +3 -2
- data/slice/Ice/ProcessF.ice +3 -2
- data/slice/Ice/Properties.ice +3 -2
- data/slice/Ice/PropertiesAdmin.ice +3 -2
- data/slice/Ice/PropertiesF.ice +3 -2
- data/slice/Ice/RemoteLogger.ice +3 -2
- data/slice/Ice/Router.ice +3 -2
- data/slice/Ice/RouterF.ice +3 -2
- data/slice/Ice/ServantLocator.ice +3 -2
- data/slice/Ice/ServantLocatorF.ice +3 -2
- data/slice/Ice/SliceChecksumDict.ice +3 -2
- data/slice/Ice/Version.ice +3 -2
- data/slice/IceBox/IceBox.ice +2 -2
- data/slice/IceDiscovery/IceDiscovery.ice +2 -2
- data/slice/IceGrid/Admin.ice +49 -48
- data/slice/IceGrid/Descriptor.ice +3 -2
- data/slice/IceGrid/Exception.ice +6 -5
- data/slice/IceGrid/FileParser.ice +4 -3
- data/slice/IceGrid/Locator.ice +4 -3
- data/slice/IceGrid/Observer.ice +28 -27
- data/slice/IceGrid/PluginFacade.ice +3 -2
- data/slice/IceGrid/Query.ice +3 -2
- data/slice/IceGrid/Registry.ice +4 -3
- data/slice/IceGrid/Session.ice +9 -8
- data/slice/IceGrid/UserAccountMapper.ice +4 -3
- data/slice/{IceGrid/Discovery.ice → IceLocatorDiscovery/IceLocatorDiscovery.ice} +12 -14
- data/slice/IcePatch2/FileInfo.ice +31 -2
- data/slice/IcePatch2/FileServer.ice +63 -5
- data/slice/IceSSL/ConnectionInfo.ice +17 -2
- data/slice/IceSSL/EndpointInfo.ice +21 -3
- data/slice/IceStorm/IceStorm.ice +3 -2
- data/slice/IceStorm/Metrics.ice +4 -3
- metadata +27 -23
- data/ext/ice/cpp/include/Ice/Makefile +0 -26
- data/ext/ice/cpp/include/IceSSL/Makefile +0 -26
- data/ext/ice/cpp/include/IceUtil/Makefile +0 -26
- data/ext/ice/cpp/include/Slice/Makefile +0 -26
- data/ext/ice/cpp/src/Ice/Application.cpp +0 -760
- data/ext/ice/cpp/src/Ice/EventLoggerMsg.h +0 -53
- data/ext/ice/cpp/src/Ice/Makefile +0 -190
- data/ext/ice/cpp/src/Ice/Service.cpp +0 -1897
- data/ext/ice/cpp/src/IceDiscovery/Makefile +0 -61
- data/ext/ice/cpp/src/IceSSL/Makefile +0 -82
- data/ext/ice/cpp/src/IceUtil/Makefile +0 -68
- data/ext/ice/cpp/src/Slice/Makefile +0 -65
- data/ext/ice/mcpp/config.h.Darwin +0 -227
- data/ext/ice/mcpp/config.h.Linux +0 -227
- data/ext/ice/mcpp/config.h.MINGW +0 -7
data/ext/ice/mcpp/expand.c
CHANGED
@@ -34,12 +34,8 @@
|
|
34
34
|
* The macro expansion routines are placed here.
|
35
35
|
*/
|
36
36
|
|
37
|
-
#if PREPROCESSED
|
38
|
-
#include "mcpp.H"
|
39
|
-
#else
|
40
37
|
#include "system.H"
|
41
38
|
#include "internal.H"
|
42
|
-
#endif
|
43
39
|
|
44
40
|
#define ARG_ERROR (-255)
|
45
41
|
#define CERROR 1
|
@@ -58,17 +54,10 @@ typedef struct magic_seq { /* Data of a sequence inserted between tokens */
|
|
58
54
|
} MAGIC_SEQ;
|
59
55
|
|
60
56
|
static int compat_mode;
|
61
|
-
/* Expand recursive macro more than Standard (for compatibility with GNUC) */
|
62
|
-
#if COMPILER == GNUC
|
63
|
-
static int ansi; /* __STRICT_ANSI__ flag */
|
64
|
-
#endif
|
65
57
|
|
66
58
|
static char * expand_std( DEFBUF * defp, char * out, char * out_end
|
67
59
|
, LINE_COL line_col, int * pragma_op);
|
68
60
|
/* Expand a macro completely (for Standard modes) */
|
69
|
-
static char * expand_prestd( DEFBUF * defp, char * out, char * out_end
|
70
|
-
, LINE_COL line_col, int * pragma_op);
|
71
|
-
/* Expand a macro completely (for pre-Standard modes) */
|
72
61
|
static DEFBUF * is_macro_call( DEFBUF * defp, char ** cp, char ** endf
|
73
62
|
, MAGIC_SEQ * mgc_seq); /* Is this really a macro call ? */
|
74
63
|
static int collect_args( const DEFBUF * defp, char ** arglist, int m_num);
|
@@ -97,20 +86,14 @@ static const char * const unterm_macro
|
|
97
86
|
= "Unterminated macro call \"%s\""; /* _E_ */
|
98
87
|
static const char * const narg_error
|
99
88
|
= "%s than necessary %ld argument(s) in macro call \"%s\""; /* _E_ _W1_ */
|
100
|
-
static const char * const only_name
|
101
|
-
= "Macro \"%s\" needs arguments"; /* _W8_ */
|
102
89
|
|
103
90
|
void expand_init(
|
104
|
-
int compat
|
105
|
-
int strict_ansi /* __STRICT_ANSI__ flag for GNUC */
|
91
|
+
int compat /* "Compatible" to GNUC expansion of recursive macro*/
|
106
92
|
)
|
107
93
|
/* Set expand_macro() function */
|
108
94
|
{
|
109
|
-
expand_macro =
|
95
|
+
expand_macro = expand_std;
|
110
96
|
compat_mode = compat;
|
111
|
-
#if COMPILER == GNUC
|
112
|
-
ansi = strict_ansi;
|
113
|
-
#endif
|
114
97
|
}
|
115
98
|
|
116
99
|
DEFBUF * is_macro(
|
@@ -146,12 +129,10 @@ static DEFBUF * is_macro_call(
|
|
146
129
|
c = squeeze_ws( cp, endf, mgc_seq); /* See the next char. */
|
147
130
|
if (c == CHAR_EOF) /* End of file */
|
148
131
|
unget_string( "\n", NULL); /* Restore skipped '\n' */
|
149
|
-
else if (
|
132
|
+
else if (c != RT_END)
|
150
133
|
/* Still in the file and rescan boundary ? */
|
151
134
|
unget_ch(); /* To see it again */
|
152
135
|
if (c != '(') { /* Only the name of function-like macro */
|
153
|
-
if (! standard && warn_level & 8)
|
154
|
-
cwarn( only_name, defp->name, 0L, NULL);
|
155
136
|
return NULL;
|
156
137
|
}
|
157
138
|
}
|
@@ -235,8 +216,6 @@ static int print_macro_inf( int c, char ** cpp, char ** opp);
|
|
235
216
|
static char * print_macro_arg( char *out, MACRO_INF * m_inf, int argn
|
236
217
|
, int real_arg, int start);
|
237
218
|
/* Embed macro arg inf into comments*/
|
238
|
-
static char * chk_magic_balance( char * buf, char * buf_end, int move
|
239
|
-
, int diag); /* Check imbalance of magics */
|
240
219
|
static char * replace( DEFBUF * defp, char * out, char * out_end
|
241
220
|
, const DEFBUF * outer, FILEINFO * rt_file, LINE_COL line_col
|
242
221
|
, int in_src_n);
|
@@ -251,7 +230,7 @@ static int prescan( const DEFBUF * defp, const char ** arglist
|
|
251
230
|
static char * catenate( const DEFBUF * defp, const char ** arglist
|
252
231
|
, char * out, char * out_end, char ** token_p);
|
253
232
|
/* Catenate tokens */
|
254
|
-
static
|
233
|
+
static char * remove_magics( const char * argp, int from_last);
|
255
234
|
/* Remove pair of magic characters */
|
256
235
|
#if DEBUG_MACRO_ANN
|
257
236
|
static void chk_symmetry( char * start_id, char * end_id, size_t len);
|
@@ -296,7 +275,7 @@ static char * expand_std(
|
|
296
275
|
macro_line = src_line; /* Line number for diag */
|
297
276
|
macro_name = defp->name;
|
298
277
|
rescan_level = 0;
|
299
|
-
trace_macro = (
|
278
|
+
trace_macro = (mcpp_debug & MACRO_CALL)
|
300
279
|
&& ! in_directive;
|
301
280
|
if (trace_macro) {
|
302
281
|
max_mac_num = INIT_MAC_INF;
|
@@ -330,40 +309,36 @@ static char * expand_std(
|
|
330
309
|
while ((c = *cp++) != EOS) {
|
331
310
|
if (c == DEF_MAGIC)
|
332
311
|
continue; /* Skip DEF_MAGIC */
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|| (option_flags.v
|
346
|
-
&& *(cp - MAC_E_LEN_V - 1) == MAC_INF
|
347
|
-
&& *(cp - MAC_E_LEN_V) == MAC_CALL_END))
|
348
|
-
continue;
|
349
|
-
/* Skip separator just after ' ', '\t' */
|
350
|
-
/* and just after MAC_CALL_END. */
|
351
|
-
/* Also skip this in lang_asm mode, #include */
|
352
|
-
/* Skip just before another TOK_SEP, ' ', '\t' */
|
353
|
-
/* Skip just before MAC_INF,MAC_CALL_END seq too*/
|
354
|
-
else
|
355
|
-
c = ' '; /* Else convert to ' ' */
|
356
|
-
} else if (trace_macro && (c == MAC_INF)) {
|
357
|
-
/* Embed macro expansion informations into comments */
|
358
|
-
c = *cp++;
|
359
|
-
c1 = print_macro_inf( c, &cp, &out_p);
|
360
|
-
if (out_end <= out_p) {
|
361
|
-
cerror( macbuf_overflow, macro_name, 0, out);
|
362
|
-
macro_line = MACRO_ERROR;
|
363
|
-
goto exp_end;
|
364
|
-
}
|
312
|
+
|
313
|
+
if (c == IN_SRC) { /* Skip IN_SRC */
|
314
|
+
if (trace_macro)
|
315
|
+
cp += 2; /* Skip also the number (coded in 2 bytes) */
|
316
|
+
continue;
|
317
|
+
} else if (c == TOK_SEP) {
|
318
|
+
/* Remove redundant token separator */
|
319
|
+
if ((char_type[ c1 & UCHARMAX] & HSP)
|
320
|
+
|| (char_type[ *cp & UCHARMAX] & HSP)
|
321
|
+
|| in_include
|
322
|
+
|| (*cp == MAC_INF && *(cp + 1) == MAC_CALL_END)
|
323
|
+
|| (c1 == MAC_CALL_END))
|
365
324
|
continue;
|
325
|
+
/* Skip separator just after ' ', '\t' */
|
326
|
+
/* and just after MAC_CALL_END. */
|
327
|
+
/* Also skip this in lang_asm mode, #include */
|
328
|
+
/* Skip just before another TOK_SEP, ' ', '\t' */
|
329
|
+
/* Skip just before MAC_INF,MAC_CALL_END seq too*/
|
330
|
+
else
|
331
|
+
c = ' '; /* Else convert to ' ' */
|
332
|
+
} else if (trace_macro && (c == MAC_INF)) {
|
333
|
+
/* Embed macro expansion informations into comments */
|
334
|
+
c = *cp++;
|
335
|
+
c1 = print_macro_inf( c, &cp, &out_p);
|
336
|
+
if (out_end <= out_p) {
|
337
|
+
cerror( macbuf_overflow, macro_name, 0, out);
|
338
|
+
macro_line = MACRO_ERROR;
|
339
|
+
goto exp_end;
|
366
340
|
}
|
341
|
+
continue;
|
367
342
|
}
|
368
343
|
*out_p++ = c1 = c;
|
369
344
|
}
|
@@ -409,8 +384,7 @@ static int print_macro_inf(
|
|
409
384
|
if (*((*opp) - 1) == '/' && *((*opp) - 2) != '*')
|
410
385
|
/* Immediately preceding token is '/' (not '*' and '/') */
|
411
386
|
*((*opp)++) = ' ';
|
412
|
-
|
413
|
-
if (option_flags.v || c == MAC_CALL_START || c == MAC_ARG_START) {
|
387
|
+
if (c == MAC_CALL_START || c == MAC_ARG_START) {
|
414
388
|
num = ((*(*cpp)++ & UCHARMAX) - 1) * UCHARMAX;
|
415
389
|
num += (*(*cpp)++ & UCHARMAX) - 1;
|
416
390
|
m_inf = & mac_inf[ num]; /* Saved information */
|
@@ -436,19 +410,9 @@ static int print_macro_inf(
|
|
436
410
|
*opp = print_macro_arg( *opp, m_inf, i, FALSE, TRUE);
|
437
411
|
break;
|
438
412
|
case MAC_CALL_END : /* End of a macro expansion */
|
439
|
-
if (option_flags.v) { /* Verbose mode */
|
440
|
-
*opp += sprintf( *opp, "/*%s>*/", m_inf->defp->name);
|
441
|
-
break;
|
442
|
-
}
|
443
413
|
/* Else fall through */
|
444
414
|
case MAC_ARG_END : /* End of an argument */
|
445
|
-
|
446
|
-
i = (*(*cpp)++ & UCHARMAX) - 1;
|
447
|
-
/* Output verbose infs symmetrical to start of the arg infs */
|
448
|
-
*opp = print_macro_arg( *opp, m_inf, i, FALSE, FALSE);
|
449
|
-
} else {
|
450
|
-
*opp = stpcpy( *opp, "/*>*/");
|
451
|
-
}
|
415
|
+
*opp = stpcpy( *opp, "/*>*/");
|
452
416
|
break;
|
453
417
|
}
|
454
418
|
|
@@ -483,163 +447,7 @@ static char * print_macro_arg(
|
|
483
447
|
|
484
448
|
return out;
|
485
449
|
}
|
486
|
-
|
487
|
-
static char * chk_magic_balance(
|
488
|
-
char * buf, /* Sequence to check */
|
489
|
-
char * buf_end, /* End of the sequence */
|
490
|
-
int move, /* Move a straying magic ? */
|
491
|
-
int diag /* Output a diagnostic? */
|
492
|
-
)
|
493
|
-
/*
|
494
|
-
* Check imbalance of macro information magics and warn it.
|
495
|
-
* get_an_arg() calls this routine setting 'move' argument on, hence a stray
|
496
|
-
* magic is moved to an edge if found.
|
497
|
-
* This routine does not do token parsing. Yet it will do fine practically.
|
498
|
-
*/
|
499
|
-
{
|
500
|
-
#define MAX_NEST_MAGICS 255
|
501
|
-
char mac_id[ MAX_NEST_MAGICS][ MAC_E_LEN_V - 2];
|
502
|
-
char arg_id[ MAX_NEST_MAGICS][ ARG_E_LEN_V - 2];
|
503
|
-
char * mac_loc[ MAX_NEST_MAGICS];
|
504
|
-
char * arg_loc[ MAX_NEST_MAGICS];
|
505
|
-
char * mesg = "%s %ld %s-closing-comment(s) in tracing macro";
|
506
|
-
int mac, arg;
|
507
|
-
int mac_s_n, mac_e_n, arg_s_n, arg_e_n;
|
508
|
-
char * buf_p = buf; /* Save 'buf' for debugging purpose */
|
509
|
-
|
510
|
-
mac = arg = 0;
|
511
|
-
|
512
|
-
while (buf_p < buf_end) {
|
513
|
-
if (*buf_p++ != MAC_INF)
|
514
|
-
continue;
|
515
|
-
switch (*buf_p++) {
|
516
|
-
case MAC_CALL_START :
|
517
|
-
if (option_flags.v) {
|
518
|
-
mac_loc[ mac] = buf_p - 2;
|
519
|
-
memcpy( mac_id[ mac], buf_p, MAC_S_LEN - 2);
|
520
|
-
}
|
521
|
-
mac++;
|
522
|
-
buf_p += MAC_S_LEN - 2;
|
523
|
-
break;
|
524
|
-
case MAC_ARG_START :
|
525
|
-
if (option_flags.v) {
|
526
|
-
arg_loc[ arg] = buf_p - 2;
|
527
|
-
memcpy( arg_id[ arg], buf_p, ARG_S_LEN - 2);
|
528
|
-
}
|
529
|
-
arg++;
|
530
|
-
buf_p += ARG_S_LEN - 2;
|
531
|
-
break;
|
532
|
-
case MAC_ARG_END :
|
533
|
-
arg--;
|
534
|
-
if (option_flags.v) {
|
535
|
-
if (arg < 0) { /* Perhaps moved magic */
|
536
|
-
if (diag)
|
537
|
-
cwarn( mesg, "Redundant", (long) -arg, "argument");
|
538
|
-
} else if (memcmp( arg_id[ arg], buf_p, ARG_E_LEN_V - 2) != 0)
|
539
|
-
{
|
540
|
-
char * to_be_edge = NULL;
|
541
|
-
char * cur_edge;
|
542
|
-
|
543
|
-
if (arg >= 1 && memcmp( arg_id[ 0], buf_p, ARG_E_LEN_V - 2)
|
544
|
-
== 0) {
|
545
|
-
to_be_edge = arg_loc[ arg];
|
546
|
-
/* To be moved to top */
|
547
|
-
cur_edge = arg_loc[ 0]; /* Current top */
|
548
|
-
} else if (arg == 0) {
|
549
|
-
char arg_end_magic[ 2] = { MAC_INF, MAC_ARG_END};
|
550
|
-
cur_edge = buf_end - ARG_E_LEN_V;
|
551
|
-
/* Search the last magic */
|
552
|
-
/* Sequence from get_an_arg() is always */
|
553
|
-
/* surrounded by starting of an arg magic */
|
554
|
-
/* and its corresponding closing magic. */
|
555
|
-
while (buf_p + (ARG_E_LEN_V - 2) <= cur_edge
|
556
|
-
&& memcmp( cur_edge, arg_end_magic, 2) != 0)
|
557
|
-
cur_edge--;
|
558
|
-
if (buf_p + (ARG_E_LEN_V - 2) <= cur_edge
|
559
|
-
&& memcmp( arg_id[ 0], cur_edge + 2
|
560
|
-
, ARG_E_LEN_V - 2) == 0) {
|
561
|
-
to_be_edge = buf_p - 2; /* To be moved to end */
|
562
|
-
}
|
563
|
-
}
|
564
|
-
if (to_be_edge) { /* Appropriate place found */
|
565
|
-
if (diag) {
|
566
|
-
mac_s_n = ((to_be_edge[ 2] & UCHARMAX) - 1)
|
567
|
-
* UCHARMAX;
|
568
|
-
mac_s_n += (to_be_edge[ 3] & UCHARMAX) - 1;
|
569
|
-
arg_s_n = (to_be_edge[ 4] & UCHARMAX) - 1;
|
570
|
-
mcpp_fprintf( ERR,
|
571
|
-
"Stray arg inf of macro: %d:%d at line:%d\n"
|
572
|
-
, mac_s_n, arg_s_n, src_line);
|
573
|
-
}
|
574
|
-
if (move) {
|
575
|
-
/* Move a stray magic to outside of sequences */
|
576
|
-
char magic[ ARG_E_LEN_V];
|
577
|
-
size_t len = ARG_E_LEN_V;
|
578
|
-
memcpy( magic, cur_edge, len);
|
579
|
-
/* Save current edge */
|
580
|
-
if (to_be_edge == arg_loc[ arg])
|
581
|
-
/* Shift followings to cur_edge */
|
582
|
-
memmove( cur_edge, cur_edge + len
|
583
|
-
, to_be_edge - cur_edge);
|
584
|
-
else /* Shift precedents to cur_edge */
|
585
|
-
memmove( to_be_edge + len, to_be_edge
|
586
|
-
, cur_edge - to_be_edge);
|
587
|
-
memcpy( to_be_edge, magic, len);
|
588
|
-
/* Restore old 'cur_edge' into old 'to_be_edge' */
|
589
|
-
}
|
590
|
-
} else { /* Serious imbalance, just warn */
|
591
|
-
char * arg_p = arg_id[ arg];
|
592
|
-
arg_s_n = ((arg_p[ 0] & UCHARMAX) - 1) * UCHARMAX;
|
593
|
-
arg_s_n += (arg_p[ 1] & UCHARMAX) - 1;
|
594
|
-
arg_e_n = ((buf_p[ 0] & UCHARMAX) - 1) * UCHARMAX;
|
595
|
-
arg_e_n += (buf_p[ 1] & UCHARMAX) - 1;
|
596
|
-
mcpp_fprintf( ERR,
|
597
|
-
"Asymmetry of arg inf found: start %d, end %d at line:%d\n"
|
598
|
-
, arg_s_n, arg_e_n, src_line);
|
599
|
-
}
|
600
|
-
}
|
601
|
-
buf_p += ARG_E_LEN_V - 2;
|
602
|
-
}
|
603
|
-
break;
|
604
|
-
case MAC_CALL_END :
|
605
|
-
mac--;
|
606
|
-
if (option_flags.v) {
|
607
|
-
if (mac < 0) {
|
608
|
-
if (diag)
|
609
|
-
cwarn( mesg, "Redundant", (long) -mac, "macro");
|
610
|
-
} else if (memcmp( mac_id[ mac], buf_p, MAC_E_LEN_V - 2) != 0)
|
611
|
-
{
|
612
|
-
char * mac_p = mac_id[ mac];
|
613
|
-
mac_s_n = ((mac_p[ 0] & UCHARMAX) - 1) * UCHARMAX;
|
614
|
-
mac_s_n += (mac_p[ 1] & UCHARMAX) - 1;
|
615
|
-
mac_e_n = ((buf_p[ 0] & UCHARMAX) - 1) * UCHARMAX;
|
616
|
-
mac_e_n += (buf_p[ 1] & UCHARMAX) - 1;
|
617
|
-
mcpp_fprintf( ERR,
|
618
|
-
"Asymmetry of macro inf found: start %d, end %d at line:%d\n"
|
619
|
-
, mac_s_n, mac_e_n, src_line);
|
620
|
-
}
|
621
|
-
buf_p += MAC_E_LEN_V - 2;
|
622
|
-
}
|
623
|
-
break;
|
624
|
-
default : /* Not a MAC_INF sequence */
|
625
|
-
break; /* Continue */
|
626
|
-
}
|
627
|
-
}
|
628
|
-
|
629
|
-
if (diag && (warn_level & 1)) {
|
630
|
-
if (mac > 0)
|
631
|
-
cwarn( mesg, "Lacking", (long) mac, "macro");
|
632
|
-
if (arg > 0)
|
633
|
-
cwarn( mesg, "Lacking", (long) arg, "argument");
|
634
|
-
if ((mac || arg) && (mcpp_debug & EXPAND))
|
635
|
-
mcpp_fputs(
|
636
|
-
"Imbalance of magics occurred (perhaps a moved magic), see <expand_std exit> and diagnostics.\n"
|
637
|
-
, DBG);
|
638
|
-
}
|
639
|
-
|
640
|
-
return buf;
|
641
|
-
}
|
642
|
-
|
450
|
+
|
643
451
|
static char * replace(
|
644
452
|
DEFBUF * defp, /* Macro to be replaced */
|
645
453
|
char * out, /* Output Buffer */
|
@@ -710,7 +518,8 @@ static char * replace(
|
|
710
518
|
} else {
|
711
519
|
m_inf->locs.start_col = m_inf->locs.start_line = 0L;
|
712
520
|
}
|
713
|
-
m_inf->args =
|
521
|
+
m_inf->args = NULL;
|
522
|
+
m_inf->loc_args = NULL; /* Default args */
|
714
523
|
for (num = 1, recurs = 0; num < m_num; num++)
|
715
524
|
if (mac_inf[ num].defp == defp)
|
716
525
|
recurs++; /* Recursively nested macro */
|
@@ -721,21 +530,17 @@ static char * replace(
|
|
721
530
|
|
722
531
|
if (nargs < DEF_NOARGS_DYNAMIC) { /* __FILE__, __LINE__ */
|
723
532
|
defp = def_special( defp); /* These are redefined dynamically */
|
724
|
-
if (mcpp_mode == STD) {
|
725
533
|
/* Wrap repl-text with token separators to prevent token merging */
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
} else {
|
731
|
-
cur_out = stpcpy( cur_out, defp->repl);
|
732
|
-
}
|
534
|
+
*cur_out++ = TOK_SEP;
|
535
|
+
cur_out = stpcpy( cur_out, defp->repl);
|
536
|
+
*cur_out++ = TOK_SEP;
|
537
|
+
*cur_out = EOS;
|
733
538
|
if (enable_trace_macro) {
|
734
539
|
m_inf->defp = defp; /* Redefined dynamically*/
|
735
540
|
cur_out = close_macro_inf( cur_out, m_num, in_src_n);
|
736
541
|
}
|
737
542
|
return cur_out;
|
738
|
-
} else if (nargs == DEF_NOARGS_PREDEF_OLD
|
543
|
+
} else if (nargs == DEF_NOARGS_PREDEF_OLD
|
739
544
|
&& (warn_level & 1)) { /* Some macros on GCC */
|
740
545
|
cwarn( "Old style predefined macro \"%s\" is used", /* _W2_ */
|
741
546
|
defp->name, 0L, NULL);
|
@@ -756,7 +561,7 @@ static char * replace(
|
|
756
561
|
m_inf->args = arglist[ 0];
|
757
562
|
m_inf->num_args = num_args; /* Number of actual args*/
|
758
563
|
}
|
759
|
-
if (
|
564
|
+
if (outer && rt_file != infile) {
|
760
565
|
/* Has read over replacement-text */
|
761
566
|
if (compat_mode) {
|
762
567
|
enable_repl( outer, FALSE); /* Enable re-expansion */
|
@@ -838,29 +643,17 @@ static char * replace(
|
|
838
643
|
cur_out = out_p = out;
|
839
644
|
while ((c = *cur_out++) != EOS) {
|
840
645
|
if (c == MAC_INF) {
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
break;
|
853
|
-
}
|
854
|
-
} else {
|
855
|
-
switch (*cur_out) {
|
856
|
-
case MAC_ARG_START :
|
857
|
-
case MAC_ARG_END :
|
858
|
-
cur_out++;
|
859
|
-
/* Fall through */
|
860
|
-
default:
|
861
|
-
cur_out += 3;
|
862
|
-
break;
|
863
|
-
}
|
646
|
+
switch (*cur_out) {
|
647
|
+
case MAC_ARG_START :
|
648
|
+
cur_out++;
|
649
|
+
/* Fall through */
|
650
|
+
case MAC_CALL_START :
|
651
|
+
cur_out++;
|
652
|
+
cur_out++;
|
653
|
+
/* Fall through */
|
654
|
+
default:
|
655
|
+
cur_out++;
|
656
|
+
break;
|
864
657
|
}
|
865
658
|
} else {
|
866
659
|
*out_p++ = c;
|
@@ -889,10 +682,6 @@ static char * close_macro_inf(
|
|
889
682
|
m_inf = & mac_inf[ m_num];
|
890
683
|
*out_p++ = MAC_INF; /* Magic for end of macro expansion */
|
891
684
|
*out_p++ = MAC_CALL_END;
|
892
|
-
if (option_flags.v) {
|
893
|
-
*out_p++ = (m_num / UCHARMAX) + 1;
|
894
|
-
*out_p++ = (m_num % UCHARMAX) + 1;
|
895
|
-
}
|
896
685
|
*out_p = EOS;
|
897
686
|
get_ch(); /* Clear the garbage */
|
898
687
|
unget_ch();
|
@@ -988,16 +777,12 @@ static int prescan(
|
|
988
777
|
* inserted here and there.
|
989
778
|
*/
|
990
779
|
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
*workp++ = TOK_SEP; /* prevent unintended*/
|
998
|
-
*workp = EOS; /* token merging. */
|
999
|
-
file = unget_string( work_buf, defp->name);
|
1000
|
-
}
|
780
|
+
*out++ = TOK_SEP; /* Wrap replacement */
|
781
|
+
workp = work_buf; /* text with token */
|
782
|
+
workp = stpcpy( workp, defp->repl); /* separators to */
|
783
|
+
*workp++ = TOK_SEP; /* prevent unintended*/
|
784
|
+
*workp = EOS; /* token merging. */
|
785
|
+
file = unget_string( work_buf, defp->name);
|
1001
786
|
|
1002
787
|
while (c = get_ch(), file == infile) { /* To the end of repl */
|
1003
788
|
|
@@ -1026,10 +811,6 @@ static int prescan(
|
|
1026
811
|
out -= len;
|
1027
812
|
*out = EOS; /* Remove DEF_MAGIC, IN_SRC */
|
1028
813
|
}
|
1029
|
-
#if COMPILER == GNUC
|
1030
|
-
if (*prev_token == ',')
|
1031
|
-
break; /* ', ##' sequence (peculiar to GCC) */
|
1032
|
-
#endif
|
1033
814
|
if (horiz_space == out - 1) {
|
1034
815
|
*--out = EOS; /* Remove trailing white space */
|
1035
816
|
horiz_space = NULL;
|
@@ -1080,7 +861,6 @@ static char * catenate(
|
|
1080
861
|
* other characters.
|
1081
862
|
*/
|
1082
863
|
{
|
1083
|
-
FILEINFO * file;
|
1084
864
|
char * prev_prev_token = NULL;
|
1085
865
|
const char * invalid_token
|
1086
866
|
= "Not a valid preprocessing token \"%s\""; /* _E_ _W2_ */
|
@@ -1096,34 +876,25 @@ static char * catenate(
|
|
1096
876
|
out = prev_token; /* To overwrite */
|
1097
877
|
if (trace_macro)
|
1098
878
|
argp = remove_magics( argp, TRUE); /* Remove pair of magics */
|
1099
|
-
if (
|
1100
|
-
|| (mcpp_mode == STD && *argp == RT_END)) {
|
879
|
+
if (argp == (char*)RT_END) {
|
1101
880
|
*out = EOS; /* An empty argument */
|
1102
881
|
} else {
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
prev_prev_token = prev_token;
|
1117
|
-
prev_token = out; /* Remember the last token */
|
1118
|
-
scan_token( c, &out, out_end);
|
1119
|
-
} /* Copy actual argument without expansion */
|
1120
|
-
if (*prev_token == TOK_SEP) {
|
1121
|
-
out = prev_token;
|
1122
|
-
prev_token = prev_prev_token; /* Skip separator */
|
1123
|
-
}
|
882
|
+
|
883
|
+
unget_string( argp, NULL);
|
884
|
+
if (trace_macro)
|
885
|
+
free( (char *) argp);
|
886
|
+
/* malloc()ed in remove_magics() */
|
887
|
+
while ((c = get_ch()) != RT_END) {
|
888
|
+
prev_prev_token = prev_token;
|
889
|
+
prev_token = out; /* Remember the last token */
|
890
|
+
scan_token( c, &out, out_end);
|
891
|
+
} /* Copy actual argument without expansion */
|
892
|
+
if (*prev_token == TOK_SEP) {
|
893
|
+
out = prev_token;
|
894
|
+
prev_token = prev_prev_token; /* Skip separator */
|
1124
895
|
}
|
1125
896
|
if (*prev_token == DEF_MAGIC
|
1126
|
-
|| (
|
897
|
+
|| (*prev_token == IN_SRC)) {
|
1127
898
|
size_t len = 1;
|
1128
899
|
if (trace_macro && *prev_token == IN_SRC)
|
1129
900
|
len = IN_SRC_LEN;
|
@@ -1148,8 +919,7 @@ static char * catenate(
|
|
1148
919
|
argp = arglist[ c]; /* Actual argument */
|
1149
920
|
if (trace_macro)
|
1150
921
|
argp = remove_magics( argp, FALSE); /* Remove pair of magics */
|
1151
|
-
if (
|
1152
|
-
|| (mcpp_mode == STD && *argp == RT_END)) {
|
922
|
+
if (*argp == RT_END) {
|
1153
923
|
*out = EOS; /* An empty argument */
|
1154
924
|
} else {
|
1155
925
|
unget_string( argp, NULL);
|
@@ -1193,47 +963,30 @@ static char * catenate(
|
|
1193
963
|
scan_token( c, (workp = work_buf, &workp), work_end);
|
1194
964
|
infile->fp = NULL;
|
1195
965
|
if (*infile->bptr != EOS) { /* More than a token */
|
1196
|
-
|
1197
|
-
|
1198
|
-
diag_macro( CWARN, invalid_token, prev_token, 0L, NULL
|
1199
|
-
, defp, NULL);
|
1200
|
-
} else {
|
1201
|
-
diag_macro( CERROR, invalid_token, prev_token, 0L, NULL, defp
|
1202
|
-
, NULL);
|
1203
|
-
}
|
966
|
+
diag_macro( CERROR, invalid_token, prev_token, 0L, NULL, defp
|
967
|
+
, NULL);
|
1204
968
|
infile->bptr += strlen( infile->bptr);
|
1205
969
|
}
|
1206
970
|
get_ch(); /* To the parent "file" */
|
1207
971
|
unget_ch();
|
1208
972
|
}
|
1209
973
|
|
1210
|
-
|
1211
|
-
|
1212
|
-
*out = EOS;
|
1213
|
-
}
|
974
|
+
*out++ = TOK_SEP; /* Prevent token merging*/
|
975
|
+
*out = EOS;
|
1214
976
|
if (in_arg) { /* There are more tokens after the generated one */
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
unget_ch();
|
1222
|
-
} else {
|
1223
|
-
while ((c = get_ch()) != RT_END) {
|
1224
|
-
if (c == TOK_SEP)
|
1225
|
-
continue; /* Skip separator */
|
1226
|
-
prev_token = out; /* Remember the last token */
|
1227
|
-
scan_token( c, &out, out_end);
|
1228
|
-
} /* Copy rest of argument without expansion */
|
1229
|
-
}
|
977
|
+
while ((c = get_ch()) != RT_END) {
|
978
|
+
if (c == TOK_SEP)
|
979
|
+
continue; /* Skip separator */
|
980
|
+
prev_token = out; /* Remember the last token */
|
981
|
+
scan_token( c, &out, out_end);
|
982
|
+
} /* Copy rest of argument without expansion */
|
1230
983
|
}
|
1231
984
|
*token_p = prev_token; /* Report back the last token */
|
1232
985
|
|
1233
986
|
return out;
|
1234
987
|
}
|
1235
988
|
|
1236
|
-
static
|
989
|
+
static char * remove_magics(
|
1237
990
|
const char * argp, /* The argument list */
|
1238
991
|
int from_last /* token is the last or first? */
|
1239
992
|
)
|
@@ -1330,19 +1083,6 @@ static const char * remove_magics(
|
|
1330
1083
|
arg_id[ arg_n++][ ARG_E_LEN_V - 1] = FALSE;
|
1331
1084
|
break;
|
1332
1085
|
}
|
1333
|
-
if (option_flags.v) {
|
1334
|
-
switch (c) {
|
1335
|
-
case MAC_CALL_END :
|
1336
|
-
mac_id[ mac_n - 1][ 1] = *ap++ = get_ch();
|
1337
|
-
mac_id[ mac_n - 1][ 2] = *ap++ = get_ch();
|
1338
|
-
break;
|
1339
|
-
case MAC_ARG_END :
|
1340
|
-
arg_id[ arg_n - 1][ 1] = *ap++ = get_ch();
|
1341
|
-
arg_id[ arg_n - 1][ 2] = *ap++ = get_ch();
|
1342
|
-
arg_id[ arg_n - 1][ 3] = *ap++ = get_ch();
|
1343
|
-
break;
|
1344
|
-
}
|
1345
|
-
}
|
1346
1086
|
mgc_index[ ind++] = c; /* Index to mac_id[] and arg_id[] */
|
1347
1087
|
continue;
|
1348
1088
|
} else if (char_type[ c & UCHARMAX] & HSP) {
|
@@ -1393,11 +1133,6 @@ static const char * remove_magics(
|
|
1393
1133
|
nest_e--;
|
1394
1134
|
/* Search after the token */
|
1395
1135
|
if (token < mac_loc[ mac_e] && nest_e == nest_s - 1) {
|
1396
|
-
#if DEBUG_MACRO_ANN
|
1397
|
-
if (option_flags.v)
|
1398
|
-
chk_symmetry( mac_id[ mac_s], mac_id[ mac_e]
|
1399
|
-
, MAC_E_LEN - 2);
|
1400
|
-
#endif
|
1401
1136
|
mac_id[ mac_e][ MAC_S_LEN - 1] = TRUE;
|
1402
1137
|
/* To be removed */
|
1403
1138
|
break; /* Done for this mac_s */
|
@@ -1430,11 +1165,6 @@ static const char * remove_magics(
|
|
1430
1165
|
} else {
|
1431
1166
|
nest_e--;
|
1432
1167
|
if (token < arg_loc[ arg_e] && nest_e == nest_s - 1) {
|
1433
|
-
#if DEBUG_MACRO_ANN
|
1434
|
-
if (option_flags.v)
|
1435
|
-
chk_symmetry( arg_id[ arg_s], arg_id[ arg_e]
|
1436
|
-
, ARG_E_LEN_V - 2);
|
1437
|
-
#endif
|
1438
1168
|
arg_id[ arg_e][ ARG_S_LEN - 1] = TRUE;
|
1439
1169
|
break;
|
1440
1170
|
}
|
@@ -1474,7 +1204,7 @@ static const char * remove_magics(
|
|
1474
1204
|
mark = MAC_S_LEN - 1;
|
1475
1205
|
break;
|
1476
1206
|
case MAC_CALL_END :
|
1477
|
-
len =
|
1207
|
+
len = MAC_E_LEN;
|
1478
1208
|
mark = MAC_E_LEN_V - 1;
|
1479
1209
|
break;
|
1480
1210
|
case MAC_ARG_START :
|
@@ -1482,7 +1212,7 @@ static const char * remove_magics(
|
|
1482
1212
|
mark = ARG_S_LEN - 1;
|
1483
1213
|
break;
|
1484
1214
|
case MAC_ARG_END :
|
1485
|
-
len =
|
1215
|
+
len = ARG_E_LEN;
|
1486
1216
|
mark = ARG_E_LEN_V - 1;
|
1487
1217
|
break;
|
1488
1218
|
}
|
@@ -1559,15 +1289,13 @@ static char * stringize(
|
|
1559
1289
|
* Make a string literal from an argument.
|
1560
1290
|
*/
|
1561
1291
|
{
|
1562
|
-
|
1563
|
-
/* Verbose information of macro arguments */
|
1564
|
-
FILEINFO * file;
|
1292
|
+
|
1565
1293
|
int stray_bsl = FALSE; /* '\\' not in literal */
|
1566
1294
|
char * out_p = out;
|
1567
1295
|
int token_type;
|
1568
1296
|
int num_arg_magic = 0;
|
1569
1297
|
size_t len;
|
1570
|
-
size_t arg_e_len =
|
1298
|
+
size_t arg_e_len = ARG_E_LEN;
|
1571
1299
|
int c;
|
1572
1300
|
|
1573
1301
|
if (trace_macro) {
|
@@ -1585,7 +1313,6 @@ static char * stringize(
|
|
1585
1313
|
}
|
1586
1314
|
}
|
1587
1315
|
|
1588
|
-
file = unget_string( argp, NULL);
|
1589
1316
|
len = strlen( infile->buffer); /* Sequence ends with RT_END */
|
1590
1317
|
if (trace_macro) { /* Remove suffixed argument closing magics */
|
1591
1318
|
/* There are 0 or more argument closing magic sequences and */
|
@@ -1598,12 +1325,6 @@ static char * stringize(
|
|
1598
1325
|
|| *(infile->buffer + len - 2) == TOK_SEP))) {
|
1599
1326
|
if (*(infile->buffer + len - arg_e_len - 1) == MAC_INF
|
1600
1327
|
&& *(infile->buffer + len - arg_e_len) == MAC_ARG_END) {
|
1601
|
-
if (option_flags.v) {
|
1602
|
-
memcpy( arg_end_inf[ nmagic]
|
1603
|
-
, infile->buffer + len - arg_e_len + 1
|
1604
|
-
, arg_e_len - 2);
|
1605
|
-
arg_end_inf[ nmagic][ arg_e_len - 2] = EOS;
|
1606
|
-
}
|
1607
1328
|
nmagic++;
|
1608
1329
|
len -= arg_e_len;
|
1609
1330
|
*(infile->buffer + len - 1) = RT_END;
|
@@ -1625,8 +1346,7 @@ static char * stringize(
|
|
1625
1346
|
}
|
1626
1347
|
*out_p++ = '"'; /* Starting quote */
|
1627
1348
|
|
1628
|
-
while ((c = get_ch()), (
|
1629
|
-
|| (mcpp_mode == STD && c != RT_END))) {
|
1349
|
+
while ((c = get_ch()), (c != RT_END)) {
|
1630
1350
|
if (c == ' ' || c == '\t') {
|
1631
1351
|
*out_p++ = c;
|
1632
1352
|
continue;
|
@@ -1650,17 +1370,6 @@ static char * stringize(
|
|
1650
1370
|
get_ch();
|
1651
1371
|
break;
|
1652
1372
|
}
|
1653
|
-
if (option_flags.v) {
|
1654
|
-
switch (c) {
|
1655
|
-
case MAC_ARG_END :
|
1656
|
-
get_ch();
|
1657
|
-
/* Fall through */
|
1658
|
-
case MAC_CALL_END :
|
1659
|
-
get_ch();
|
1660
|
-
get_ch();
|
1661
|
-
break;
|
1662
|
-
}
|
1663
|
-
}
|
1664
1373
|
continue;
|
1665
1374
|
}
|
1666
1375
|
token_type = scan_token( c, (workp = work_buf, &workp), work_end);
|
@@ -1679,11 +1388,6 @@ static char * stringize(
|
|
1679
1388
|
} else if (c == '"') {
|
1680
1389
|
*out_p++ = '\\'; /* Insert '\\' */
|
1681
1390
|
} else if (c == '\\') {
|
1682
|
-
#if OK_UCN
|
1683
|
-
if (mcpp_mode == POST_STD || ! stdc3
|
1684
|
-
|| (*workp != 'u' && *workp != 'U'))
|
1685
|
-
/* Not UCN */
|
1686
|
-
#endif
|
1687
1391
|
*out_p++ = '\\';
|
1688
1392
|
}
|
1689
1393
|
*out_p++ = c;
|
@@ -1696,15 +1400,11 @@ static char * stringize(
|
|
1696
1400
|
}
|
1697
1401
|
}
|
1698
1402
|
|
1699
|
-
if (mcpp_mode == POST_STD)
|
1700
|
-
unget_ch();
|
1701
1403
|
*out_p++ = '"'; /* Closing quote */
|
1702
1404
|
if (trace_macro) {
|
1703
1405
|
while (num_arg_magic--) {
|
1704
1406
|
*out_p++ = MAC_INF; /* Restore removed magic*/
|
1705
1407
|
*out_p++ = MAC_ARG_END;
|
1706
|
-
if (option_flags.v)
|
1707
|
-
out_p = stpcpy( out_p, arg_end_inf[ num_arg_magic]);
|
1708
1408
|
}
|
1709
1409
|
}
|
1710
1410
|
*out_p = EOS;
|
@@ -1747,12 +1447,7 @@ static char * substitute(
|
|
1747
1447
|
* the formal parameters in the replacement list.
|
1748
1448
|
*/
|
1749
1449
|
{
|
1750
|
-
char * out_start = out;
|
1751
|
-
const char * arg;
|
1752
1450
|
int c;
|
1753
|
-
int gvar_arg; /* gvar_arg'th argument is GCC variable argument */
|
1754
|
-
|
1755
|
-
gvar_arg = (defp->nargs & GVA_ARGS) ? (defp->nargs & ~AVA_ARGS) : 0;
|
1756
1451
|
*out = EOS; /* Ensure to termanate */
|
1757
1452
|
|
1758
1453
|
while ((c = *in++) != EOS) {
|
@@ -1762,45 +1457,6 @@ static char * substitute(
|
|
1762
1457
|
mcpp_fprintf( DBG, " (expanding arg[%d])", c);
|
1763
1458
|
dump_string( NULL, arglist[ c - 1]);
|
1764
1459
|
}
|
1765
|
-
#if COMPILER == GNUC || COMPILER == MSC
|
1766
|
-
arg = arglist[ c - 1];
|
1767
|
-
if (trace_macro) {
|
1768
|
-
if (*arg == MAC_INF) {
|
1769
|
-
if (*++arg == MAC_ARG_START)
|
1770
|
-
arg += ARG_S_LEN - 1; /* Next to magic chars */
|
1771
|
-
}
|
1772
|
-
}
|
1773
|
-
#if COMPILER == GNUC
|
1774
|
-
if (c == gvar_arg && *arg == RT_END && ! ansi) {
|
1775
|
-
/*
|
1776
|
-
* GCC variadic macro and its variable argument is absent.
|
1777
|
-
* Note that in its "strict-ansi" mode GCC does not remove
|
1778
|
-
* ',', nevertheless it ignores '##' (inconsistent
|
1779
|
-
* behavior). Though GCC2 changes behavior depending the
|
1780
|
-
* ',' is preceded by space or not, we only count on the
|
1781
|
-
* "strict-ansi" flag.
|
1782
|
-
*/
|
1783
|
-
#else
|
1784
|
-
if ((defp->nargs & VA_ARGS) && c == (defp->nargs & ~VA_ARGS)
|
1785
|
-
&& *arg == RT_END && mcpp_mode == STD) {
|
1786
|
-
/* Visual C 2005 also removes ',' immediately preceding */
|
1787
|
-
/* absent variable arguments. It does not use '##' though. */
|
1788
|
-
#endif
|
1789
|
-
char * tmp;
|
1790
|
-
tmp = out - 1;
|
1791
|
-
while (char_type[ *tmp & UCHARMAX] & HSP)
|
1792
|
-
tmp--;
|
1793
|
-
if (*tmp == ',') {
|
1794
|
-
out = tmp; /* Remove the immediately preceding ',' */
|
1795
|
-
if (warn_level & 1) {
|
1796
|
-
*out = EOS;
|
1797
|
-
diag_macro( CWARN,
|
1798
|
-
"Removed ',' preceding the absent variable argument: %s" /* _W1_ */
|
1799
|
-
, out_start, 0L, NULL, defp, NULL);
|
1800
|
-
}
|
1801
|
-
}
|
1802
|
-
} else
|
1803
|
-
#endif
|
1804
1460
|
if ((out = rescan( NULL, arglist[ c - 1], out, out_end))
|
1805
1461
|
== NULL) { /* Replace completely */
|
1806
1462
|
return NULL; /* Error */
|
@@ -1841,10 +1497,6 @@ static char * rescan(
|
|
1841
1497
|
int c; /* First character of token */
|
1842
1498
|
int token_type;
|
1843
1499
|
char * mac_arg_start = NULL;
|
1844
|
-
#if COMPILER == GNUC
|
1845
|
-
int within_defined = FALSE;
|
1846
|
-
int within_defined_arg_depth = 0;
|
1847
|
-
#endif
|
1848
1500
|
|
1849
1501
|
if (mcpp_debug & EXPAND) {
|
1850
1502
|
mcpp_fprintf( DBG, "rescan_level--%d (%s) "
|
@@ -1853,11 +1505,9 @@ static char * rescan(
|
|
1853
1505
|
}
|
1854
1506
|
if (! disable_repl( outer)) /* Don't re-replace replacing macro */
|
1855
1507
|
return NULL; /* Too deeply nested macro call */
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
cur_cp = infile->bptr; /* Remember current location */
|
1860
|
-
}
|
1508
|
+
get_ch(); /* Clear empty "file"s */
|
1509
|
+
unget_ch(); /* for diagnostic */
|
1510
|
+
cur_cp = infile->bptr; /* Remember current location */
|
1861
1511
|
file = unget_string( in, outer ? outer->name : NULL);
|
1862
1512
|
/* Stack input on a "file" */
|
1863
1513
|
|
@@ -1887,41 +1537,14 @@ static char * rescan(
|
|
1887
1537
|
*out_p++ = get_ch();
|
1888
1538
|
break;
|
1889
1539
|
case MAC_ARG_END :
|
1890
|
-
|
1891
|
-
break;
|
1892
|
-
else
|
1893
|
-
*out_p++ = get_ch();
|
1894
|
-
/* Fall through */
|
1540
|
+
break;
|
1895
1541
|
case MAC_CALL_END :
|
1896
|
-
if (option_flags.v) {
|
1897
|
-
*out_p++ = get_ch();
|
1898
|
-
*out_p++ = get_ch();
|
1899
|
-
}
|
1900
1542
|
break;
|
1901
1543
|
} /* Pass these characters as they are */
|
1902
1544
|
continue;
|
1903
1545
|
}
|
1904
1546
|
token_type = scan_token( c, (tp = out_p, &out_p), out_end);
|
1905
|
-
|
1906
|
-
if (mcpp_mode == STD) {
|
1907
|
-
/* Pass stuff within defined() as they are, if in_directive */
|
1908
|
-
if ((within_defined || within_defined_arg_depth)) {
|
1909
|
-
if (c == '(') {
|
1910
|
-
within_defined_arg_depth++;
|
1911
|
-
within_defined = FALSE;
|
1912
|
-
} else if (within_defined_arg_depth && c == ')') {
|
1913
|
-
within_defined_arg_depth--;
|
1914
|
-
} /* Else should be a name (possibly macro) */
|
1915
|
-
continue;
|
1916
|
-
} else if (token_type == NAM && in_directive
|
1917
|
-
&& str_eq(identifier, "defined")) {
|
1918
|
-
within_defined = TRUE;
|
1919
|
-
/* 'defined' token in directive line */
|
1920
|
-
continue;
|
1921
|
-
}
|
1922
|
-
}
|
1923
|
-
#endif
|
1924
|
-
if (mcpp_mode == STD && c == IN_SRC)
|
1547
|
+
if (c == IN_SRC)
|
1925
1548
|
len = trace_macro ? IN_SRC_LEN : 1;
|
1926
1549
|
if (token_type == NAM && c != DEF_MAGIC
|
1927
1550
|
&& (inner = look_id( tp + len)) != NULL) { /* A macro name */
|
@@ -1933,11 +1556,9 @@ static char * rescan(
|
|
1933
1556
|
memset( &mgc_seq, 0, sizeof (MAGIC_SEQ));
|
1934
1557
|
if (is_macro_call( inner, &out_p, &endf
|
1935
1558
|
, trace_macro ? &mgc_seq : NULL)
|
1936
|
-
&& ((
|
1937
|
-
|| (mcpp_mode == STD
|
1938
|
-
&& (((is_able = is_able_repl( inner)) == YES)
|
1559
|
+
&& ((((is_able = is_able_repl( inner)) == YES)
|
1939
1560
|
|| (is_able == READ_OVER
|
1940
|
-
&& (c == IN_SRC || compat_mode)))))
|
1561
|
+
&& (c == IN_SRC || compat_mode))))) {
|
1941
1562
|
/* Really a macro call */
|
1942
1563
|
LINE_COL in_src_line_col = { 0L, 0};
|
1943
1564
|
int in_src_n = 0;
|
@@ -1955,8 +1576,7 @@ static char * rescan(
|
|
1955
1576
|
/* name and '('. This is a nuisance. */
|
1956
1577
|
char * mgc_cleared;
|
1957
1578
|
size_t seq_len;
|
1958
|
-
size_t arg_elen =
|
1959
|
-
: ARG_E_LEN;
|
1579
|
+
size_t arg_elen = ARG_E_LEN;
|
1960
1580
|
if ((tp - ARG_S_LEN) == mac_arg_start
|
1961
1581
|
&& *mgc_seq.magic_start == MAC_INF
|
1962
1582
|
&& *(mgc_seq.magic_start + 1) == MAC_ARG_END) {
|
@@ -1993,9 +1613,9 @@ static char * rescan(
|
|
1993
1613
|
*out_p = EOS;
|
1994
1614
|
}
|
1995
1615
|
if ((is_able = is_able_repl( inner)) == NO
|
1996
|
-
|| (
|
1616
|
+
|| (is_able == READ_OVER
|
1997
1617
|
&& c != IN_SRC && ! compat_mode)) {
|
1998
|
-
if (
|
1618
|
+
if (c != IN_SRC)
|
1999
1619
|
memmove( tp + 1, tp, (size_t) (out_p++ - tp));
|
2000
1620
|
*tp = DEF_MAGIC; /* Mark not to replace */
|
2001
1621
|
} /* Else not a macro call*/
|
@@ -2012,25 +1632,21 @@ static char * rescan(
|
|
2012
1632
|
|
2013
1633
|
if (out_p) {
|
2014
1634
|
*out_p = EOS;
|
2015
|
-
if (mcpp_mode == STD) {
|
2016
1635
|
if (c != RT_END) {
|
2017
|
-
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
1636
|
+
unget_ch();
|
1637
|
+
if (outer != NULL) { /* outer isn't a macro in argument */
|
1638
|
+
if (infile && infile->bptr != cur_cp
|
1639
|
+
/* Have overrun replacement list*/
|
1640
|
+
&& !(tp && *tp == DEF_MAGIC)
|
1641
|
+
/* Macro is enabled */
|
1642
|
+
&& ((!compat_mode && (warn_level & 1))
|
1643
|
+
|| (compat_mode && (warn_level & 8)))) {
|
1644
|
+
diag_macro( CWARN,
|
2026
1645
|
"Replacement text \"%s\" of macro %.0ld\"%s\" involved subsequent text" /* _W1_ */
|
2027
|
-
|
2028
|
-
}
|
1646
|
+
, in, 0L, outer->name, outer, inner);
|
2029
1647
|
}
|
2030
|
-
}
|
2031
|
-
}
|
2032
|
-
unget_ch();
|
2033
|
-
}
|
1648
|
+
}
|
1649
|
+
} /* Else remove RT_END */
|
2034
1650
|
}
|
2035
1651
|
enable_repl( outer, TRUE); /* Enable macro for later text */
|
2036
1652
|
if (mcpp_debug & EXPAND) {
|
@@ -2119,271 +1735,6 @@ static char * insert_to_bptr(
|
|
2119
1735
|
return infile->buffer;
|
2120
1736
|
}
|
2121
1737
|
|
2122
|
-
/*
|
2123
|
-
* M a c r o E x p a n s i o n i n P R E - S T A N D A R D M o d e
|
2124
|
-
*/
|
2125
|
-
|
2126
|
-
#include "setjmp.h"
|
2127
|
-
|
2128
|
-
static jmp_buf jump;
|
2129
|
-
|
2130
|
-
static char * arglist_pre[ NMACPARS]; /* Pointers to args */
|
2131
|
-
|
2132
|
-
static int rescan_pre( int c, char * mp, char * mac_end);
|
2133
|
-
/* Replace a macro repeatedly */
|
2134
|
-
static int replace_pre( DEFBUF * defp);
|
2135
|
-
/* Replace a macro once */
|
2136
|
-
static void substitute_pre( DEFBUF * defp);
|
2137
|
-
/* Substitute parms with args */
|
2138
|
-
|
2139
|
-
static char * expand_prestd(
|
2140
|
-
DEFBUF * defp, /* Macro definition */
|
2141
|
-
char * out, /* Output buffer */
|
2142
|
-
char * out_end, /* End of output buffer */
|
2143
|
-
LINE_COL line_col, /* Location of macro (not used in prestd) */
|
2144
|
-
int * pragma_op /* Flag of _Pragma (not used in prestd) */
|
2145
|
-
)
|
2146
|
-
/*
|
2147
|
-
* Expand a macro call completely, write the results to the specified buffer
|
2148
|
-
* and return the advanced pointer.
|
2149
|
-
*/
|
2150
|
-
{
|
2151
|
-
char macrobuf[ NMACWORK + IDMAX]; /* Buffer for rescan_pre() */
|
2152
|
-
char * mac_end = ¯obuf[ NMACWORK]; /* End of macrobuf[] */
|
2153
|
-
char * out_p; /* Pointer into out[] */
|
2154
|
-
char * mp = macrobuf; /* Pointer into macrobuf*/
|
2155
|
-
int len; /* Length of a token */
|
2156
|
-
int token_type; /* Type of token */
|
2157
|
-
int c;
|
2158
|
-
|
2159
|
-
macro_line = src_line; /* Line number for diag.*/
|
2160
|
-
unget_string( identifier, identifier); /* To re-read */
|
2161
|
-
macro_name = defp->name;
|
2162
|
-
rescan_level = 0;
|
2163
|
-
if (setjmp( jump) == 1) {
|
2164
|
-
skip_macro();
|
2165
|
-
mp = macrobuf;
|
2166
|
-
*mp = EOS;
|
2167
|
-
macro_line = MACRO_ERROR;
|
2168
|
-
goto err_end;
|
2169
|
-
}
|
2170
|
-
|
2171
|
-
while ((c = get_ch()) != CHAR_EOF && infile->fp == NULL) {
|
2172
|
-
/* While the input stream is a macro */
|
2173
|
-
while (c == ' ' || c == '\t') { /* Output the spaces */
|
2174
|
-
*mp++ = c;
|
2175
|
-
c = get_ch();
|
2176
|
-
if (infile == NULL || infile->fp != NULL)
|
2177
|
-
goto exp_end;
|
2178
|
-
}
|
2179
|
-
token_type = rescan_pre( c, mp, mac_end); /* Scan token */
|
2180
|
-
/* and expand. Result of expansion is written at mp. */
|
2181
|
-
|
2182
|
-
switch (token_type) {
|
2183
|
-
case STR: /* String literal */
|
2184
|
-
case CHR: /* Character constant */
|
2185
|
-
case NUM: /* Number token */
|
2186
|
-
case OPE: /* Operator or punct. */
|
2187
|
-
case NAM: /* Identifier */
|
2188
|
-
len = strlen( mp);
|
2189
|
-
mp += len;
|
2190
|
-
break;
|
2191
|
-
case SEP: /* Special character */
|
2192
|
-
switch( *mp) {
|
2193
|
-
case COM_SEP:
|
2194
|
-
if (mcpp_mode == OLD_PREP)
|
2195
|
-
break; /* Zero-length comment is removed now */
|
2196
|
-
/* Else fall through */
|
2197
|
-
default: /* Who knows ? */
|
2198
|
-
mp++; /* Copy the character */
|
2199
|
-
break;
|
2200
|
-
}
|
2201
|
-
break;
|
2202
|
-
case NO_TOKEN: break; /* End of file */
|
2203
|
-
default: /* Unkown token char. */
|
2204
|
-
mp++; /* Copy the character */
|
2205
|
-
break;
|
2206
|
-
}
|
2207
|
-
|
2208
|
-
if (mac_end <= mp) {
|
2209
|
-
*mp = EOS;
|
2210
|
-
cerror( macbuf_overflow, macro_name, 0L, macrobuf);
|
2211
|
-
longjmp( jump, 1);
|
2212
|
-
}
|
2213
|
-
if (mcpp_debug & GETC) {
|
2214
|
-
*mp = EOS;
|
2215
|
-
dump_string( "macrobuf", macrobuf);
|
2216
|
-
}
|
2217
|
-
}
|
2218
|
-
|
2219
|
-
exp_end:
|
2220
|
-
unget_ch();
|
2221
|
-
while (macrobuf < mp && (*(mp - 1) == ' ' || *(mp - 1) == '\t'))
|
2222
|
-
mp--; /* Remove trailing blank */
|
2223
|
-
macro_line = 0;
|
2224
|
-
*mp = EOS;
|
2225
|
-
if (mp - macrobuf > out_end - out) {
|
2226
|
-
cerror( macbuf_overflow, macro_name, 0L, macrobuf);
|
2227
|
-
macro_line = MACRO_ERROR;
|
2228
|
-
}
|
2229
|
-
err_end:
|
2230
|
-
out_p = stpcpy( out, macrobuf);
|
2231
|
-
if (mcpp_debug & EXPAND) {
|
2232
|
-
dump_string( "expand_prestd exit", out);
|
2233
|
-
}
|
2234
|
-
macro_name = NULL;
|
2235
|
-
clear_exp_mac();
|
2236
|
-
*pragma_op = FALSE;
|
2237
|
-
return out_p;
|
2238
|
-
}
|
2239
|
-
|
2240
|
-
static int rescan_pre(
|
2241
|
-
int c, /* First character of token */
|
2242
|
-
char * mp, /* Output buffer */
|
2243
|
-
char * mac_end /* End of output buffer */
|
2244
|
-
)
|
2245
|
-
/*
|
2246
|
-
* If the token is a macro name, replace the macro repeatedly until the first
|
2247
|
-
* token becomes a non-macro and return the type of token after expansion.
|
2248
|
-
*/
|
2249
|
-
{
|
2250
|
-
int token_type; /* Type of token */
|
2251
|
-
char * cp = mp; /* Value of mp should not be changed */
|
2252
|
-
DEFBUF * defp;
|
2253
|
-
FILEINFO * file;
|
2254
|
-
|
2255
|
-
while ((token_type = scan_token( c, &cp, mac_end)) == NAM
|
2256
|
-
&& (defp = look_id( identifier)) != NULL) { /* Macro */
|
2257
|
-
if (replace_pre( defp) == FALSE)
|
2258
|
-
break; /* Macro name with no argument */
|
2259
|
-
file = infile;
|
2260
|
-
c = get_ch();
|
2261
|
-
if (file != infile) { /* Replaced to 0 token */
|
2262
|
-
unget_ch();
|
2263
|
-
token_type = NO_TOKEN;
|
2264
|
-
break;
|
2265
|
-
}
|
2266
|
-
cp = mp; /* Overwrite on the macro call */
|
2267
|
-
} /* The macro call is replaced */
|
2268
|
-
return token_type;
|
2269
|
-
}
|
2270
|
-
|
2271
|
-
static int replace_pre(
|
2272
|
-
DEFBUF * defp /* Definition of the macro */
|
2273
|
-
)
|
2274
|
-
/*
|
2275
|
-
* Replace a macro one level. Called from expand_prestd() (via rescan_pre())
|
2276
|
-
* when an identifier is found in the macro table. It calls collect_args()
|
2277
|
-
* to parse actual arguments, checking for the correct number. It then
|
2278
|
-
* creates a "file" containing single line containing the replacement text
|
2279
|
-
* with the actual arguments inserted appropriately. This is "pushed back"
|
2280
|
-
* onto the input stream. (When get_ch() routine runs off the end of the macro
|
2281
|
-
* line, it will dismiss the macro itself.)
|
2282
|
-
*/
|
2283
|
-
{
|
2284
|
-
int arg_len;
|
2285
|
-
int c;
|
2286
|
-
|
2287
|
-
if (mcpp_debug & EXPAND) {
|
2288
|
-
dump_a_def( "replace_pre entry", defp, FALSE, TRUE, fp_debug);
|
2289
|
-
dump_unget( "replace_pre entry");
|
2290
|
-
}
|
2291
|
-
if (++rescan_level >= PRESTD_RESCAN_LIMIT) {
|
2292
|
-
diag_macro( CERROR
|
2293
|
-
, "Recursive macro definition of \"%s\"" /* _E_ */
|
2294
|
-
, defp->name, 0L, NULL, defp, NULL);
|
2295
|
-
longjmp( jump, 1);
|
2296
|
-
}
|
2297
|
-
|
2298
|
-
/*
|
2299
|
-
* Here's a macro to replace.
|
2300
|
-
*/
|
2301
|
-
switch (defp->nargs) {
|
2302
|
-
case DEF_NOARGS: /* No argument just stuffs */
|
2303
|
-
case DEF_NOARGS_PREDEF_OLD: /* Compiler-specific predef without '_' */
|
2304
|
-
case DEF_NOARGS_PREDEF: /* Compiler-specific predef */
|
2305
|
-
break;
|
2306
|
-
default: /* defp->nargs >= 0 */
|
2307
|
-
c = squeeze_ws( NULL, NULL, NULL); /* Look for and skip '('*/
|
2308
|
-
if (c != '(') { /* Macro name without following '(' */
|
2309
|
-
unget_ch();
|
2310
|
-
if (warn_level & 8)
|
2311
|
-
diag_macro( CWARN, only_name, defp->name, 0L, NULL, defp, NULL);
|
2312
|
-
return FALSE;
|
2313
|
-
} else {
|
2314
|
-
arglist_pre[ 0] = xmalloc( (size_t) (NMACWORK + IDMAX * 2));
|
2315
|
-
arg_len = collect_args( defp, arglist_pre, 0);
|
2316
|
-
/* Collect arguments */
|
2317
|
-
if (arg_len == ARG_ERROR) { /* End of input */
|
2318
|
-
free( arglist_pre[ 0]);
|
2319
|
-
longjmp( jump, 1);
|
2320
|
-
}
|
2321
|
-
}
|
2322
|
-
break;
|
2323
|
-
}
|
2324
|
-
|
2325
|
-
if (defp->nargs > 0)
|
2326
|
-
substitute_pre( defp); /* Do actual arguments */
|
2327
|
-
else
|
2328
|
-
unget_string( defp->repl, defp->name);
|
2329
|
-
|
2330
|
-
if (mcpp_debug & EXPAND)
|
2331
|
-
dump_unget( "replace_pre exit");
|
2332
|
-
if (defp->nargs >= 0)
|
2333
|
-
free( arglist_pre[ 0]);
|
2334
|
-
return TRUE;
|
2335
|
-
}
|
2336
|
-
|
2337
|
-
static void substitute_pre(
|
2338
|
-
DEFBUF * defp /* Current macro being replaced */
|
2339
|
-
)
|
2340
|
-
/*
|
2341
|
-
* Stuff the macro body, substituting formal parameters with actual arguments.
|
2342
|
-
*/
|
2343
|
-
{
|
2344
|
-
int c; /* Current character */
|
2345
|
-
FILEINFO * file; /* Funny #include */
|
2346
|
-
char * out_end; /* -> output buffer end */
|
2347
|
-
char * in_p; /* -> replacement text */
|
2348
|
-
char * out_p; /* -> macro output buff */
|
2349
|
-
|
2350
|
-
file = get_file( defp->name, NULL, NULL, (size_t) (NMACWORK + 1), FALSE);
|
2351
|
-
/* file == infile */
|
2352
|
-
in_p = defp->repl; /* -> macro replacement */
|
2353
|
-
out_p = file->buffer; /* -> output buffer */
|
2354
|
-
out_end = file->buffer + NMACWORK; /* -> buffer end */
|
2355
|
-
|
2356
|
-
while ((c = *in_p++) != EOS) {
|
2357
|
-
if (c == MAC_PARM) {
|
2358
|
-
c = (*in_p++ & UCHARMAX) - 1; /* Parm number */
|
2359
|
-
/*
|
2360
|
-
* Substitute formal parameter with actual argument.
|
2361
|
-
*/
|
2362
|
-
if (out_end <= (out_p + strlen( arglist_pre[ c])))
|
2363
|
-
goto nospace;
|
2364
|
-
out_p = stpcpy( out_p, arglist_pre[ c]);
|
2365
|
-
} else {
|
2366
|
-
*out_p++ = c;
|
2367
|
-
}
|
2368
|
-
if (out_end <= out_p)
|
2369
|
-
goto nospace;
|
2370
|
-
}
|
2371
|
-
|
2372
|
-
*out_p = EOS;
|
2373
|
-
file->buffer = xrealloc( file->buffer, strlen( file->buffer) + 1);
|
2374
|
-
file->bptr = file->buffer; /* Truncate buffer */
|
2375
|
-
if (mcpp_debug & EXPAND)
|
2376
|
-
dump_string( "substitute_pre macroline", file->buffer);
|
2377
|
-
return;
|
2378
|
-
|
2379
|
-
nospace:
|
2380
|
-
*out_p = EOS;
|
2381
|
-
diag_macro( CERROR, macbuf_overflow, defp->name, 0L, file->buffer, defp
|
2382
|
-
, NULL);
|
2383
|
-
longjmp( jump, 1);
|
2384
|
-
}
|
2385
|
-
|
2386
|
-
|
2387
1738
|
/*
|
2388
1739
|
* C O M M O N R O U T I N E S
|
2389
1740
|
* f o r S T A N D A R D a n d p r e - S T A N D A R D M o d e s
|
@@ -2436,19 +1787,17 @@ static int collect_args(
|
|
2436
1787
|
seq_end = seq + NMACWORK/2;
|
2437
1788
|
seq = stpcpy( seq, name);
|
2438
1789
|
*seq++ = '(';
|
2439
|
-
|
2440
|
-
|
2441
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2447
|
-
|
2448
|
-
|
2449
|
-
|
2450
|
-
/* 0-clear for default values, including empty argument */
|
2451
|
-
}
|
1790
|
+
/*
|
1791
|
+
* in_getarg is set TRUE while getting macro arguments, for the sake
|
1792
|
+
* of diagnostic's convenience. in_getarg is used only in STD mode.
|
1793
|
+
*/
|
1794
|
+
in_getarg = TRUE;
|
1795
|
+
if (trace_macro && m_num) {
|
1796
|
+
/* #pragma MCPP debug macro_call, and the macro is on source */
|
1797
|
+
mac_inf[ m_num].loc_args = loc = locs
|
1798
|
+
= (LOCATION *) xmalloc( (sizeof (LOCATION)) * UCHARMAX);
|
1799
|
+
memset( loc, 0, (sizeof (LOCATION)) * UCHARMAX);
|
1800
|
+
/* 0-clear for default values, including empty argument */
|
2452
1801
|
}
|
2453
1802
|
|
2454
1803
|
while (1) {
|
@@ -2474,13 +1823,12 @@ static int collect_args(
|
|
2474
1823
|
loc++; /* Advance pointer to infs */
|
2475
1824
|
if (warn_level & 2)
|
2476
1825
|
diag_macro( CWARN, empty_arg, sequence, 0L, NULL, defp, NULL);
|
2477
|
-
if (
|
1826
|
+
if (var_arg && nargs == args - 1) {
|
2478
1827
|
/* Variable arguments begin with an empty argument */
|
2479
1828
|
c = get_an_arg( c, &argp, arg_end, &seq, 1, nargs, &loc
|
2480
1829
|
, m_num, (trace_macro && m_num) ? &mgc_prefix : NULL);
|
2481
1830
|
} else {
|
2482
|
-
|
2483
|
-
*argp++ = RT_END;
|
1831
|
+
*argp++ = RT_END;
|
2484
1832
|
*argp++ = EOS;
|
2485
1833
|
}
|
2486
1834
|
if (++nargs == args)
|
@@ -2530,25 +1878,22 @@ static int collect_args(
|
|
2530
1878
|
if (warn_level & 2)
|
2531
1879
|
diag_macro( CWARN, empty_arg, sequence, 0L, NULL, defp, NULL);
|
2532
1880
|
} else if (nargs != args) { /* Wrong number of arguments*/
|
2533
|
-
if (
|
2534
|
-
|
2535
|
-
|
2536
|
-
|
2537
|
-
|
2538
|
-
|
2539
|
-
|
2540
|
-
|
2541
|
-
|
2542
|
-
, (long) args, sequence, defp, NULL);
|
2543
|
-
}
|
1881
|
+
if ((var_arg && (nargs == args - 1))
|
1882
|
+
/* Absence of variable arguments */
|
1883
|
+
) {
|
1884
|
+
if (warn_level & 1)
|
1885
|
+
diag_macro( CWARN, narg_error, nargs < args ? "Less"
|
1886
|
+
: "More", (long) args, sequence, defp, NULL);
|
1887
|
+
} else {
|
1888
|
+
diag_macro( CERROR, narg_error, nargs < args ? "Less" : "More"
|
1889
|
+
, (long) args, sequence, defp, NULL);
|
2544
1890
|
}
|
2545
1891
|
}
|
2546
1892
|
if (args < nargs) {
|
2547
1893
|
argp = valid_argp; /* Truncate excess arguments*/
|
2548
1894
|
} else {
|
2549
1895
|
for (c = nargs; c < args; c++) {
|
2550
|
-
|
2551
|
-
*argp++ = RT_END; /* For rescan() */
|
1896
|
+
*argp++ = RT_END; /* For rescan() */
|
2552
1897
|
*argp++ = EOS; /* Missing arguments */
|
2553
1898
|
}
|
2554
1899
|
if (c == 0)
|
@@ -2573,8 +1918,7 @@ static int collect_args(
|
|
2573
1918
|
dump_unget( "collect_args exit");
|
2574
1919
|
}
|
2575
1920
|
arg_ret:
|
2576
|
-
|
2577
|
-
in_getarg = FALSE;
|
1921
|
+
in_getarg = FALSE;
|
2578
1922
|
/* Return number of found arguments for function-like macro at most */
|
2579
1923
|
/* defp->nargs, or return defp->nargs for object-like macro. */
|
2580
1924
|
return defp->nargs <= DEF_NOARGS ? defp->nargs : nargs;
|
@@ -2689,23 +2033,15 @@ static int get_an_arg(
|
|
2689
2033
|
*argp++ = get_ch();
|
2690
2034
|
break;
|
2691
2035
|
case MAC_ARG_END :
|
2692
|
-
|
2693
|
-
break;
|
2694
|
-
else
|
2695
|
-
*argp++ = get_ch();
|
2696
|
-
/* Fall through */
|
2036
|
+
break;
|
2697
2037
|
case MAC_CALL_END :
|
2698
|
-
if (option_flags.v) {
|
2699
|
-
*argp++ = get_ch();
|
2700
|
-
*argp++ = get_ch();
|
2701
|
-
}
|
2702
2038
|
break;
|
2703
2039
|
}
|
2704
2040
|
break;
|
2705
2041
|
case CHAR_EOF : /* Unexpected EOF */
|
2706
2042
|
return 0;
|
2707
2043
|
default : /* Any token */
|
2708
|
-
if (
|
2044
|
+
if (token_type == NAM
|
2709
2045
|
&& c != IN_SRC && c != DEF_MAGIC && infile->fp) {
|
2710
2046
|
len = trace_arg ? IN_SRC_LEN : 1;
|
2711
2047
|
memmove( prevp + len, prevp, (size_t) (argp - prevp));
|
@@ -2771,28 +2107,18 @@ static int get_an_arg(
|
|
2771
2107
|
argp--; /* Remove the punctuator*/
|
2772
2108
|
if (mgc_seq.space)
|
2773
2109
|
--argp; /* Remove trailing space */
|
2774
|
-
|
2775
|
-
|
2776
|
-
|
2777
|
-
|
2778
|
-
|
2779
|
-
|
2780
|
-
}
|
2781
|
-
(*locp)++; /* Advance pointer even if !trace_arg */
|
2782
|
-
*argp++ = MAC_INF;
|
2783
|
-
*argp++ = MAC_ARG_END;
|
2784
|
-
if (option_flags.v) {
|
2785
|
-
*argp++ = (m_num / UCHARMAX) + 1;
|
2786
|
-
*argp++ = (m_num % UCHARMAX) + 1;
|
2787
|
-
*argp++ = nargs + 1;
|
2788
|
-
*argp = EOS;
|
2789
|
-
*argpp = chk_magic_balance( *argpp, argp, TRUE, FALSE);
|
2790
|
-
/* Check a stray magic caused by abnormal macro */
|
2791
|
-
/* and move it to an edge if found. */
|
2792
|
-
}
|
2110
|
+
|
2111
|
+
if (trace_macro && m_num) {
|
2112
|
+
if (trace_arg) { /* Location of end of an arg */
|
2113
|
+
get_src_location( & e_line_col);
|
2114
|
+
(*locp)->end_line = e_line_col.line;
|
2115
|
+
(*locp)->end_col = e_line_col.col;
|
2793
2116
|
}
|
2794
|
-
*
|
2117
|
+
(*locp)++; /* Advance pointer even if !trace_arg */
|
2118
|
+
*argp++ = MAC_INF;
|
2119
|
+
*argp++ = MAC_ARG_END;
|
2795
2120
|
}
|
2121
|
+
*argp++ = RT_END; /* For rescan() */
|
2796
2122
|
*argp++ = EOS; /* Terminate an argument*/
|
2797
2123
|
*argpp = argp;
|
2798
2124
|
return c;
|
@@ -2822,13 +2148,9 @@ static int squeeze_ws(
|
|
2822
2148
|
int space = 0;
|
2823
2149
|
int tsep = 0;
|
2824
2150
|
FILEINFO * file = infile;
|
2825
|
-
FILE * fp = infile->fp;
|
2826
2151
|
int end_of_file = (out && endf) ? FALSE : TRUE;
|
2827
2152
|
|
2828
|
-
while (((char_type[ c = get_ch()] & SPA) && (
|
2829
|
-
|| (mcpp_mode == POST_STD && file == infile)
|
2830
|
-
|| (mcpp_mode == STD
|
2831
|
-
&& ((macro_line != 0 && macro_line != MACRO_ERROR)
|
2153
|
+
while (((char_type[ c = get_ch()] & SPA) && ((((macro_line != 0 && macro_line != MACRO_ERROR)
|
2832
2154
|
|| file == infile))))
|
2833
2155
|
|| c == MAC_INF) {
|
2834
2156
|
if (! end_of_file && file != infile) { /* Infile has been read over*/
|
@@ -2843,8 +2165,7 @@ static int squeeze_ws(
|
|
2843
2165
|
wrong_line = TRUE;
|
2844
2166
|
break;
|
2845
2167
|
case TOK_SEP:
|
2846
|
-
|
2847
|
-
tsep++;
|
2168
|
+
tsep++;
|
2848
2169
|
continue; /* Skip COM_SEP in OLD_PREP mode */
|
2849
2170
|
case MAC_INF : /* Copy magics as they are, or skip */
|
2850
2171
|
if (mgc_seq && ! mgc_seq->magic_start)
|
@@ -2870,23 +2191,8 @@ static int squeeze_ws(
|
|
2870
2191
|
*(*out)++ = c;
|
2871
2192
|
break;
|
2872
2193
|
case MAC_ARG_END :
|
2873
|
-
|
2874
|
-
break;
|
2875
|
-
} else {
|
2876
|
-
c = get_ch();
|
2877
|
-
if (out)
|
2878
|
-
*(*out)++ = c;
|
2879
|
-
/* Fall through */
|
2880
|
-
}
|
2194
|
+
break;
|
2881
2195
|
case MAC_CALL_END :
|
2882
|
-
if (option_flags.v) {
|
2883
|
-
c = get_ch();
|
2884
|
-
if (out)
|
2885
|
-
*(*out)++ = c;
|
2886
|
-
c = get_ch();
|
2887
|
-
if (out)
|
2888
|
-
*(*out)++ = c;
|
2889
|
-
}
|
2890
2196
|
break;
|
2891
2197
|
}
|
2892
2198
|
if (mgc_seq) /* Remember end of last magic seq */
|
@@ -2908,10 +2214,7 @@ static int squeeze_ws(
|
|
2908
2214
|
*(*out)++ = TOK_SEP;
|
2909
2215
|
**out = EOS;
|
2910
2216
|
}
|
2911
|
-
if (
|
2912
|
-
unget_ch(); /* Arguments cannot cross "file"s */
|
2913
|
-
c = fp ? CHAR_EOF : RT_END; /* EOF is diagnosed by at_eof() */
|
2914
|
-
} else if (mcpp_mode == STD && macro_line == MACRO_ERROR
|
2217
|
+
if (macro_line == MACRO_ERROR
|
2915
2218
|
&& file != infile) { /* EOF */
|
2916
2219
|
unget_ch(); /* diagnosed by at_eof() or only */
|
2917
2220
|
c = CHAR_EOF; /* name of a function-like macro. */
|