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/system.H
CHANGED
@@ -41,11 +41,7 @@
|
|
41
41
|
|
42
42
|
#define SYSTEM_H
|
43
43
|
|
44
|
-
#if HAVE_CONFIG_H
|
45
44
|
#include "configed.H"
|
46
|
-
#else
|
47
|
-
#include "noconfig.H"
|
48
|
-
#endif
|
49
45
|
|
50
46
|
/* Some system has a wrong definition of UCHAR_MAX. See cpp-test.html#5.1.3 */
|
51
47
|
#if UCHARMAX < -255
|
@@ -168,28 +164,9 @@
|
|
168
164
|
#define STD 3 /* Standard moce */
|
169
165
|
#define POST_STD 9 /* Special mode of MCPP */
|
170
166
|
|
171
|
-
/*
|
172
|
-
* TRIGRAPHS_INIT Initial value for the -3 option. If TRUE -3
|
173
|
-
* disables trigraphs, if FALSE -3 enables them.
|
174
|
-
* DIGRAPHS_INIT Initial value for the -2 option. If TRUE -2
|
175
|
-
* disables digraphs, if FALSE -2 enables them.
|
176
|
-
* OK_UCN Enable recognition of Universal-Character-Name sequence
|
177
|
-
* by -V199901L option.
|
178
|
-
* OK_MBIDENT Enable multi-byte characters in identifier by -V199901L
|
179
|
-
* option.
|
180
|
-
* EXPAND_PRAGMA Enable macro expansion of #pragma line (even in modes
|
181
|
-
* other than C99).
|
182
|
-
* expr_t, uexpr_t Type of maximum integer:
|
183
|
-
* long long (unsigned long long) or longer.
|
184
|
-
* EXPR_MAX should be defined to the maximum value of uexpr_t.
|
185
|
-
*/
|
186
|
-
#define TRIGRAPHS_INIT FALSE
|
187
|
-
#define DIGRAPHS_INIT FALSE
|
188
167
|
#ifndef EXPAND_PRAGMA
|
189
168
|
#define EXPAND_PRAGMA FALSE
|
190
169
|
#endif
|
191
|
-
#define OK_UCN TRUE
|
192
|
-
#define OK_MBIDENT FALSE
|
193
170
|
|
194
171
|
#if HAVE_INTMAX_T
|
195
172
|
#if HAVE_STDINT_H
|
data/ext/ice/mcpp/system.c
CHANGED
@@ -36,12 +36,8 @@
|
|
36
36
|
* 1. specify the constants in "configed.H" or "noconfig.H",
|
37
37
|
* 2. append the system-dependent routines in this file.
|
38
38
|
*/
|
39
|
-
#if PREPROCESSED
|
40
|
-
#include "mcpp.H"
|
41
|
-
#else
|
42
39
|
#include "system.H"
|
43
40
|
#include "internal.H"
|
44
|
-
#endif
|
45
41
|
|
46
42
|
#if HOST_SYS_FAMILY == SYS_UNIX
|
47
43
|
#include "unistd.h" /* For getcwd(), readlink() */
|
@@ -110,24 +106,17 @@ static void usage( int opt);
|
|
110
106
|
/* Putout usage of MCPP */
|
111
107
|
static void set_opt_list( char * optlist);
|
112
108
|
/* Set list of legal option chars */
|
113
|
-
static int parse_warn_level( const char * mcpp_optarg, int opt);
|
114
|
-
/* Parse warning level option */
|
115
109
|
static void def_a_macro( int opt, char * def);
|
116
110
|
/* Do a -D option */
|
117
111
|
static void chk_opts( int sflag, int trad);
|
118
112
|
/* Check consistency of options */
|
119
|
-
#if COMPILER != GNUC
|
120
|
-
static void init_cpu_macro( int gval, int sse);
|
121
|
-
/* Predefine CPU-dependent macros */
|
122
|
-
#endif
|
123
113
|
static void init_predefines( void);
|
124
114
|
/* Set and unset predefined macros */
|
125
115
|
static void init_std_defines( void);
|
126
116
|
/* Predefine Standard macros */
|
127
117
|
static void set_limit( void);
|
128
118
|
/* Set minimum translation limits */
|
129
|
-
|
130
|
-
/* Set the _Pragma() operator */
|
119
|
+
|
131
120
|
static void put_info( FILEINFO * sharp_file);
|
132
121
|
/* Print compiler-specific-inf */
|
133
122
|
static char * set_files( int argc, char ** argv, char ** in_pp
|
@@ -149,15 +138,6 @@ static char * norm_path( const char * dir, const char * fname, int inf
|
|
149
138
|
static void deref_syml( char * slbuf1, char * slbuf2, char * chk_start);
|
150
139
|
/* Dereference symbolic linked directory and file */
|
151
140
|
#endif
|
152
|
-
#if COMPILER == GNUC
|
153
|
-
static void init_gcc_macro( void);
|
154
|
-
/* Predefine GCC-specific macros */
|
155
|
-
static void chk_env( void);
|
156
|
-
/* Check the environment variables */
|
157
|
-
#elif COMPILER == MSC
|
158
|
-
static void init_msc_macro( void);
|
159
|
-
/* Predefine Visual C-specific macros */
|
160
|
-
#endif
|
161
141
|
static void def_macros( void);
|
162
142
|
/* Define macros specified by -D */
|
163
143
|
static void undef_macros( void);
|
@@ -179,22 +159,6 @@ static int open_file( const char ** dirp, const char * src_dir
|
|
179
159
|
/* Open a source file */
|
180
160
|
static const char * set_fname( const char * filename);
|
181
161
|
/* Remember the source filename */
|
182
|
-
#if SYSTEM == SYS_MAC
|
183
|
-
#if COMPILER == GNUC
|
184
|
-
static char * search_header_map( const char * hmap_file
|
185
|
-
, const char * filename, char * pathlist);
|
186
|
-
/* Search header map file for a header */
|
187
|
-
static unsigned hmap_hash( const char * fname);
|
188
|
-
/* Get hash value for the fname */
|
189
|
-
#endif
|
190
|
-
static void init_framework( void);
|
191
|
-
/* Initialize framework[] */
|
192
|
-
static int search_framework( char * filename);
|
193
|
-
/* Search "Framework" directories */
|
194
|
-
static int search_subdir( char * fullname, char * cp, char * frame
|
195
|
-
, char * fname, int sys_frame);
|
196
|
-
/* Search "Headers" and other dirs */
|
197
|
-
#endif /* SYSTEM == SYS_MAC */
|
198
162
|
#if 0 /* This function is only for debugging use */
|
199
163
|
static int chk_dirp( const char ** dirp);
|
200
164
|
/* Check validity of dirp arg for open_file() */
|
@@ -213,16 +177,12 @@ static int included( const char * fullname);
|
|
213
177
|
/* The file has been once included? */
|
214
178
|
static void push_or_pop( int direction);
|
215
179
|
/* Push or pop a macro definition */
|
216
|
-
static int do_prestd_directive( void);
|
217
|
-
/* Process pre-Standard directives */
|
218
180
|
static void do_preprocessed( void);
|
219
181
|
/* Process preprocessed file */
|
220
182
|
static int do_debug( int set);
|
221
183
|
/* #pragma MCPP debug, #debug */
|
222
184
|
static void dump_path( void);
|
223
185
|
/* Print include search path */
|
224
|
-
static void do_asm( int asm_start);
|
225
|
-
/* Process #asm, #endasm */
|
226
186
|
static int mcpp_getopt( int argc, char * const * argv, const char * opts);
|
227
187
|
/* getopt() to prevent linking of glibc getopt */
|
228
188
|
|
@@ -245,7 +205,7 @@ static const char ** incend; /* -> active end of incdir */
|
|
245
205
|
static int max_inc; /* Number of incdir[] */
|
246
206
|
|
247
207
|
typedef struct inc_list { /* List of directories or files */
|
248
|
-
char
|
208
|
+
char *name; /* Filename or directory-name */
|
249
209
|
size_t len; /* Length of 'name' */
|
250
210
|
} INC_LIST;
|
251
211
|
|
@@ -303,58 +263,12 @@ static char * mkdep_mt; /* Argument of -MT option */
|
|
303
263
|
/* sharp_filename is filename for #line line, used only in cur_file() */
|
304
264
|
static char * sharp_filename = NULL;
|
305
265
|
static char * argv0; /* argv[ 0] for usage() and version() */
|
306
|
-
static int ansi; /* __STRICT_ANSI__ flag for GNUC */
|
307
266
|
static int compat_mode;
|
308
267
|
/* "Compatible" mode of recursive macro expansion */
|
309
|
-
#define MAX_ARCH_LEN 16
|
310
|
-
static char arch[ MAX_ARCH_LEN]; /* -arch or -m64, -m32 options */
|
311
|
-
|
312
|
-
#if COMPILER == GNUC
|
313
|
-
#define N_QUOTE_DIR 8
|
314
|
-
/* quote_dir[]: Include directories for "header" specified by -iquote */
|
315
|
-
/* quote_dir_end: Active end of quote_dir */
|
316
|
-
static const char * quote_dir[ N_QUOTE_DIR];
|
317
|
-
static const char ** quote_dir_end = quote_dir;
|
318
|
-
/* sys_dirp indicates the first directory to search for system headers. */
|
319
|
-
static const char ** sys_dirp = NULL; /* System header directory */
|
320
|
-
static const char * sysroot = NULL; /* Logical root directory of header */
|
321
|
-
static int i_split = FALSE; /* For -I- option */
|
322
|
-
static int gcc_work_dir = FALSE; /* For -fworking-directory */
|
323
|
-
static int gcc_maj_ver; /* __GNUC__ */
|
324
|
-
static int gcc_min_ver; /* __GNUC_MINOR__ */
|
325
|
-
static int dDflag = FALSE; /* Flag of -dD option */
|
326
|
-
static int dMflag = FALSE; /* Flag of -dM option */
|
327
|
-
#endif
|
328
|
-
|
329
|
-
#if COMPILER == GNUC || COMPILER == MSC
|
330
|
-
/*
|
331
|
-
* preinclude points to the file specified by -include (-Fl for MSC) option,
|
332
|
-
* which is included prior to the main input file.
|
333
|
-
*/
|
334
|
-
#define NPREINCLUDE 8
|
335
|
-
static char * preinclude[ NPREINCLUDE]; /* File to pre-include */
|
336
|
-
static char ** preinc_end = preinclude; /* -> active end of preinclude */
|
337
|
-
#endif
|
338
|
-
|
339
|
-
#if COMPILER == MSC
|
340
|
-
static int wchar_t_modified = FALSE; /* -Zc:wchar_t flag */
|
341
|
-
#endif
|
342
|
-
|
343
|
-
#if COMPILER == LCC
|
344
|
-
static const char * optim_name = "__LCCOPTIMLEVEL";
|
345
|
-
#endif
|
346
268
|
|
347
269
|
#if SYSTEM == SYS_CYGWIN
|
348
270
|
static int no_cygwin = FALSE; /* -mno-cygwin */
|
349
271
|
|
350
|
-
#elif SYSTEM == SYS_MAC
|
351
|
-
#define MAX_FRAMEWORK 8
|
352
|
-
static char * framework[ MAX_FRAMEWORK]; /* Framework directories*/
|
353
|
-
static int num_framework; /* Current number of framework[] */
|
354
|
-
static int sys_framework; /* System framework dir */
|
355
|
-
static const char ** to_search_framework;
|
356
|
-
/* Search framework[] next to the directory */
|
357
|
-
static int in_import; /* #import rather than #include */
|
358
272
|
#endif
|
359
273
|
|
360
274
|
#define NO_DIR FALSE
|
@@ -363,7 +277,6 @@ static int in_import; /* #import rather than #include */
|
|
363
277
|
static int no_dir;
|
364
278
|
#endif
|
365
279
|
|
366
|
-
#if MCPP_LIB
|
367
280
|
void init_system( void)
|
368
281
|
/* Initialize static variables */
|
369
282
|
{
|
@@ -373,37 +286,20 @@ void init_system( void)
|
|
373
286
|
incend = incdir = NULL;
|
374
287
|
fnamelist = once_list = NULL;
|
375
288
|
search_rule = SEARCH_INIT;
|
376
|
-
mb_changed = nflag =
|
289
|
+
mb_changed = nflag = compat_mode = FALSE;
|
377
290
|
mkdep_fp = NULL;
|
378
291
|
mkdep_target = mkdep_mf = mkdep_md = mkdep_mq = mkdep_mt = NULL;
|
379
292
|
std_val = -1L;
|
380
293
|
def_cnt = undef_cnt = 0;
|
381
294
|
mcpp_optind = mcpp_opterr = 1;
|
382
|
-
#if COMPILER == GNUC
|
383
|
-
sys_dirp = NULL;
|
384
|
-
sysroot = NULL;
|
385
|
-
gcc_work_dir = i_split = FALSE;
|
386
|
-
quote_dir_end = quote_dir;
|
387
|
-
dDflag = dMflag = FALSE;
|
388
|
-
#endif
|
389
|
-
#if COMPILER == MSC
|
390
|
-
wchar_t_modified = FALSE;
|
391
|
-
#endif
|
392
|
-
#if COMPILER == GNUC || COMPILER == MSC
|
393
|
-
preinc_end = preinclude;
|
394
|
-
#endif
|
395
295
|
#if SYSTEM == SYS_CYGWIN
|
396
296
|
no_cygwin = FALSE;
|
397
|
-
#elif SYSTEM == SYS_MAC
|
398
|
-
num_framework = sys_framework = 0;
|
399
|
-
to_search_framework = NULL;
|
400
297
|
#endif
|
401
298
|
#if NO_DIR
|
402
299
|
no_dir = FALSE;
|
403
300
|
#endif
|
404
301
|
}
|
405
302
|
|
406
|
-
#endif
|
407
303
|
|
408
304
|
#define OPTLISTLEN 80
|
409
305
|
|
@@ -418,34 +314,17 @@ void do_options(
|
|
418
314
|
*/
|
419
315
|
{
|
420
316
|
char optlist[ OPTLISTLEN]; /* List of option letter*/
|
421
|
-
const char * warning = "warning: -%c%s option is ignored\n";
|
422
317
|
int opt;
|
423
318
|
int unset_sys_dirs;
|
424
319
|
/* Unset system-specific and site-specific include directories ? */
|
425
320
|
int set_cplus_dir; /* Set C++ include directory ? (for GCC)*/
|
426
321
|
int show_path; /* Show include directory list */
|
427
|
-
DEFBUF * defp;
|
428
|
-
VAL_SIGN * valp;
|
429
322
|
int sflag; /* -S option or similar */
|
430
323
|
int trad; /* -traditional */
|
431
|
-
int old_mode; /* backup of 'mcpp_mode'*/
|
432
|
-
int gval, sse;
|
433
|
-
char * cp;
|
434
324
|
int i;
|
435
|
-
#if COMPILER == GNUC
|
436
|
-
#define NSYSDIR 8
|
437
|
-
/* System include directory specified by -isystem */
|
438
|
-
char * sysdir[ NSYSDIR] = { NULL, };
|
439
|
-
char ** sysdir_end = sysdir;
|
440
|
-
int integrated_cpp; /* Flag of cc1 which integrates cpp in it */
|
441
|
-
#elif COMPILER == LCC
|
442
|
-
const char * debug_name = "__LCCDEBUGLEVEL";
|
443
|
-
#endif
|
444
325
|
|
445
326
|
argv0 = argv[ 0];
|
446
327
|
nflag = unset_sys_dirs = show_path = sflag = trad = FALSE;
|
447
|
-
arch[ 0] = 0;
|
448
|
-
gval = sse = 0;
|
449
328
|
set_cplus_dir = TRUE;
|
450
329
|
|
451
330
|
/* Get current directory for -I option and #pragma once */
|
@@ -456,19 +335,6 @@ void do_options(
|
|
456
335
|
sprintf( cur_work_dir + strlen( cur_work_dir), "%c%c", PATH_DELIM, EOS);
|
457
336
|
/* Append trailing path-delimiter */
|
458
337
|
|
459
|
-
#if COMPILER == GNUC
|
460
|
-
defp = look_id( "__GNUC__"); /* Already defined by init_defines() */
|
461
|
-
gcc_maj_ver = atoi( defp->repl);
|
462
|
-
defp = look_id( "__GNUC_MINOR__");
|
463
|
-
gcc_min_ver = atoi( defp->repl);
|
464
|
-
integrated_cpp = ((gcc_maj_ver == 3 && gcc_min_ver >= 3)
|
465
|
-
|| gcc_maj_ver == 4);
|
466
|
-
#endif
|
467
|
-
#if COMPILER == GNUC || COMPILER == MSC
|
468
|
-
option_flags.dollar_in_name = TRUE;
|
469
|
-
/* GCC and Visual C allows '$' in name by default */
|
470
|
-
#endif
|
471
|
-
|
472
338
|
set_opt_list( optlist);
|
473
339
|
|
474
340
|
opt_search: ;
|
@@ -477,151 +343,10 @@ opt_search: ;
|
|
477
343
|
|
478
344
|
switch (opt) { /* Command line option character */
|
479
345
|
|
480
|
-
#if COMPILER == GNUC
|
481
|
-
case '$': /* Forbid '$' in identifier */
|
482
|
-
option_flags.dollar_in_name = FALSE;
|
483
|
-
break;
|
484
|
-
#endif
|
485
|
-
|
486
|
-
case '+':
|
487
|
-
#if COMPILER == GNUC
|
488
|
-
plus:
|
489
|
-
#endif
|
490
|
-
if (cplus_val || sflag) {
|
491
|
-
mcpp_fputs( "warning: -+ option is ignored\n", ERR);
|
492
|
-
break;
|
493
|
-
}
|
494
|
-
cplus_val = CPLUS;
|
495
|
-
break;
|
496
|
-
#if COMPILER == GNUC
|
497
|
-
case '-':
|
498
|
-
if (memcmp( mcpp_optarg, "sysroot", 7) == 0) {
|
499
|
-
if (mcpp_optarg[ 7] == '=') /* --sysroot=DIR */
|
500
|
-
sysroot = mcpp_optarg + 8;
|
501
|
-
else if (mcpp_optarg[ 7] == EOS) /* --sysroot DIR */
|
502
|
-
sysroot = argv[ mcpp_optind++];
|
503
|
-
else
|
504
|
-
usage( opt);
|
505
|
-
break;
|
506
|
-
} else {
|
507
|
-
usage( opt);
|
508
|
-
}
|
509
|
-
#endif
|
510
|
-
case '2': /* Reverse digraphs recognition */
|
511
|
-
option_flags.dig = ! option_flags.dig;
|
512
|
-
break;
|
513
|
-
case '3': /* Reverse trigraph recogniion */
|
514
|
-
option_flags.trig = ! option_flags.trig;
|
515
|
-
break;
|
516
|
-
|
517
|
-
case '@': /* Special preprocessing mode */
|
518
|
-
old_mode = mcpp_mode;
|
519
|
-
if (str_eq( mcpp_optarg, "post")
|
520
|
-
|| str_eq( mcpp_optarg, "poststd"))
|
521
|
-
mcpp_mode = POST_STD; /* 'post-Standard' mode */
|
522
|
-
else if (str_eq( mcpp_optarg, "old")
|
523
|
-
|| str_eq( mcpp_optarg, "oldprep"))
|
524
|
-
mcpp_mode = OLD_PREP; /* 'old-Preprocessor' mode */
|
525
|
-
else if (str_eq( mcpp_optarg, "kr"))
|
526
|
-
mcpp_mode = KR; /* 'K&R 1st' mode */
|
527
|
-
else if (str_eq( mcpp_optarg, "std"))
|
528
|
-
mcpp_mode = STD; /* 'Standard' mode (default)*/
|
529
|
-
else if (str_eq( mcpp_optarg, "compat")) {
|
530
|
-
compat_mode = TRUE; /* 'compatible' mode */
|
531
|
-
mcpp_mode = STD;
|
532
|
-
}
|
533
|
-
else
|
534
|
-
usage( opt);
|
535
|
-
standard = (mcpp_mode == STD || mcpp_mode == POST_STD);
|
536
|
-
if (old_mode != STD && old_mode != mcpp_mode)
|
537
|
-
mcpp_fprintf( ERR, "Mode is redefined to: %s\n", mcpp_optarg);
|
538
|
-
break;
|
539
|
-
|
540
|
-
#if COMPILER == GNUC
|
541
|
-
case 'A': /* Ignore -A system(gnu), -A cpu(vax) or so */
|
542
|
-
break;
|
543
|
-
case 'a':
|
544
|
-
if (str_eq( mcpp_optarg, "nsi")) { /* -ansi */
|
545
|
-
look_and_install( "__STRICT_ANSI__", DEF_NOARGS_PREDEF, null
|
546
|
-
, "1");
|
547
|
-
ansi = TRUE;
|
548
|
-
break;
|
549
|
-
} else if (memcmp( mcpp_optarg, "uxbase", 6) == 0) {
|
550
|
-
mcpp_optind++;
|
551
|
-
break; /* Ignore '-auxbase some' or such nonsence */
|
552
|
-
#if SYSTEM == SYS_MAC
|
553
|
-
} else if (str_eq( mcpp_optarg, "rch")) { /* -arch */
|
554
|
-
strcpy( arch, argv[ mcpp_optind++]);
|
555
|
-
if (str_eq( arch, "ppc") || str_eq( arch, "ppc7400")
|
556
|
-
|| str_eq( arch, "ppc64")
|
557
|
-
|| str_eq( arch, "i386") || str_eq( arch, "i686")
|
558
|
-
|| str_eq( arch, "x86_64") || str_eq( arch, "amd64")) {
|
559
|
-
if (str_eq( arch, "i686"))
|
560
|
-
strcpy( arch, "i386");
|
561
|
-
else if (str_eq( arch, "amd64"))
|
562
|
-
strcpy( arch, "x86_64");
|
563
|
-
else if (str_eq( arch, "ppc7400"))
|
564
|
-
strcpy( arch, "ppc");
|
565
|
-
break;
|
566
|
-
} /* Else usage() */
|
567
|
-
#endif
|
568
|
-
}
|
569
|
-
usage( opt);
|
570
|
-
#elif COMPILER == MSC
|
571
|
-
case 'a':
|
572
|
-
if (memcmp( mcpp_optarg, "rch", 3) == 0) {
|
573
|
-
if (str_eq( mcpp_optarg + 3, ":SSE") /* -arch:SSE */
|
574
|
-
|| str_eq( mcpp_optarg + 3, ":sse"))
|
575
|
-
sse = 1;
|
576
|
-
else if (str_eq( mcpp_optarg + 3, ":SSE2") /* -arch:SSE2 */
|
577
|
-
|| str_eq( mcpp_optarg + 3, ":sse2"))
|
578
|
-
sse = 2;
|
579
|
-
/* Else ignore */
|
580
|
-
} else {
|
581
|
-
usage( opt);
|
582
|
-
}
|
583
|
-
break;
|
584
|
-
|
585
|
-
case 'A':
|
586
|
-
option_flags.lang_asm = TRUE; /* "assembler" source */
|
587
|
-
break;
|
588
|
-
#else
|
589
|
-
case 'a':
|
590
|
-
option_flags.lang_asm = TRUE; /* "assembler" source */
|
591
|
-
break;
|
592
|
-
#endif
|
593
|
-
|
594
|
-
#if ! STD_LINE_PREFIX
|
595
|
-
case 'b':
|
596
|
-
std_line_prefix = TRUE; /* Putout line and file infor- */
|
597
|
-
break; /* mation in C source style. */
|
598
|
-
#endif
|
599
|
-
|
600
346
|
case 'C': /* Keep comments */
|
601
347
|
option_flags.c = TRUE;
|
602
348
|
break;
|
603
349
|
|
604
|
-
#if COMPILER == GNUC
|
605
|
-
case 'c':
|
606
|
-
if (! integrated_cpp)
|
607
|
-
usage( opt);
|
608
|
-
break; /* Else ignore this option */
|
609
|
-
case 'd':
|
610
|
-
if (str_eq( mcpp_optarg, "M")) { /* -dM */
|
611
|
-
dMflag = TRUE;
|
612
|
-
no_output++;
|
613
|
-
} else if (str_eq( mcpp_optarg, "D")) { /* -dD */
|
614
|
-
dDflag = TRUE;
|
615
|
-
} else if (str_eq( mcpp_optarg, "igraphs")) { /* -digraphs */
|
616
|
-
option_flags.dig = TRUE;
|
617
|
-
} else if (str_eq( mcpp_optarg, "umpbase")) { /* -dumpbase */
|
618
|
-
; /* Ignore */
|
619
|
-
} else {
|
620
|
-
usage( opt);
|
621
|
-
}
|
622
|
-
break;
|
623
|
-
#endif /* COMPILER == GNUC */
|
624
|
-
|
625
350
|
case 'D': /* Define symbol */
|
626
351
|
if (def_cnt >= MAX_DEF) {
|
627
352
|
mcpp_fputs( "Too many -D options.\n", ERR);
|
@@ -631,126 +356,13 @@ plus:
|
|
631
356
|
break;
|
632
357
|
|
633
358
|
case 'e':
|
634
|
-
|
635
|
-
if (set_encoding( mcpp_optarg, FALSE, 0) == NULL)
|
636
|
-
usage( opt);
|
637
|
-
mb_changed = TRUE;
|
359
|
+
// We support this option, but it does nothing.
|
638
360
|
break;
|
639
361
|
|
640
|
-
#if COMPILER == GNUC
|
641
|
-
case 'E':
|
642
|
-
if (! integrated_cpp)
|
643
|
-
usage( opt);
|
644
|
-
break; /* Ignore this option */
|
645
|
-
case 'f':
|
646
|
-
if (memcmp( mcpp_optarg, "input-charset=", 14) == 0) {
|
647
|
-
/* Treat -finput-charset= as the same option as -e */
|
648
|
-
if (set_encoding( mcpp_optarg + 14, FALSE, 0) == NULL)
|
649
|
-
usage( opt);
|
650
|
-
mb_changed = TRUE;
|
651
|
-
} else if (str_eq( mcpp_optarg, "working-directory")) {
|
652
|
-
gcc_work_dir = TRUE;
|
653
|
-
} else if (str_eq( mcpp_optarg, "no-working-directory")) {
|
654
|
-
gcc_work_dir = FALSE;
|
655
|
-
} else if (str_eq( mcpp_optarg, "stack-protector")) {
|
656
|
-
look_and_install( "__SSP__", DEF_NOARGS_PREDEF, null, "1");
|
657
|
-
} else if (str_eq( mcpp_optarg, "stack-protector-all")) {
|
658
|
-
look_and_install( "__SSP_ALL__", DEF_NOARGS_PREDEF, null, "2");
|
659
|
-
} else if (str_eq( mcpp_optarg, "exceptions")) {
|
660
|
-
look_and_install( "__EXCEPTIONS", DEF_NOARGS_PREDEF, null
|
661
|
-
, "1");
|
662
|
-
} else if (str_eq( mcpp_optarg, "no-exceptions")) {
|
663
|
-
undef_list[ undef_cnt++] = "__EXCEPTIONS";
|
664
|
-
} else if (str_eq( mcpp_optarg, "PIC")
|
665
|
-
|| str_eq( mcpp_optarg, "pic")
|
666
|
-
|| str_eq( mcpp_optarg, "PIE")
|
667
|
-
|| str_eq( mcpp_optarg, "pie")) {
|
668
|
-
look_and_install( "__PIC__", DEF_NOARGS_PREDEF, null, "1");
|
669
|
-
look_and_install( "__pic__", DEF_NOARGS_PREDEF, null, "1");
|
670
|
-
} else if (str_eq( mcpp_optarg, "no-dollars-in-identifiers")) {
|
671
|
-
option_flags.dollar_in_name = FALSE;
|
672
|
-
} else if (str_eq( mcpp_optarg, "no-show-column")) {
|
673
|
-
; /* Ignore this option */
|
674
|
-
} else if (! integrated_cpp) {
|
675
|
-
usage( opt);
|
676
|
-
}
|
677
|
-
break;
|
678
|
-
|
679
|
-
case 'g':
|
680
|
-
if (!isdigit( *mcpp_optarg)
|
681
|
-
&& str_eq( argv[ mcpp_optind - 2], "-g"))
|
682
|
-
/* Neither '-g 0' nor '-ggdb' -- No argument */
|
683
|
-
mcpp_optind--;
|
684
|
-
break; /* Ignore the option */
|
685
|
-
#elif COMPILER == LCC
|
686
|
-
case 'g': /* Define __LCCDEBUGLEVEL as <n> */
|
687
|
-
if (*(mcpp_optarg + 1) == EOS && isdigit( *mcpp_optarg)) {
|
688
|
-
defp = look_id( debug_name);
|
689
|
-
strcpy( defp->repl, mcpp_optarg);
|
690
|
-
} else {
|
691
|
-
usage( opt);
|
692
|
-
}
|
693
|
-
break;
|
694
|
-
#elif COMPILER == MSC
|
695
|
-
case 'G':
|
696
|
-
if (*(mcpp_optarg + 1) == EOS) { /* -Gx */
|
697
|
-
switch (*mcpp_optarg) {
|
698
|
-
case '3': case '4': case '5': case '6':
|
699
|
-
gval = *mcpp_optarg;
|
700
|
-
break;
|
701
|
-
case 'B': /* -GB */
|
702
|
-
gval = '6';
|
703
|
-
break;
|
704
|
-
case 'R':
|
705
|
-
look_and_install( "_CPPRTTI", DEF_NOARGS_PREDEF, null
|
706
|
-
, "1");
|
707
|
-
break;
|
708
|
-
case 'X':
|
709
|
-
look_and_install( "_CPPUNWIND", DEF_NOARGS_PREDEF, null
|
710
|
-
, "1");
|
711
|
-
break;
|
712
|
-
case 'Z':
|
713
|
-
look_and_install( "__MSVC_RUNTIME_CHECKS"
|
714
|
-
, DEF_NOARGS_PREDEF, null, "1");
|
715
|
-
break;
|
716
|
-
default :
|
717
|
-
mcpp_fprintf( ERR, warning, opt, mcpp_optarg);
|
718
|
-
}
|
719
|
-
} else {
|
720
|
-
usage( opt);
|
721
|
-
}
|
722
|
-
break;
|
723
|
-
#endif
|
724
|
-
|
725
|
-
#if SYSTEM == SYS_MAC
|
726
|
-
case 'F':
|
727
|
-
framework[ num_framework++] = mcpp_optarg;
|
728
|
-
break;
|
729
|
-
#endif
|
730
|
-
|
731
|
-
case 'h':
|
732
|
-
if (*(mcpp_optarg + 1) == EOS && isdigit( *mcpp_optarg))
|
733
|
-
/* a digit */
|
734
|
-
look_and_install( "__STDC_HOSTED__", DEF_NOARGS_PREDEF, null
|
735
|
-
, mcpp_optarg);
|
736
|
-
else
|
737
|
-
usage( opt);
|
738
|
-
break;
|
739
|
-
|
740
|
-
#if COMPILER == MSC
|
741
|
-
case 'X':
|
742
|
-
unset_sys_dirs = TRUE;
|
743
|
-
break;
|
744
|
-
#endif
|
745
362
|
case 'I': /* Include directory */
|
746
363
|
if (str_eq( mcpp_optarg, "-")) { /* -I- */
|
747
|
-
#if COMPILER == GNUC
|
748
|
-
sys_dirp = incend; /* Split include directories */
|
749
|
-
i_split = TRUE;
|
750
|
-
#else
|
751
364
|
unset_sys_dirs = TRUE;
|
752
365
|
/* Unset pre-specified include directories */
|
753
|
-
#endif
|
754
366
|
} else if (*(mcpp_optarg + 1) == EOS && isdigit( *mcpp_optarg)
|
755
367
|
&& (i = *mcpp_optarg - '0') != 0
|
756
368
|
&& (i & ~(CURRENT | SOURCE)) == 0) {
|
@@ -760,390 +372,17 @@ plus:
|
|
760
372
|
}
|
761
373
|
break;
|
762
374
|
|
763
|
-
#if COMPILER == MSC
|
764
|
-
case 'F':
|
765
|
-
if (str_eq( mcpp_optarg, "l")) { /* -Fl */
|
766
|
-
if (preinc_end >= &preinclude[ NPREINCLUDE]) {
|
767
|
-
mcpp_fputs( "Too many -Fl options.\n", ERR);
|
768
|
-
longjmp( error_exit, -1);
|
769
|
-
}
|
770
|
-
*preinc_end++ = argv[ mcpp_optind++];
|
771
|
-
} else {
|
772
|
-
usage( opt);
|
773
|
-
}
|
774
|
-
break;
|
775
|
-
#endif
|
776
|
-
|
777
|
-
#if COMPILER == GNUC
|
778
|
-
case 'i':
|
779
|
-
if (str_eq( mcpp_optarg, "nclude")) { /* -include */
|
780
|
-
if (preinc_end >= &preinclude[ NPREINCLUDE]) {
|
781
|
-
mcpp_fputs( "Too many -include options.\n", ERR);
|
782
|
-
longjmp( error_exit, -1);
|
783
|
-
}
|
784
|
-
*preinc_end++ = argv[ mcpp_optind++];
|
785
|
-
} else if (str_eq( mcpp_optarg, "system")) { /* -isystem */
|
786
|
-
if (sysdir_end >= &sysdir[ NSYSDIR]) {
|
787
|
-
mcpp_fputs( "Too many -isystem options.\n", ERR);
|
788
|
-
longjmp( error_exit, -1);
|
789
|
-
}
|
790
|
-
*sysdir_end++ = argv[ mcpp_optind++];
|
791
|
-
/* Add the directory before system include directory*/
|
792
|
-
} else if (str_eq( mcpp_optarg, "quote")) { /* -iquote */
|
793
|
-
if (quote_dir_end >= "e_dir[ N_QUOTE_DIR]) {
|
794
|
-
mcpp_fputs( "Too many -iquote options.\n", ERR);
|
795
|
-
longjmp( error_exit, -1);
|
796
|
-
}
|
797
|
-
*quote_dir_end++ = argv[ mcpp_optind++];
|
798
|
-
/* Add the directory for #include "header" */
|
799
|
-
} else if (memcmp( mcpp_optarg, "sysroot", 7) == 0) {
|
800
|
-
if (mcpp_optarg[ 7] == '=') /* -isysroot=DIR */
|
801
|
-
sysroot = mcpp_optarg + 8;
|
802
|
-
else if (mcpp_optarg[ 7] == EOS) /* -isysroot DIR */
|
803
|
-
sysroot = argv[ mcpp_optind++];
|
804
|
-
else
|
805
|
-
usage( opt);
|
806
|
-
} else if (str_eq( mcpp_optarg, "prefix") /* -iprefix */
|
807
|
-
|| str_eq( mcpp_optarg, "withprefix") /* -iwithprefix */
|
808
|
-
|| str_eq( mcpp_optarg, "withprefixbefore")
|
809
|
-
/* -iwithprefixbefore */
|
810
|
-
|| str_eq( mcpp_optarg, "dirafter") /* -idirafter */
|
811
|
-
|| str_eq( mcpp_optarg, "multilib")) { /* -imultilib */
|
812
|
-
mcpp_optind++; /* Skip the argument */
|
813
|
-
/* Ignore these options */
|
814
|
-
} else {
|
815
|
-
usage( opt);
|
816
|
-
}
|
817
|
-
break;
|
818
|
-
#endif
|
819
|
-
|
820
|
-
case 'j':
|
821
|
-
option_flags.no_source_line = TRUE;
|
822
|
-
break; /* Do not output the source line in diagnostics */
|
823
|
-
|
824
|
-
#if COMPILER == MSC
|
825
|
-
case 'J':
|
826
|
-
look_and_install( "_CHAR_UNSIGNED", DEF_NOARGS_PREDEF, null, "1");
|
827
|
-
break;
|
828
|
-
#endif
|
829
|
-
|
830
|
-
case 'K':
|
831
|
-
mcpp_debug |= MACRO_CALL;
|
832
|
-
/*
|
833
|
-
* Putout macro expansion informations embedded in comments.
|
834
|
-
* Same with '#pragma MCPP debug macro_call'.
|
835
|
-
*/
|
836
|
-
/* Enable white spaces preservation, too */
|
837
|
-
/* Fall through */
|
838
|
-
case 'k':
|
839
|
-
option_flags.k = TRUE;
|
840
|
-
/* Keep white spaces of input lines as they are */
|
841
|
-
break;
|
842
|
-
|
843
|
-
#if COMPILER == GNUC
|
844
|
-
case 'l':
|
845
|
-
if (memcmp( mcpp_optarg, "ang-", 4) != 0) {
|
846
|
-
usage( opt);
|
847
|
-
} else if (str_eq( mcpp_optarg + 4, "c")) { /* -lang-c */
|
848
|
-
; /* Ignore this option */
|
849
|
-
} else if (str_eq( mcpp_optarg + 4, "c99") /* -lang-c99*/
|
850
|
-
|| str_eq( mcpp_optarg + 4, "c9x")) { /* -lang-c9x*/
|
851
|
-
if (! sflag) {
|
852
|
-
stdc_val = 1; /* Define __STDC__ to 1 */
|
853
|
-
std_val = 199901L;
|
854
|
-
sflag = TRUE;
|
855
|
-
}
|
856
|
-
} else if (str_eq( mcpp_optarg + 4, "c89")) { /* -lang-c89*/
|
857
|
-
if (! sflag) {
|
858
|
-
stdc_val = 1; /* Define __STDC__ to 1 */
|
859
|
-
sflag = TRUE;
|
860
|
-
}
|
861
|
-
} else if (str_eq( mcpp_optarg + 4, "c++")) { /* -lang-c++*/
|
862
|
-
goto plus;
|
863
|
-
} else if (str_eq( mcpp_optarg + 4, "asm")) { /* -lang-asm*/
|
864
|
-
option_flags.lang_asm = TRUE;
|
865
|
-
} else {
|
866
|
-
usage( opt);
|
867
|
-
}
|
868
|
-
break;
|
869
|
-
#endif /* COMPILER == GNUC */
|
870
375
|
|
871
376
|
case 'M': /* Output source file dependency line */
|
872
|
-
if (
|
873
|
-
;
|
874
|
-
} else if (str_eq( mcpp_optarg, "D")) { /* -MD */
|
875
|
-
mkdep |= (MD_SYSHEADER | MD_FILE);
|
876
|
-
} else if (str_eq( mcpp_optarg, "MD")) { /* -MMD */
|
877
|
-
mkdep |= MD_FILE;
|
878
|
-
} else if (str_eq( mcpp_optarg, "P")) { /* -MP */
|
879
|
-
mkdep |= MD_PHONY;
|
880
|
-
} else if (str_eq( mcpp_optarg, "Q")) { /* -MQ target */
|
881
|
-
mkdep |= MD_QUOTE;
|
882
|
-
mkdep_mq = argv[ mcpp_optind++];
|
883
|
-
} else if (str_eq( mcpp_optarg, "T")) { /* -MT target */
|
884
|
-
mkdep_mt = argv[ mcpp_optind++];
|
885
|
-
} else if (str_eq( mcpp_optarg, "F")) { /* -MF file */
|
886
|
-
mkdep_mf = argv[ mcpp_optind++];
|
887
|
-
} else if (argv[ mcpp_optind - 1] == mcpp_optarg) { /* -M */
|
377
|
+
if (argv[ mcpp_optind - 1] == mcpp_optarg) { /* -M */
|
888
378
|
mkdep |= MD_SYSHEADER;
|
889
379
|
mcpp_optind--;
|
890
380
|
} else {
|
891
381
|
usage( opt);
|
892
382
|
}
|
893
|
-
if (str_eq( mcpp_optarg, "D") || str_eq( mcpp_optarg, "MD")) {
|
894
|
-
cp = argv[ mcpp_optind];
|
895
|
-
if (cp && *cp != '-') /* -MD (-MMD) file */
|
896
|
-
mkdep_md = argv[ mcpp_optind++];
|
897
|
-
}
|
898
383
|
mkdep |= MD_MKDEP;
|
899
384
|
break;
|
900
385
|
|
901
|
-
#if SYS_FAMILY == SYS_UNIX
|
902
|
-
case 'm':
|
903
|
-
if (str_eq( mcpp_optarg, "64")) { /* -m64 */
|
904
|
-
if (str_eq( CPU, "i386"))
|
905
|
-
strcpy( arch, "x86_64");
|
906
|
-
else if (str_eq( CPU, "ppc"))
|
907
|
-
strcpy( arch, "ppc64");
|
908
|
-
/* Else ignore */
|
909
|
-
break;
|
910
|
-
} else if (str_eq( mcpp_optarg, "32")) { /* -m32 */
|
911
|
-
if (str_eq( CPU, "x86_64"))
|
912
|
-
strcpy( arch, "i386");
|
913
|
-
else if (str_eq( CPU, "ppc64"))
|
914
|
-
strcpy( arch, "ppc");
|
915
|
-
/* Else ignore */
|
916
|
-
break;
|
917
|
-
} else if (str_eq( mcpp_optarg, "mmx")) { /* -mmmx */
|
918
|
-
look_and_install( "__MMX__", DEF_NOARGS_PREDEF, null, "1");
|
919
|
-
break;
|
920
|
-
} else if (str_eq( mcpp_optarg, "no-mmx")) { /* -mno-mmx */
|
921
|
-
undef_list[ undef_cnt++] = "__MMX__";
|
922
|
-
break;
|
923
|
-
}
|
924
|
-
#endif /* SYS_FAMILY == UNIX */
|
925
|
-
#if COMPILER == GNUC
|
926
|
-
#if SYSTEM == SYS_CYGWIN
|
927
|
-
if (str_eq( mcpp_optarg, "no-cygwin")) { /* -mno-cygwin */
|
928
|
-
no_cygwin = TRUE;
|
929
|
-
break;
|
930
|
-
}
|
931
|
-
#endif
|
932
|
-
if (! integrated_cpp)
|
933
|
-
usage( opt);
|
934
|
-
break;
|
935
|
-
|
936
|
-
case 'u':
|
937
|
-
if (! str_eq( mcpp_optarg, "ndef")) /* -undef */
|
938
|
-
usage( opt); /* Else fall through */
|
939
|
-
#endif /* COMPILER == GNUC */
|
940
|
-
|
941
|
-
#if COMPILER == MSC
|
942
|
-
case 'u':
|
943
|
-
#endif
|
944
|
-
case 'N':
|
945
|
-
/* No predefines: remove "unix", "__unix__" and friends. */
|
946
|
-
nflag = TRUE;
|
947
|
-
break;
|
948
|
-
|
949
|
-
#if COMPILER == GNUC || NO_DIR
|
950
|
-
case 'n':
|
951
|
-
#if NO_DIR
|
952
|
-
if (str_eq( mcpp_optarg, "odir")) { /* -nodir */
|
953
|
-
no_dir = TRUE;
|
954
|
-
}
|
955
|
-
#endif
|
956
|
-
#if COMPILER == GNUC
|
957
|
-
if (str_eq( mcpp_optarg, "ostdinc")) { /* -nostdinc */
|
958
|
-
unset_sys_dirs = TRUE; /* Unset pre-specified directories */
|
959
|
-
} else if (str_eq( mcpp_optarg, "ostdinc++")) { /* -nostdinc++ */
|
960
|
-
set_cplus_dir = FALSE; /* Unset C++-specific directories */
|
961
|
-
} else if (str_eq( mcpp_optarg, "oprecomp")) { /* -noprecomp */
|
962
|
-
mcpp_fprintf( ERR, warning, opt, mcpp_optarg);
|
963
|
-
break;
|
964
|
-
}
|
965
|
-
#endif
|
966
|
-
else {
|
967
|
-
usage( opt);
|
968
|
-
}
|
969
|
-
break;
|
970
|
-
#endif
|
971
|
-
|
972
|
-
#if COMPILER == GNUC
|
973
|
-
case 'O':
|
974
|
-
if (integrated_cpp) {
|
975
|
-
if (*mcpp_optarg == '-') /* No argument */
|
976
|
-
mcpp_optind--;
|
977
|
-
else if ((isdigit( *mcpp_optarg) && *mcpp_optarg != '0')
|
978
|
-
|| *mcpp_optarg == 's' || *mcpp_optarg == 'z')
|
979
|
-
/* -O1, -O2 -Os, -Oz */
|
980
|
-
look_and_install( "__OPTIMIZE__", DEF_NOARGS_PREDEF, null
|
981
|
-
, "1");
|
982
|
-
else if (! isdigit( *mcpp_optarg))
|
983
|
-
usage( opt);
|
984
|
-
/* Else -O0: ignore */
|
985
|
-
} else {
|
986
|
-
usage( opt);
|
987
|
-
}
|
988
|
-
break; /* Else ignore -Ox option */
|
989
|
-
#elif COMPILER == LCC
|
990
|
-
case 'O': /* Define __LCCOPTIMLEVEL as 1 */
|
991
|
-
defp = look_id( optim_name);
|
992
|
-
strcpy( defp->repl, "1");
|
993
|
-
break;
|
994
|
-
#endif
|
995
|
-
|
996
|
-
case 'o':
|
997
|
-
*out_pp = mcpp_optarg; /* Output file name */
|
998
|
-
break;
|
999
|
-
|
1000
|
-
case 'P': /* No #line output */
|
1001
|
-
option_flags.p = TRUE;
|
1002
|
-
break;
|
1003
|
-
|
1004
|
-
#if COMPILER == GNUC
|
1005
|
-
case 'p':
|
1006
|
-
if (str_eq( mcpp_optarg, "edantic") /* -pedantic */
|
1007
|
-
|| str_eq( mcpp_optarg, "edantic-errors")) {
|
1008
|
-
/* -pedantic-errors */
|
1009
|
-
/* This option does not imply -ansi */
|
1010
|
-
if (warn_level == -1)
|
1011
|
-
warn_level = 0;
|
1012
|
-
warn_level |= (1 | 2 | 4);
|
1013
|
-
if (! sflag && ! cplus_val) {
|
1014
|
-
stdc_val = 1;
|
1015
|
-
sflag = TRUE;
|
1016
|
-
}
|
1017
|
-
} else {
|
1018
|
-
usage( opt);
|
1019
|
-
}
|
1020
|
-
break;
|
1021
|
-
case 'q':
|
1022
|
-
if (str_eq( mcpp_optarg, "uiet"))
|
1023
|
-
/* -quiet: GCC's undocumented, yet frequently specified opt */
|
1024
|
-
break; /* Ignore the option */
|
1025
|
-
else
|
1026
|
-
usage( opt);
|
1027
|
-
break;
|
1028
|
-
#endif /* COMPILER == GNUC */
|
1029
|
-
|
1030
|
-
case 'Q':
|
1031
|
-
option_flags.q = TRUE;
|
1032
|
-
break;
|
1033
|
-
|
1034
|
-
#if COMPILER == MSC
|
1035
|
-
case 'R': /* -RTC1, -RTCc, -RTCs, -RTCu, etc. */
|
1036
|
-
if (memcmp( mcpp_optarg, "TC", 2) == 0
|
1037
|
-
&& *(mcpp_optarg + 2) != EOS)
|
1038
|
-
look_and_install( "__MSVC_RUNTIME_CHECKS", DEF_NOARGS_PREDEF
|
1039
|
-
, null, "1");
|
1040
|
-
else
|
1041
|
-
usage( opt);
|
1042
|
-
break;
|
1043
|
-
#endif
|
1044
|
-
|
1045
|
-
case 'S':
|
1046
|
-
if (cplus_val || sflag) { /* C++ or the second time */
|
1047
|
-
mcpp_fprintf( ERR, warning, opt, mcpp_optarg);
|
1048
|
-
break;
|
1049
|
-
}
|
1050
|
-
i = *mcpp_optarg;
|
1051
|
-
if (! isdigit( i) || *(mcpp_optarg + 1) != EOS)
|
1052
|
-
usage( opt);
|
1053
|
-
stdc_val = i - '0';
|
1054
|
-
sflag = TRUE;
|
1055
|
-
break;
|
1056
|
-
|
1057
|
-
#if COMPILER == GNUC
|
1058
|
-
case 'r':
|
1059
|
-
if (str_eq( mcpp_optarg, "emap"))
|
1060
|
-
mcpp_fprintf( ERR, warning, opt, mcpp_optarg);
|
1061
|
-
/* Ignore -remap option */
|
1062
|
-
else
|
1063
|
-
usage( opt);
|
1064
|
-
break;
|
1065
|
-
|
1066
|
-
case 's':
|
1067
|
-
if (memcmp( mcpp_optarg, "td=", 3) == 0
|
1068
|
-
&& strlen( mcpp_optarg) > 3) { /* -std=STANDARD*/
|
1069
|
-
cp = mcpp_optarg + 3;
|
1070
|
-
if (str_eq( cp, "c89") /* std=c89 */
|
1071
|
-
|| str_eq( cp, "c90") /* std=c90 */
|
1072
|
-
|| str_eq( cp, "gnu89") /* std=gnu89 */
|
1073
|
-
|| str_eq( cp, "iso9899:1990")) {
|
1074
|
-
std_val = 0L; /* C90 + extensions */
|
1075
|
-
} else if (str_eq( cp, "c99") /* std=c99 */
|
1076
|
-
|| str_eq( cp, "c9x") /* std=c9x */
|
1077
|
-
|| str_eq( cp, "gnu99") /* std=gnu99 */
|
1078
|
-
|| str_eq( cp, "gnu9x") /* std=gnu9x */
|
1079
|
-
|| str_eq( cp, "iso9899:1999")
|
1080
|
-
|| str_eq( cp, "iso9899:199x")) {
|
1081
|
-
std_val = 199901L;
|
1082
|
-
} else if (str_eq( cp, "c++98")) { /* std=c++98 */
|
1083
|
-
cplus_val = std_val = 199711L;
|
1084
|
-
} else if (memcmp( cp, "iso9899:", 8) == 0
|
1085
|
-
&& strlen( cp) >= 14) { /* std=iso9899:199409, etc. */
|
1086
|
-
mcpp_optarg = cp + 8;
|
1087
|
-
look_and_install( "__STRICT_ANSI__", DEF_NOARGS_PREDEF
|
1088
|
-
, null, "1");
|
1089
|
-
ansi = TRUE;
|
1090
|
-
goto Version;
|
1091
|
-
} else if (memcmp( cp, "iso14882", 8) == 0) {
|
1092
|
-
cp += 8;
|
1093
|
-
ansi = TRUE;
|
1094
|
-
if (cp && *cp == ':' && strlen( cp) >= 7) {
|
1095
|
-
/* std=iso14882:199711, etc. */
|
1096
|
-
cplus_val = CPLUS;
|
1097
|
-
mcpp_optarg = cp + 1;
|
1098
|
-
goto Version;
|
1099
|
-
} else {
|
1100
|
-
goto plus;
|
1101
|
-
}
|
1102
|
-
} else {
|
1103
|
-
usage( opt);
|
1104
|
-
}
|
1105
|
-
if (! cplus_val && memcmp( cp, "gnu", 3) != 0) {
|
1106
|
-
/* 'std=gnu*' does not imply -ansi */
|
1107
|
-
look_and_install( "__STRICT_ANSI__", DEF_NOARGS_PREDEF
|
1108
|
-
, null, "1");
|
1109
|
-
ansi = TRUE;
|
1110
|
-
}
|
1111
|
-
stdc_val = 1;
|
1112
|
-
sflag = TRUE;
|
1113
|
-
} else {
|
1114
|
-
usage( opt);
|
1115
|
-
}
|
1116
|
-
break;
|
1117
|
-
|
1118
|
-
case 't':
|
1119
|
-
if (str_eq( mcpp_optarg, "raditional")
|
1120
|
-
|| str_eq( mcpp_optarg, "raditional-cpp")) {
|
1121
|
-
/* -traditional, -traditional-cpp */
|
1122
|
-
trad = TRUE;
|
1123
|
-
mcpp_mode = OLD_PREP;
|
1124
|
-
} else if (str_eq( mcpp_optarg, "rigraphs")) {
|
1125
|
-
option_flags.trig = TRUE; /* -trigraphs */
|
1126
|
-
} else {
|
1127
|
-
usage( opt);
|
1128
|
-
}
|
1129
|
-
break;
|
1130
|
-
#endif /* COMPILER == GNUC */
|
1131
|
-
|
1132
|
-
#if COMPILER == MSC
|
1133
|
-
case 'T':
|
1134
|
-
if (strlen( mcpp_optarg) > 1)
|
1135
|
-
usage( opt);
|
1136
|
-
i = tolower( *mcpp_optarg); /* Fold case */
|
1137
|
-
if (i == 'c') {
|
1138
|
-
; /* Ignore this option */
|
1139
|
-
} else if (i == 'p') {
|
1140
|
-
cplus_val = CPLUS;
|
1141
|
-
} else {
|
1142
|
-
usage( opt);
|
1143
|
-
}
|
1144
|
-
break;
|
1145
|
-
#endif
|
1146
|
-
|
1147
386
|
case 'U': /* Undefine macro */
|
1148
387
|
if (undef_cnt >= MAX_UNDEF) {
|
1149
388
|
mcpp_fputs( "Too many -U options.\n", ERR);
|
@@ -1152,116 +391,6 @@ plus:
|
|
1152
391
|
undef_list[ undef_cnt++] = mcpp_optarg;
|
1153
392
|
break;
|
1154
393
|
|
1155
|
-
case 'V':
|
1156
|
-
#if COMPILER == GNUC
|
1157
|
-
Version:
|
1158
|
-
#endif
|
1159
|
-
valp = eval_num( mcpp_optarg);
|
1160
|
-
if (valp->sign == VAL_ERROR)
|
1161
|
-
usage( opt);
|
1162
|
-
std_val = (long) valp->val;
|
1163
|
-
break;
|
1164
|
-
|
1165
|
-
case 'v':
|
1166
|
-
option_flags.v = TRUE;
|
1167
|
-
show_path = TRUE;
|
1168
|
-
break;
|
1169
|
-
|
1170
|
-
case 'W': /* warning level */
|
1171
|
-
if (warn_level == -1) /* Have to initialize */
|
1172
|
-
warn_level = 0;
|
1173
|
-
#if COMPILER == GNUC
|
1174
|
-
if (argv[ mcpp_optind - 1] == mcpp_optarg) { /* No argument */
|
1175
|
-
/*
|
1176
|
-
* Note: -W without argument is not officially supported.
|
1177
|
-
* It may cause an error.
|
1178
|
-
*/
|
1179
|
-
warn_level |= (1 | 2 | 4 | 16);
|
1180
|
-
mcpp_optind--;
|
1181
|
-
} else if (str_eq( mcpp_optarg, "comment")
|
1182
|
-
|| str_eq( mcpp_optarg, "comments")
|
1183
|
-
|| str_eq( mcpp_optarg, "sign-compare")) {
|
1184
|
-
warn_level |= 1;
|
1185
|
-
} else if (str_eq( mcpp_optarg, "undef")) {
|
1186
|
-
warn_level |= 4;
|
1187
|
-
} else if (str_eq( mcpp_optarg, "all")) {
|
1188
|
-
warn_level |= (1 | 16); /* Convert -Wall to -W17*/
|
1189
|
-
} else if (str_eq( mcpp_optarg, "trigraphs")) {
|
1190
|
-
warn_level |= 16;
|
1191
|
-
}
|
1192
|
-
#endif /* COMPILER == GNUC */
|
1193
|
-
#if COMPILER == MSC
|
1194
|
-
if (str_eq( mcpp_optarg, "all")) {
|
1195
|
-
warn_level |= (1 | 16); /* Convert -Wall to -W17*/
|
1196
|
-
} else if (str_eq( mcpp_optarg, "L")) {
|
1197
|
-
option_flags.no_source_line = TRUE;
|
1198
|
-
/* Single-line diagnostic */
|
1199
|
-
}
|
1200
|
-
#endif
|
1201
|
-
if (isdigit( *mcpp_optarg)) {
|
1202
|
-
warn_level |= parse_warn_level( mcpp_optarg, opt);
|
1203
|
-
if (warn_level > 31 || warn_level < 0)
|
1204
|
-
usage( opt);
|
1205
|
-
}
|
1206
|
-
if (warn_level == 0)
|
1207
|
-
warn_level = 0xFF; /* Remember this option */
|
1208
|
-
/* Else ignore the option */
|
1209
|
-
break;
|
1210
|
-
|
1211
|
-
#if COMPILER == GNUC || COMPILER == MSC
|
1212
|
-
case 'w': /* Same as -W0 */
|
1213
|
-
warn_level = 0xFF; /* Remenber this option */
|
1214
|
-
break;
|
1215
|
-
#endif
|
1216
|
-
|
1217
|
-
#if COMPILER == GNUC
|
1218
|
-
case 'x':
|
1219
|
-
if (str_eq( mcpp_optarg, "c")) {
|
1220
|
-
break; /* -x c -- ignore this */
|
1221
|
-
} else if (str_eq( mcpp_optarg, "c++")) {
|
1222
|
-
goto plus;
|
1223
|
-
} else if (str_eq( mcpp_optarg, "assembler-with-cpp")) {
|
1224
|
-
option_flags.lang_asm = TRUE;
|
1225
|
-
break;
|
1226
|
-
} else {
|
1227
|
-
usage( opt);
|
1228
|
-
}
|
1229
|
-
break;
|
1230
|
-
#endif
|
1231
|
-
|
1232
|
-
#if COMPILER == MSC
|
1233
|
-
case 'Z':
|
1234
|
-
if (str_eq( mcpp_optarg, "c:wchar_t")) { /* -Zc:wchar_t */
|
1235
|
-
look_and_install( "_NATIVE_WCHAR_T_DEFINED", DEF_NOARGS_PREDEF
|
1236
|
-
, null, "1");
|
1237
|
-
look_and_install( "_WCHAR_T_DEFINED", DEF_NOARGS_PREDEF, null
|
1238
|
-
, "1");
|
1239
|
-
wchar_t_modified = TRUE;
|
1240
|
-
} else if (str_eq( mcpp_optarg, "c:wchar_t-")) {/* -Zc:wchar_t- */
|
1241
|
-
wchar_t_modified = TRUE; /* Do not define the macros */
|
1242
|
-
} else if (str_eq( mcpp_optarg, "l")) {
|
1243
|
-
look_and_install( "_VC_NODEFAULTLIB", DEF_NOARGS_PREDEF, null
|
1244
|
-
, "1");
|
1245
|
-
} else if (str_eq( mcpp_optarg, "a")) { /* -Za */
|
1246
|
-
undefine( "_MSC_EXTENSIONS");
|
1247
|
-
option_flags.dollar_in_name = FALSE;
|
1248
|
-
} else if (str_eq( mcpp_optarg, "e")) {
|
1249
|
-
/* Ignore -Ze silently */
|
1250
|
-
break;
|
1251
|
-
} else if (*(mcpp_optarg + 1) == EOS) {
|
1252
|
-
/* -Z followed by one char */
|
1253
|
-
mcpp_fprintf( ERR, warning, opt, mcpp_optarg);
|
1254
|
-
/* Ignore the option with warning */
|
1255
|
-
} else {
|
1256
|
-
usage( opt);
|
1257
|
-
}
|
1258
|
-
break;
|
1259
|
-
#endif
|
1260
|
-
|
1261
|
-
case 'z':
|
1262
|
-
option_flags.z = TRUE; /* No output of included file */
|
1263
|
-
break;
|
1264
|
-
|
1265
394
|
default: /* What is this one? */
|
1266
395
|
usage( opt);
|
1267
396
|
break;
|
@@ -1280,52 +409,6 @@ Version:
|
|
1280
409
|
else if (warn_level == 0xFF)
|
1281
410
|
warn_level = 0; /* -W0 has high precedence */
|
1282
411
|
|
1283
|
-
#if SYSTEM == SYS_MAC
|
1284
|
-
set_a_dir( NULL); /* Initialize incdir[] */
|
1285
|
-
to_search_framework = incend;
|
1286
|
-
/* Search framework[] next to the directory */
|
1287
|
-
#endif
|
1288
|
-
|
1289
|
-
#if COMPILER == GNUC && SYSTEM == SYS_MAC
|
1290
|
-
if (arch[ 0]) { /* -arch option has been specified */
|
1291
|
-
if (((str_eq( CPU, "i386") || str_eq( CPU, "x86_64"))
|
1292
|
-
&& (! str_eq( arch, "i386") && ! str_eq( arch, "x86_64")))
|
1293
|
-
|| ((str_eq( CPU, "ppc") || str_eq( CPU, "ppc64"))
|
1294
|
-
&& (! str_eq( arch, "ppc") && ! str_eq( arch, "ppc64")))) {
|
1295
|
-
mcpp_fprintf( ERR, "Wrong argument of -arch option: %s\n", arch);
|
1296
|
-
longjmp( error_exit, -1);
|
1297
|
-
}
|
1298
|
-
}
|
1299
|
-
#endif
|
1300
|
-
if (! arch[ 0]) {
|
1301
|
-
/* None of -arch, -m32 or -m64 options has been specified. */
|
1302
|
-
/* The CPU-specific-macros will be defined in init_cpu_macro(). */
|
1303
|
-
strcpy( arch, CPU);
|
1304
|
-
}
|
1305
|
-
#if COMPILER != GNUC
|
1306
|
-
init_cpu_macro( gval, sse);
|
1307
|
-
#endif
|
1308
|
-
|
1309
|
-
#if COMPILER == GNUC
|
1310
|
-
if (sysdir < sysdir_end) {
|
1311
|
-
char ** dp = sysdir;
|
1312
|
-
if (! sys_dirp || sys_dirp == incdir)
|
1313
|
-
sys_dirp = dp;
|
1314
|
-
while (dp < sysdir_end)
|
1315
|
-
set_a_dir( *dp++);
|
1316
|
-
}
|
1317
|
-
if (*in_pp && str_eq( (*in_pp) + strlen( *in_pp) - 2, ".S"))
|
1318
|
-
option_flags.lang_asm = TRUE; /* Input file name is *.S */
|
1319
|
-
if (option_flags.lang_asm) {
|
1320
|
-
look_and_install( "__ASSEMBLER__", DEF_NOARGS_PREDEF, null, "1");
|
1321
|
-
option_flags.dollar_in_name = FALSE; /* Disable '$' in name */
|
1322
|
-
}
|
1323
|
-
if (! sys_dirp || sys_dirp == incdir)
|
1324
|
-
sys_dirp = incend;
|
1325
|
-
#endif
|
1326
|
-
#if SYSTEM == SYS_MAC
|
1327
|
-
init_framework(); /* After setting sys_dirp */
|
1328
|
-
#endif
|
1329
412
|
set_env_dirs();
|
1330
413
|
if (! unset_sys_dirs)
|
1331
414
|
set_sys_dirs( set_cplus_dir);
|
@@ -1348,9 +431,6 @@ Version:
|
|
1348
431
|
/* Else mcpp_main() will diagnose *in_pp and exit */
|
1349
432
|
}
|
1350
433
|
if (! (mcpp_debug & MACRO_CALL)) {
|
1351
|
-
/* -K option alters behavior of -v option */
|
1352
|
-
if (option_flags.v)
|
1353
|
-
version();
|
1354
434
|
if (show_path) {
|
1355
435
|
fp_debug = stderr;
|
1356
436
|
dump_path();
|
@@ -1365,37 +445,12 @@ static void version( void)
|
|
1365
445
|
*/
|
1366
446
|
{
|
1367
447
|
const char * mes[] = {
|
1368
|
-
|
1369
|
-
#if MCPP_LIB
|
1370
448
|
/* Write messages here, for example, "MySomeTool with ". */
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
"MCPP V.", VERSION, " (", DATE, ") "
|
1377
|
-
#endif
|
1378
|
-
#if COMPILER == INDEPENDENT
|
1379
|
-
, "compiler-independent-build "
|
1380
|
-
#else
|
1381
|
-
#ifdef CMP_NAME
|
1382
|
-
, "for ", CMP_NAME, " "
|
1383
|
-
#endif
|
1384
|
-
#endif
|
1385
|
-
, "compiled by "
|
1386
|
-
#ifdef VERSION_MSG
|
1387
|
-
, VERSION_MSG
|
1388
|
-
#else
|
1389
|
-
#ifdef HOST_CMP_NAME
|
1390
|
-
, HOST_CMP_NAME
|
1391
|
-
#if HOST_COMPILER == GNUC
|
1392
|
-
, " V.", GCC_MAJOR_VERSION, ".", GCC_MINOR_VERSION
|
1393
|
-
#endif
|
1394
|
-
#endif
|
1395
|
-
#endif
|
1396
|
-
, "\n",
|
1397
|
-
NULL
|
1398
|
-
};
|
449
|
+
"MCPP V.2.7.2 (2008/11)"
|
450
|
+
, "https://github.com/zeroc-ice/mcpp"
|
451
|
+
, "compiler-independent-build "
|
452
|
+
, NULL
|
453
|
+
};
|
1399
454
|
|
1400
455
|
const char ** mpp = mes;
|
1401
456
|
while (*mpp)
|
@@ -1412,28 +467,11 @@ static void usage(
|
|
1412
467
|
const char * mes[] = {
|
1413
468
|
|
1414
469
|
"Usage: ",
|
1415
|
-
"mcpp",
|
1416
|
-
" [-<opts> [-<opts>]] [<infile> [-<opts>] [<outfile>] [-<opts>]]\n",
|
1417
|
-
" <infile> defaults to stdin and <outfile> defaults to stdout.\n",
|
1418
|
-
|
1419
|
-
"\nCommonly used options:\n",
|
1420
|
-
|
1421
|
-
"-@MODE Specify preprocessing mode. MODE should be one of these 4:\n",
|
1422
|
-
" -@std Standard conforming mode. (default)\n",
|
1423
|
-
" -@poststd, -@post special 'post-Standard' mode.\n",
|
1424
|
-
" -@kr K&R 1st mode.\n",
|
1425
|
-
" -@oldprep, -@old 'old_preprocessor' mode (i.e. 'Reiser model' cpp).\n",
|
1426
|
-
|
1427
|
-
#if COMPILER == MSC
|
1428
|
-
"-arch:SSE, -arch:SSE2 Define the macro _M_IX86_FP as 1, 2 respectively.\n",
|
1429
|
-
#endif
|
1430
|
-
#if SYSTEM == SYS_MAC && COMPILER == GNUC
|
1431
|
-
"-arch <arch> Change the target to <arch> (i386, x86_64, ppc, ppc64).\n",
|
1432
|
-
#endif
|
470
|
+
"mcpp",
|
471
|
+
" [-<opts> [-<opts>]] [<infile> [-<opts>] [<outfile>] [-<opts>]]\n",
|
472
|
+
" <infile> defaults to stdin and <outfile> defaults to stdout.\n",
|
1433
473
|
|
1434
|
-
|
1435
|
-
"-b Output #line lines in C source style.\n",
|
1436
|
-
#endif
|
474
|
+
"\nCommonly used options:\n",
|
1437
475
|
|
1438
476
|
"-C Output also comments.\n",
|
1439
477
|
"-D <macro>[=<value>] Define <macro> as <value> (default:1).\n",
|
@@ -1441,151 +479,14 @@ static void usage(
|
|
1441
479
|
"-e <encoding> Change the default multi-byte character encoding to one of:\n",
|
1442
480
|
" euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8.\n",
|
1443
481
|
|
1444
|
-
#if SYSTEM == SYS_MAC
|
1445
|
-
"-F <framework> Add <framework> to top of framework directory list.\n",
|
1446
|
-
#endif
|
1447
|
-
#if COMPILER == GNUC
|
1448
|
-
"-finput-charset=<encoding> Same as -e <encoding>.\n",
|
1449
|
-
" (Don't insert spaces around '=').\n",
|
1450
|
-
#endif
|
1451
|
-
#if COMPILER == MSC
|
1452
|
-
"-Fl <file> Include the <file> prior to the main input file.\n",
|
1453
|
-
"-G<n> Define the macro _M_IX86 according to <n>.\n",
|
1454
|
-
#endif
|
1455
|
-
#if COMPILER == LCC
|
1456
|
-
"-g <n> Define the macro __LCCDEBUGLEVEL as <n>.\n",
|
1457
|
-
#endif
|
1458
|
-
|
1459
482
|
"-I <directory> Add <directory> to the #include search list.\n",
|
1460
483
|
|
1461
|
-
#if COMPILER == GNUC
|
1462
|
-
"-isysroot <dir> Change root of system header directory to <dir>.\n",
|
1463
|
-
"-include <file> Include the <file> prior to the main input file.\n",
|
1464
|
-
#else
|
1465
484
|
"-I- Unset system or site specific include directories.\n",
|
1466
|
-
#endif
|
1467
|
-
#if COMPILER == MSC
|
1468
|
-
"-J Define the macro _CHAR_UNSIGNED as 1.\n",
|
1469
|
-
#endif
|
1470
485
|
|
1471
|
-
"-
|
1472
|
-
"-M, -MM, -MD, -MMD, -MP, -MQ target, -MT target, -MF file\n",
|
486
|
+
"-M file\n",
|
1473
487
|
" Output source file dependency line for makefile.\n",
|
1474
|
-
#if SYS_FAMILY == SYS_UNIX
|
1475
|
-
"-m32 Change target CPU from x86_64, ppc64 to i386, ppc, respectively.\n",
|
1476
|
-
"-m64 Change target CPU from i386, ppc to x86_64, ppc64, respectively.\n",
|
1477
|
-
#endif
|
1478
|
-
"-N Don't predefine any non-standard macros.\n",
|
1479
|
-
|
1480
|
-
#if COMPILER == GNUC
|
1481
|
-
"-nostdinc Unset system or site specific include directories.\n",
|
1482
|
-
#endif
|
1483
|
-
#if COMPILER == LCC
|
1484
|
-
"-O Define the macro __LCCOPTIMLEVEL as 1.\n",
|
1485
|
-
#endif
|
1486
|
-
|
1487
|
-
"-o <file> Output to <file>.\n",
|
1488
|
-
"-P Don't output #line lines.\n",
|
1489
|
-
"-Q Output diagnostics to \"mcpp.err\" (default:stderr).\n",
|
1490
|
-
#if COMPILER == MSC
|
1491
|
-
"-RTC* Define the macro __MSVC_RUNTIME_CHECKS as 1.\n",
|
1492
|
-
#endif
|
1493
|
-
#if COMPILER == GNUC
|
1494
|
-
"-traditional, -traditional-cpp Same as -@oldprep.\n",
|
1495
|
-
#endif
|
1496
488
|
"-U <macro> Undefine <macro>.\n",
|
1497
489
|
|
1498
|
-
#if COMPILER == GNUC
|
1499
|
-
"-undef Same as -N.\n",
|
1500
|
-
#endif
|
1501
|
-
#if COMPILER == MSC
|
1502
|
-
"-u Same as -N.\n",
|
1503
|
-
#endif
|
1504
|
-
|
1505
|
-
"-v Show version and include directories of mcpp.\n",
|
1506
|
-
"-W <level> Set warning level to <level> (OR of {0,1,2,4,8,16}, default:1).\n",
|
1507
|
-
|
1508
|
-
#if COMPILER == MSC
|
1509
|
-
"-WL Same as -j.\n",
|
1510
|
-
#endif
|
1511
|
-
#if COMPILER == MSC || COMPILER == GNUC
|
1512
|
-
"-w Same as -W0.\n",
|
1513
|
-
#endif
|
1514
|
-
#if COMPILER == MSC
|
1515
|
-
"-X Same as -I-.\n",
|
1516
|
-
"-Zc:wchar_t Define _NATIVE_WCHAR_T_DEFINED and _WCHAR_T_DEFINED as 1.\n",
|
1517
|
-
"-Zl Define the macro _VC_NODEFAULTLIB as 1.\n",
|
1518
|
-
#endif
|
1519
|
-
|
1520
|
-
"-z Don't output the included file, only defining macros.\n",
|
1521
|
-
|
1522
|
-
"\nOptions available with -@std (default) or -@poststd options:\n",
|
1523
|
-
|
1524
|
-
"-+ Process C++ source.\n",
|
1525
|
-
|
1526
|
-
#if DIGRAPHS_INIT
|
1527
|
-
"-2 Disable digraphs.\n",
|
1528
|
-
#else
|
1529
|
-
"-2 Enable digraphs.\n",
|
1530
|
-
#endif
|
1531
|
-
#if COMPILER == GNUC
|
1532
|
-
"-digraphs Enable digraphs.\n",
|
1533
|
-
#endif
|
1534
|
-
|
1535
|
-
"-h <n> Re-define the pre-defined macro __STDC_HOSTED__ as <n>.\n",
|
1536
|
-
|
1537
|
-
#if COMPILER == GNUC
|
1538
|
-
"-lang-c89 Same as -S1.\n",
|
1539
|
-
"-lang-c++ Same as -+.\n",
|
1540
|
-
"-pedantic, -pedantic-errors Same as -W7.\n",
|
1541
|
-
"-S <n> Redefine __STDC__ to <n>.\n",
|
1542
|
-
#else
|
1543
|
-
"-S <n> Redefine __STDC__ to <n>, undefine old style macros.\n",
|
1544
|
-
#endif
|
1545
|
-
|
1546
|
-
#if COMPILER == GNUC
|
1547
|
-
"-std=<STANDARD> Specify the standard to which the code should conform.\n",
|
1548
|
-
" <STANDARD> may be one of: c90, c99, iso9899:1990, iso14882, etc.\n",
|
1549
|
-
" iso9899:<n>, iso14882:<n> : Same as -V <n> (long in decimals).\n",
|
1550
|
-
#endif
|
1551
|
-
#if COMPILER == MSC
|
1552
|
-
"-Tp Same as -+.\n",
|
1553
|
-
#endif
|
1554
|
-
|
1555
|
-
"-V <n> Redefine __STDC_VERSION__ or __cplusplus to <n>.\n",
|
1556
|
-
" C with -V199901L specifies C99 specs.\n",
|
1557
|
-
" C++ with -V199901L specifies C99 compatible specs.\n",
|
1558
|
-
|
1559
|
-
#if COMPILER == GNUC
|
1560
|
-
"-x c++ Same as -+.\n",
|
1561
|
-
#endif
|
1562
|
-
|
1563
|
-
"\nOptions available with only -@std (default) option:\n",
|
1564
|
-
|
1565
|
-
"-@compat Expand recursive macro more than Standard.\n",
|
1566
|
-
#if TRIGRAPHS_INIT
|
1567
|
-
"-3 Disable trigraphs.\n",
|
1568
|
-
#else
|
1569
|
-
"-3 Enable trigraphs.\n",
|
1570
|
-
#endif
|
1571
|
-
"-K Output macro annotations embedding in comments.\n",
|
1572
|
-
#if COMPILER == GNUC
|
1573
|
-
"-trigraphs Enable trigraphs.\n",
|
1574
|
-
#endif
|
1575
|
-
|
1576
|
-
"\nOptions available with -@std (default), -@kr or -@oldprep options:\n",
|
1577
|
-
|
1578
|
-
#if COMPILER == GNUC
|
1579
|
-
"-lang-asm Same as -x assembler-with-cpp.\n",
|
1580
|
-
"-x assembler-with-cpp Process \"assembler\" source.\n",
|
1581
|
-
#elif COMPILER == MSC
|
1582
|
-
"-A Process \"assembler\" source.\n",
|
1583
|
-
#else
|
1584
|
-
"-a Process \"assembler\" source.\n",
|
1585
|
-
#endif
|
1586
|
-
|
1587
|
-
"-k Keep white spaces of input lines as they are.\n",
|
1588
|
-
|
1589
490
|
"\nFor further details see mcpp-manual.html.\n",
|
1590
491
|
NULL,
|
1591
492
|
};
|
@@ -1596,9 +497,7 @@ static void usage(
|
|
1596
497
|
if (opt != '?')
|
1597
498
|
mcpp_fprintf( ERR, illegopt, opt, mcpp_optarg ? mcpp_optarg : null);
|
1598
499
|
version();
|
1599
|
-
#if MCPP_LIB
|
1600
500
|
mes[ 1] = argv0;
|
1601
|
-
#endif
|
1602
501
|
while (*mpp)
|
1603
502
|
mcpp_fputs( *mpp++, ERR);
|
1604
503
|
longjmp( error_exit, -1);
|
@@ -1621,27 +520,14 @@ static void set_opt_list(
|
|
1621
520
|
"m:",
|
1622
521
|
#endif
|
1623
522
|
|
1624
|
-
#if COMPILER == GNUC
|
1625
|
-
"$A:a:cd:Ef:g:i:l:r:s:t:u:O:p:q:wx:",
|
1626
|
-
#elif COMPILER == MSC
|
1627
|
-
"Aa:F:G:JR:T:XZ:uw",
|
1628
|
-
#elif COMPILER == LCC
|
1629
|
-
"g:O",
|
1630
|
-
#endif
|
1631
|
-
|
1632
|
-
#if COMPILER != GNUC && COMPILER != MSC
|
1633
523
|
"a",
|
1634
|
-
#endif
|
1635
|
-
#if SYSTEM == SYS_MAC
|
1636
|
-
"F:-:",
|
1637
|
-
#endif
|
1638
524
|
|
1639
525
|
NULL
|
1640
526
|
};
|
1641
527
|
|
1642
528
|
const char * const * lp = & list[ 0];
|
1643
529
|
|
1644
|
-
strcpy( optlist, "
|
530
|
+
strcpy( optlist, "e:CD:I:M:U:");
|
1645
531
|
/* Default options */
|
1646
532
|
while (*lp)
|
1647
533
|
strcat( optlist, *lp++);
|
@@ -1649,46 +535,6 @@ static void set_opt_list(
|
|
1649
535
|
cfatal( "Bug: Too long option list", NULL, 0L, NULL); /* _F_ */
|
1650
536
|
}
|
1651
537
|
|
1652
|
-
static int parse_warn_level(
|
1653
|
-
const char * mcpp_optarg,
|
1654
|
-
int opt
|
1655
|
-
)
|
1656
|
-
/*
|
1657
|
-
* Parse warn level option.
|
1658
|
-
* Warning level option is specified as '19' or '1|2|16' or even '3|16'.
|
1659
|
-
* Even spaces are allowed as ' 1 | 2|16 '.
|
1660
|
-
*/
|
1661
|
-
{
|
1662
|
-
const char * cp = mcpp_optarg;
|
1663
|
-
int w, i;
|
1664
|
-
|
1665
|
-
w = i = 0;
|
1666
|
-
while( *cp != EOS) {
|
1667
|
-
while( *cp == ' ')
|
1668
|
-
cp++; /* Skip spaces */
|
1669
|
-
if (! isdigit( *cp))
|
1670
|
-
break; /* Error */
|
1671
|
-
while (isdigit( *cp)) {
|
1672
|
-
i *= 10;
|
1673
|
-
i += (*cp++ - '0');
|
1674
|
-
}
|
1675
|
-
while (*cp == ' ')
|
1676
|
-
cp++;
|
1677
|
-
if (*cp == '|') { /* Only digits or '|' are allowed */
|
1678
|
-
w |= i; /* Take OR of the args */
|
1679
|
-
i = 0;
|
1680
|
-
cp++;
|
1681
|
-
}
|
1682
|
-
}
|
1683
|
-
if (*cp != EOS) { /* Not ending with digit */
|
1684
|
-
mcpp_fprintf( ERR, "Illegal warning level option \"%s\"\n"
|
1685
|
-
, mcpp_optarg);
|
1686
|
-
usage( opt);
|
1687
|
-
}
|
1688
|
-
w |= i; /* Take the last arg */
|
1689
|
-
return w;
|
1690
|
-
}
|
1691
|
-
|
1692
538
|
static void def_a_macro(
|
1693
539
|
int opt, /* 'D' */
|
1694
540
|
char * def /* Argument of -D option */
|
@@ -1703,11 +549,6 @@ static void def_a_macro(
|
|
1703
549
|
char * cp;
|
1704
550
|
int i;
|
1705
551
|
|
1706
|
-
/* Convert trigraphs for the environment which need trigraphs */
|
1707
|
-
if (mcpp_mode == STD && option_flags.trig)
|
1708
|
-
cnv_trigraph( def);
|
1709
|
-
if (mcpp_mode == POST_STD && option_flags.dig)
|
1710
|
-
cnv_digraph( def); /* Convert prior to installing macro */
|
1711
552
|
definition = xmalloc( strlen( def) + 4);
|
1712
553
|
strcpy( definition, def);
|
1713
554
|
if ((cp = strchr( definition, '=')) != NULL) {
|
@@ -1750,44 +591,15 @@ static void chk_opts(
|
|
1750
591
|
{
|
1751
592
|
int incompat = FALSE;
|
1752
593
|
|
1753
|
-
|
1754
|
-
case STD :
|
1755
|
-
case POST_STD :
|
1756
|
-
if (trad)
|
1757
|
-
incompat = TRUE;
|
1758
|
-
if (! stdc_val)
|
1759
|
-
stdc_val = STDC;
|
1760
|
-
break;
|
1761
|
-
case KR :
|
1762
|
-
case OLD_PREP :
|
1763
|
-
#if COMPILER == GNUC
|
1764
|
-
if (sflag || cplus_val || ansi || std_val != -1L)
|
1765
|
-
#else
|
1766
|
-
if (sflag || cplus_val || std_val != -1L)
|
1767
|
-
#endif
|
1768
|
-
incompat = TRUE;
|
1769
|
-
if (option_flags.dig) {
|
1770
|
-
if (option_flags.dig != DIGRAPHS_INIT)
|
1771
|
-
incompat = TRUE;
|
1772
|
-
else
|
1773
|
-
option_flags.dig = 0;
|
1774
|
-
}
|
1775
|
-
break;
|
1776
|
-
}
|
1777
|
-
|
1778
|
-
if (mcpp_mode == POST_STD
|
1779
|
-
&& (option_flags.lang_asm || compat_mode || option_flags.k))
|
594
|
+
if (trad)
|
1780
595
|
incompat = TRUE;
|
1781
|
-
if (
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
option_flags.trig = FALSE;
|
1786
|
-
}
|
1787
|
-
if (mcpp_mode != STD && (mcpp_debug & MACRO_CALL))
|
596
|
+
if (! stdc_val)
|
597
|
+
stdc_val = STDC;
|
598
|
+
|
599
|
+
if (compat_mode)
|
1788
600
|
incompat = TRUE;
|
1789
601
|
if ((mcpp_debug & MACRO_CALL)
|
1790
|
-
&&
|
602
|
+
&& option_flags.c) {
|
1791
603
|
mcpp_fputs( "Disabled -K option.\n", ERR);
|
1792
604
|
mcpp_debug &= ~MACRO_CALL;
|
1793
605
|
/* -a and -C options do not co-exist with -K */
|
@@ -1797,90 +609,10 @@ static void chk_opts(
|
|
1797
609
|
usage( '?');
|
1798
610
|
}
|
1799
611
|
|
1800
|
-
|
1801
|
-
/* Modify magic characters in character type table. */
|
1802
|
-
if (! standard)
|
1803
|
-
char_type[ DEF_MAGIC] = 0;
|
1804
|
-
if (mcpp_mode != STD)
|
1805
|
-
char_type[ IN_SRC] = 0;
|
1806
|
-
if (mcpp_mode == POST_STD || mcpp_mode == KR)
|
1807
|
-
char_type[ TOK_SEP] = 0; /* TOK_SEP equals to COM_SEP */
|
1808
|
-
if (mcpp_mode != STD)
|
1809
|
-
char_type[ MAC_INF] = 0;
|
1810
|
-
|
1811
|
-
expand_init( compat_mode, ansi);
|
612
|
+
expand_init( compat_mode);
|
1812
613
|
/* Set function pointer to macro expansion routine */
|
1813
614
|
}
|
1814
615
|
|
1815
|
-
#if COMPILER != GNUC
|
1816
|
-
|
1817
|
-
static void init_cpu_macro (
|
1818
|
-
int gval, /* Argument of -G option for MSC */
|
1819
|
-
int sse /* Argument of -sse: option for MSC */
|
1820
|
-
)
|
1821
|
-
/*
|
1822
|
-
* Set predefined macros for CPU.
|
1823
|
-
* This routine is called from do_options() only once.
|
1824
|
-
* GCC-specific-build defines these macro by init_gcc_macro().
|
1825
|
-
*/
|
1826
|
-
{
|
1827
|
-
const char * cpu_macro[][ 7] = {
|
1828
|
-
#if SYS_FAMILY == SYS_UNIX
|
1829
|
-
{ "__i386__"
|
1830
|
-
#if SYSTEM == SYS_CYGWIN
|
1831
|
-
, "_X86_"
|
1832
|
-
#endif
|
1833
|
-
, NULL,},
|
1834
|
-
{ "__x86_64__", "__amd64__", NULL,},
|
1835
|
-
{ "__ppc__", "__powerpc__", NULL,},
|
1836
|
-
{ "__ppc64__", "__powerpc64__", NULL,}
|
1837
|
-
#elif SYS_FAMILY == SYS_WIN
|
1838
|
-
{ "_WIN32", "__WIN32__", "_X86_"
|
1839
|
-
#if SYSTEM == SYS_MINGW
|
1840
|
-
, "__i386__"
|
1841
|
-
#endif
|
1842
|
-
, NULL,},
|
1843
|
-
{ "_WIN32", "_WIN64", "__WIN64__", "_M_AMD64", "_AMD64_", "_X64_"
|
1844
|
-
, NULL,}, /* "_WIN32" is defined even on Windows 64 */
|
1845
|
-
{ NULL,}, /* Not supported */
|
1846
|
-
{ NULL,} /* Not supported */
|
1847
|
-
#endif
|
1848
|
-
};
|
1849
|
-
const char ** macro;
|
1850
|
-
int index;
|
1851
|
-
|
1852
|
-
if (str_eq( arch, "i386"))
|
1853
|
-
index = 0;
|
1854
|
-
else if (str_eq( arch, "x86_64"))
|
1855
|
-
index = 1;
|
1856
|
-
else if (str_eq( arch, "ppc"))
|
1857
|
-
index = 2;
|
1858
|
-
else if (str_eq( arch, "ppc64"))
|
1859
|
-
index = 3;
|
1860
|
-
else
|
1861
|
-
index = 9;
|
1862
|
-
|
1863
|
-
if (index == 9) { /* Unknown CPU */
|
1864
|
-
look_and_install( "__" CPU "__", DEF_NOARGS_PREDEF, null, "1");
|
1865
|
-
return;
|
1866
|
-
}
|
1867
|
-
macro = cpu_macro[ index];
|
1868
|
-
while (*macro)
|
1869
|
-
look_and_install( *macro++, DEF_NOARGS_PREDEF, null, "1");
|
1870
|
-
#if SYS_FAMILY == SYS_WIN
|
1871
|
-
if (index == 0) {
|
1872
|
-
char val[] = "600";
|
1873
|
-
if (gval)
|
1874
|
-
val[ 0] = gval;
|
1875
|
-
look_and_install( "_M_IX86", DEF_NOARGS_PREDEF, null, val);
|
1876
|
-
val[ 0] = '0' + sse;
|
1877
|
-
val[ 1] = '\0';
|
1878
|
-
look_and_install( "_M_IX86_FP", DEF_NOARGS_PREDEF, null, val);
|
1879
|
-
}
|
1880
|
-
#endif
|
1881
|
-
}
|
1882
|
-
#endif /* COMPILER != GNUC */
|
1883
|
-
|
1884
616
|
static void init_predefines( void)
|
1885
617
|
/*
|
1886
618
|
* Set or unset predefined macros.
|
@@ -1888,43 +620,23 @@ static void init_predefines( void)
|
|
1888
620
|
{
|
1889
621
|
char tmp[ 16];
|
1890
622
|
|
1891
|
-
|
1892
|
-
if (cplus_val)
|
1893
|
-
cplus_val = std_val; /* Value of __cplusplus */
|
1894
|
-
else
|
1895
|
-
stdc_ver = std_val; /* Value of __STDC_VERSION__ */
|
1896
|
-
} else {
|
1897
|
-
if (! cplus_val)
|
1898
|
-
stdc_ver = stdc_val ? STDC_VERSION : 0L;
|
1899
|
-
}
|
623
|
+
stdc_ver = stdc_val ? STDC_VERSION : 0L;
|
1900
624
|
|
1901
625
|
if (nflag) {
|
1902
626
|
un_predefine( TRUE);
|
1903
|
-
} else if (stdc_val
|
1904
|
-
#if COMPILER != GNUC
|
627
|
+
} else if (stdc_val) {
|
1905
628
|
un_predefine( FALSE); /* Undefine "unix" or so */
|
1906
|
-
#endif
|
1907
629
|
}
|
1908
|
-
sprintf( tmp, "%ldL",
|
1909
|
-
if (
|
1910
|
-
look_and_install( "
|
1911
|
-
|
1912
|
-
if (stdc_ver)
|
1913
|
-
look_and_install( "__STDC_VERSION__", DEF_NOARGS_STANDARD, null
|
1914
|
-
, tmp);
|
630
|
+
sprintf( tmp, "%ldL", stdc_ver);
|
631
|
+
if (stdc_ver)
|
632
|
+
look_and_install( "__STDC_VERSION__", DEF_NOARGS_STANDARD, null
|
633
|
+
, tmp);
|
1915
634
|
#ifdef COMPILER_CPLUS
|
1916
|
-
|
1917
|
-
|
635
|
+
if (! nflag) /* Undefine pre-defined macro for C++ */
|
636
|
+
undefine( COMPILER_CPLUS);
|
1918
637
|
#endif
|
1919
|
-
}
|
1920
638
|
set_limit();
|
1921
|
-
|
1922
|
-
stdc3 = (cplus_val >= 199901L) || (stdc_ver >= 199901L);
|
1923
|
-
/* (cplus_val >= 199901L) makes C++ C99-compatible specs */
|
1924
|
-
if (standard)
|
1925
|
-
init_std_defines();
|
1926
|
-
if (stdc3)
|
1927
|
-
set_pragma_op();
|
639
|
+
init_std_defines();
|
1928
640
|
}
|
1929
641
|
|
1930
642
|
static void init_std_defines( void)
|
@@ -1967,10 +679,6 @@ static void init_std_defines( void)
|
|
1967
679
|
sprintf( tmp, "%d", STDC_HOSTED);
|
1968
680
|
look_and_install( "__STDC_HOSTED__", DEF_NOARGS_PREDEF, null, tmp);
|
1969
681
|
}
|
1970
|
-
#if COMPILER != GNUC /* GCC do not undefine __STDC__ on C++ */
|
1971
|
-
if (cplus_val)
|
1972
|
-
return;
|
1973
|
-
#endif
|
1974
682
|
/* Define __STDC__ as 1 or such for Standard conforming compiler. */
|
1975
683
|
if (! look_id( "__STDC__")) {
|
1976
684
|
sprintf( tmp, "%d", stdc_val);
|
@@ -1986,52 +694,17 @@ static void set_limit( void)
|
|
1986
694
|
* Set the minimum translation limits specified by the Standards.
|
1987
695
|
*/
|
1988
696
|
{
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
} else if (stdc_ver >= 199901L) { /* Specified by C 1999 Standard */
|
1999
|
-
std_limits.str_len = SLEN99MIN;
|
2000
|
-
std_limits.id_len = IDLEN99MIN;
|
2001
|
-
std_limits.n_mac_pars = NMACPARS99MIN;
|
2002
|
-
std_limits.exp_nest = EXP_NEST99MIN;
|
2003
|
-
std_limits.blk_nest = BLK_NEST99MIN;
|
2004
|
-
std_limits.inc_nest = INCLUDE_NEST99MIN;
|
2005
|
-
std_limits.n_macro = NMACRO99MIN;
|
2006
|
-
std_limits.line_num = LINE99LIMIT;
|
2007
|
-
} else if (standard) { /* Specified by C 1990 Standard */
|
2008
|
-
std_limits.str_len = SLEN90MIN;
|
2009
|
-
std_limits.id_len = IDLEN90MIN;
|
2010
|
-
std_limits.n_mac_pars = NMACPARS90MIN;
|
2011
|
-
std_limits.exp_nest = EXP_NEST90MIN;
|
2012
|
-
std_limits.blk_nest = BLK_NEST90MIN;
|
2013
|
-
std_limits.inc_nest = INCLUDE_NEST90MIN;
|
2014
|
-
std_limits.n_macro = NMACRO90MIN;
|
2015
|
-
std_limits.line_num = LINE90LIMIT;
|
2016
|
-
}
|
2017
|
-
/* Else pre-Standard mode */
|
697
|
+
/* Specified by C 1990 Standard */
|
698
|
+
std_limits.str_len = SLEN90MIN;
|
699
|
+
std_limits.id_len = IDLEN90MIN;
|
700
|
+
std_limits.n_mac_pars = NMACPARS90MIN;
|
701
|
+
std_limits.exp_nest = EXP_NEST90MIN;
|
702
|
+
std_limits.blk_nest = BLK_NEST90MIN;
|
703
|
+
std_limits.inc_nest = INCLUDE_NEST90MIN;
|
704
|
+
std_limits.n_macro = NMACRO90MIN;
|
705
|
+
std_limits.line_num = LINE90LIMIT;
|
2018
706
|
}
|
2019
707
|
|
2020
|
-
static void set_pragma_op( void)
|
2021
|
-
/*
|
2022
|
-
* #define _Pragma(a) _Pragma ( a )
|
2023
|
-
* Define _Pragma() operator as a special macro so as to be searched
|
2024
|
-
* easily. The unusual 'DEF_PRAGMA' is a marker of this psuedo
|
2025
|
-
* macro.
|
2026
|
-
*/
|
2027
|
-
{
|
2028
|
-
char * name = "_Pragma";
|
2029
|
-
char tmp[ 16];
|
2030
|
-
|
2031
|
-
sprintf( tmp, "%c%s ( %c%c )", DEF_MAGIC, name, MAC_PARM, 1);
|
2032
|
-
/* Replacement text */
|
2033
|
-
look_and_install( name, DEF_PRAGMA, "a", tmp);
|
2034
|
-
}
|
2035
708
|
|
2036
709
|
void init_sys_macro( void)
|
2037
710
|
/*
|
@@ -2041,15 +714,7 @@ void init_sys_macro( void)
|
|
2041
714
|
{
|
2042
715
|
/* This order is important. */
|
2043
716
|
def_macros(); /* Define macros specified by -D */
|
2044
|
-
#if COMPILER == GNUC
|
2045
|
-
chk_env();
|
2046
|
-
#endif
|
2047
717
|
init_predefines(); /* Define predefined macros */
|
2048
|
-
#if COMPILER == GNUC
|
2049
|
-
init_gcc_macro();
|
2050
|
-
#elif COMPILER == MSC
|
2051
|
-
init_msc_macro();
|
2052
|
-
#endif
|
2053
718
|
undef_macros(); /* Undefine macros specified by -U */
|
2054
719
|
if (mcpp_debug & MACRO_CALL)
|
2055
720
|
dump_def( FALSE, TRUE); /* Finally putout current macro names */
|
@@ -2060,43 +725,9 @@ void at_start( void)
|
|
2060
725
|
* Do the commands prior to processing main source file after do_options().
|
2061
726
|
*/
|
2062
727
|
{
|
2063
|
-
char * env;
|
2064
728
|
FILEINFO * file_saved = infile;
|
2065
729
|
|
2066
|
-
|
2067
|
-
* Set multi-byte character encoding according to environment variables
|
2068
|
-
* LC_ALL, LC_CTYPE and LANG -- with preference in this order.
|
2069
|
-
*/
|
2070
|
-
if (! mb_changed) { /* -m option precedes */
|
2071
|
-
if ((env = getenv( "LC_ALL")) != NULL)
|
2072
|
-
set_encoding( env, "LC_ALL", 0);
|
2073
|
-
else if ((env = getenv( "LC_CTYPE")) != NULL)
|
2074
|
-
set_encoding( env, "LC_CTYPE", 0);
|
2075
|
-
else if ((env = getenv( "LANG")) != NULL)
|
2076
|
-
set_encoding( env, "LANG", 0);
|
2077
|
-
}
|
2078
|
-
|
2079
|
-
#if COMPILER == GNUC || COMPILER == MSC
|
2080
|
-
if (option_flags.dollar_in_name)
|
2081
|
-
char_type[ 0x24] |= LET; /* Enable '$' in identifiers */
|
2082
|
-
/*
|
2083
|
-
* Do the -include (-Fl for MSC) options in the specified order.
|
2084
|
-
* Note: This functionality is implemented as nested #includes
|
2085
|
-
* which results the same effect as sequential #includes.
|
2086
|
-
*/
|
2087
|
-
{
|
2088
|
-
char ** preinc;
|
2089
|
-
/*
|
2090
|
-
* Note: Here, 'infile' is the main input file, which is pseudo-
|
2091
|
-
* parent file of the files to pre-include. So, we must
|
2092
|
-
* temporarily set the infile's directory to the current directory
|
2093
|
-
* in order to preinclude the files relative to it.
|
2094
|
-
*/
|
2095
|
-
preinc = preinc_end;
|
2096
|
-
while (preinclude <= --preinc && *preinc != NULL)
|
2097
|
-
open_file( &null, NULL, *preinc, TRUE, TRUE, FALSE);
|
2098
|
-
}
|
2099
|
-
#endif
|
730
|
+
// We don't support changing the encodings.
|
2100
731
|
|
2101
732
|
put_info( file_saved);
|
2102
733
|
}
|
@@ -2108,27 +739,11 @@ static void put_info(
|
|
2108
739
|
* Putout compiler-specific information.
|
2109
740
|
*/
|
2110
741
|
{
|
2111
|
-
if (no_output
|
742
|
+
if (no_output)
|
2112
743
|
return;
|
2113
744
|
sharp_file->line++;
|
2114
745
|
sharp( sharp_file, 0);
|
2115
746
|
sharp_file->line--;
|
2116
|
-
#if COMPILER == GNUC
|
2117
|
-
if (gcc_work_dir)
|
2118
|
-
mcpp_fprintf( OUT, "%s%ld \"%s%c\"\n"
|
2119
|
-
, std_line_prefix ? "#line " : LINE_PREFIX
|
2120
|
-
, 1, cur_work_dir, '/');
|
2121
|
-
/* Putout the current directory as a #line line as: */
|
2122
|
-
/* '# 1 "/abs-path/cur_dir//"'. */
|
2123
|
-
mcpp_fprintf( OUT, "%s%ld \"<built-in>\"\n"
|
2124
|
-
, std_line_prefix ? "#line " : LINE_PREFIX , 1);
|
2125
|
-
mcpp_fprintf( OUT, "%s%ld \"<command line>\"\n"
|
2126
|
-
, std_line_prefix ? "#line " : LINE_PREFIX , 1);
|
2127
|
-
mcpp_fprintf( OUT, "%s%ld \"%s\"%s\n"
|
2128
|
-
, std_line_prefix ? "#line " : LINE_PREFIX, 1, cur_fullname
|
2129
|
-
, ! str_eq( cur_fullname, sharp_file->full_fname) ? " 1" : null);
|
2130
|
-
/* Suffix " 1" for the file specified by -include */
|
2131
|
-
#endif
|
2132
747
|
}
|
2133
748
|
|
2134
749
|
static char * set_files(
|
@@ -2173,10 +788,6 @@ static void set_env_dirs( void)
|
|
2173
788
|
{
|
2174
789
|
const char * env;
|
2175
790
|
|
2176
|
-
if (cplus_val) {
|
2177
|
-
if ((env = getenv( ENV_CPLUS_INCLUDE_DIR)) != NULL)
|
2178
|
-
parse_env( env);
|
2179
|
-
}
|
2180
791
|
if ((env = getenv( ENV_C_INCLUDE_DIR)) != NULL)
|
2181
792
|
parse_env( env);
|
2182
793
|
}
|
@@ -2220,21 +831,6 @@ static void set_sys_dirs(
|
|
2220
831
|
* list.
|
2221
832
|
*/
|
2222
833
|
{
|
2223
|
-
if (cplus_val && set_cplus_dir) {
|
2224
|
-
#ifdef CPLUS_INCLUDE_DIR1
|
2225
|
-
set_a_dir( CPLUS_INCLUDE_DIR1);
|
2226
|
-
#endif
|
2227
|
-
#ifdef CPLUS_INCLUDE_DIR2
|
2228
|
-
set_a_dir( CPLUS_INCLUDE_DIR2);
|
2229
|
-
#endif
|
2230
|
-
#ifdef CPLUS_INCLUDE_DIR3
|
2231
|
-
set_a_dir( CPLUS_INCLUDE_DIR3);
|
2232
|
-
#endif
|
2233
|
-
#ifdef CPLUS_INCLUDE_DIR4
|
2234
|
-
set_a_dir( CPLUS_INCLUDE_DIR4);
|
2235
|
-
#endif
|
2236
|
-
}
|
2237
|
-
|
2238
834
|
#if SYS_FAMILY == SYS_UNIX
|
2239
835
|
set_a_dir( "/usr/local/include");
|
2240
836
|
#endif
|
@@ -2283,24 +879,9 @@ static void set_a_dir(
|
|
2283
879
|
incdir = (const char **) xmalloc( sizeof (char *) * max_inc);
|
2284
880
|
incend = &incdir[ 0];
|
2285
881
|
} else if (incend - incdir >= max_inc) { /* Buffer full */
|
2286
|
-
#if SYSTEM == SYS_MAC
|
2287
|
-
size_t framework_pos = to_search_framework - incdir;
|
2288
|
-
#endif
|
2289
|
-
#if COMPILER == GNUC
|
2290
|
-
size_t sys_pos = 0;
|
2291
|
-
if (sys_dirp)
|
2292
|
-
sys_pos = sys_dirp - incdir;
|
2293
|
-
#endif
|
2294
882
|
incdir = (const char **) xrealloc( (void *) incdir
|
2295
883
|
, sizeof (char *) * max_inc * 2);
|
2296
884
|
incend = &incdir[ max_inc];
|
2297
|
-
#if COMPILER == GNUC
|
2298
|
-
if (sys_pos)
|
2299
|
-
sys_dirp = &incdir[ sys_pos];
|
2300
|
-
#endif
|
2301
|
-
#if SYSTEM == SYS_MAC
|
2302
|
-
to_search_framework = &incdir[ framework_pos];
|
2303
|
-
#endif
|
2304
885
|
max_inc *= 2;
|
2305
886
|
}
|
2306
887
|
|
@@ -2311,9 +892,6 @@ static void set_a_dir(
|
|
2311
892
|
return;
|
2312
893
|
for (ip = incdir; ip < incend; ip++) {
|
2313
894
|
if (str_case_eq( *ip, norm_name)) {
|
2314
|
-
if (option_flags.v && ! (mcpp_debug & MACRO_CALL))
|
2315
|
-
mcpp_fprintf( ERR, "Duplicate directory \"%s\" is ignored\n"
|
2316
|
-
, norm_name);
|
2317
895
|
free( norm_name); /* Already registered */
|
2318
896
|
return;
|
2319
897
|
}
|
@@ -2322,41 +900,6 @@ static void set_a_dir(
|
|
2322
900
|
*incend++ = norm_name;
|
2323
901
|
}
|
2324
902
|
|
2325
|
-
#if SYSTEM == SYS_MAC && COMPILER == GNUC
|
2326
|
-
/* Definitions for "header map" file of Xcode / Apple-GCC. */
|
2327
|
-
/* These definitions were taken from cpplib.h of Apple-GCC-4.0.1 */
|
2328
|
-
|
2329
|
-
#define HMAP_SAME_ENDIANNESS_MAGIC \
|
2330
|
-
(((((('h' << 8) | 'm') << 8) | 'a') << 8) | 'p')
|
2331
|
-
|
2332
|
-
typedef unsigned short uint16;
|
2333
|
-
typedef unsigned int uint32;
|
2334
|
-
|
2335
|
-
struct hmap_bucket
|
2336
|
-
{
|
2337
|
-
uint32 key; /* Offset (into strings) of key */
|
2338
|
-
struct {
|
2339
|
-
uint32 prefix; /* Offset (into strings) of value prefix */
|
2340
|
-
uint32 suffix; /* Offset (into strings) of value suffix */
|
2341
|
-
} value; /* Value (prefix- and suffix-strings) */
|
2342
|
-
};
|
2343
|
-
|
2344
|
-
struct hmap_header_map
|
2345
|
-
{
|
2346
|
-
uint32 magic; /* Magic word, also indicates byte order */
|
2347
|
-
uint16 version; /* Version number -- currently 1 */
|
2348
|
-
uint16 _reserved; /* Reserved for future use -- zero for now */
|
2349
|
-
uint32 strings_offset; /* Offset to start of string pool */
|
2350
|
-
uint32 count; /* Number of entries in the string table */
|
2351
|
-
uint32 capacity; /* Number of buckets (always a power of 2) */
|
2352
|
-
uint32 max_value_length;
|
2353
|
-
/* Length of longest result path (excl. '\0') */
|
2354
|
-
struct hmap_bucket buckets[1];
|
2355
|
-
/* Inline array of 'capacity' maptable buckets */
|
2356
|
-
/* Strings follow the buckets, at strings_offset. */
|
2357
|
-
};
|
2358
|
-
#endif
|
2359
|
-
|
2360
903
|
static char * norm_dir(
|
2361
904
|
const char * dirname, /* Directory path to normalize */
|
2362
905
|
int framework /* Setting a framework directory*/
|
@@ -2368,43 +911,10 @@ static char * norm_dir(
|
|
2368
911
|
{
|
2369
912
|
char * norm_name;
|
2370
913
|
|
2371
|
-
#if COMPILER == GNUC
|
2372
|
-
if (sysroot && sys_dirp) {
|
2373
|
-
/* Logical system root specified and dirname is system header dir */
|
2374
|
-
char delim[ 2] = { EOS, EOS};
|
2375
|
-
char * dir;
|
2376
|
-
#if SYSTEM == SYS_MAC
|
2377
|
-
if (! framework && memcmp( dirname, "/usr/", 5) != 0)
|
2378
|
-
return NULL; /* /Developer/usr/lib/gcc/ */
|
2379
|
-
#endif
|
2380
|
-
if (dirname[ 0] != PATH_DELIM)
|
2381
|
-
delim[ 0] = PATH_DELIM;
|
2382
|
-
dir = xmalloc( strlen( sysroot) + strlen( dirname) + 2);
|
2383
|
-
sprintf( dir, "%s%s%s", sysroot, delim, dirname);
|
2384
|
-
dirname = dir;
|
2385
|
-
}
|
2386
|
-
#endif
|
2387
|
-
#if SYSTEM == SYS_MAC && COMPILER == GNUC
|
2388
|
-
if (strlen( dirname) > 5
|
2389
|
-
&& str_case_eq( dirname + strlen( dirname) - 5, ".hmap")) {
|
2390
|
-
/* "header map" file (not an include directory) */
|
2391
|
-
norm_name = norm_path( null, dirname, FALSE, TRUE);
|
2392
|
-
if (! norm_name && option_flags.v)
|
2393
|
-
mcpp_fprintf( ERR, "Invalid header map file \"%s\" is ignored\n"
|
2394
|
-
, dirname);
|
2395
|
-
} else
|
2396
|
-
#endif
|
2397
914
|
{
|
2398
915
|
norm_name = norm_path( dirname, NULL, FALSE, FALSE);
|
2399
916
|
/* Normalize the pathname to compare */
|
2400
|
-
if (! norm_name && option_flags.v && ! (mcpp_debug & MACRO_CALL))
|
2401
|
-
mcpp_fprintf( ERR, "Non-existent directory \"%s\" is ignored\n"
|
2402
|
-
, dirname);
|
2403
917
|
}
|
2404
|
-
#if COMPILER == GNUC
|
2405
|
-
if (sysroot && sys_dirp)
|
2406
|
-
free( dirname);
|
2407
|
-
#endif
|
2408
918
|
|
2409
919
|
return norm_name;
|
2410
920
|
}
|
@@ -2479,18 +989,6 @@ static char * norm_path(
|
|
2479
989
|
|| (fname && ! S_ISREG( st_buf.st_mode)))
|
2480
990
|
/* Not a regular file though 'fname' is specified */
|
2481
991
|
return NULL;
|
2482
|
-
#if SYSTEM == SYS_MAC && COMPILER == GNUC
|
2483
|
-
if (hmap) { /* Dirty "header map" file */
|
2484
|
-
struct hmap_header_map hmap;
|
2485
|
-
size_t cnt;
|
2486
|
-
FILE * fp;
|
2487
|
-
fp = fopen( fname, "r");
|
2488
|
-
cnt = fread( & hmap, sizeof (struct hmap_header_map), 1, fp);
|
2489
|
-
fclose( fp);
|
2490
|
-
if (cnt == 0 || hmap.magic != HMAP_SAME_ENDIANNESS_MAGIC)
|
2491
|
-
return NULL;
|
2492
|
-
}
|
2493
|
-
#endif
|
2494
992
|
if (! fname) {
|
2495
993
|
slbuf1[ len] = PATH_DELIM; /* Append PATH_DELIM */
|
2496
994
|
slbuf1[ ++len] = EOS;
|
@@ -2678,160 +1176,31 @@ static void deref_syml(
|
|
2678
1176
|
/* Dereference symbolic linked directory */
|
2679
1177
|
{
|
2680
1178
|
char * cp2;
|
2681
|
-
int len; /* Should be int, not size_t */
|
2682
|
-
|
2683
|
-
while ((chk_start = strchr( chk_start, PATH_DELIM)) != NULL) {
|
2684
|
-
*chk_start = EOS;
|
2685
|
-
if ((len = readlink( slbuf1, slbuf2, PATHMAX)) > 0) {
|
2686
|
-
/* Dereference symbolic linked directory */
|
2687
|
-
cp2 = strrchr( slbuf1, PATH_DELIM); /* Previous delimiter */
|
2688
|
-
*chk_start = PATH_DELIM;
|
2689
|
-
strcpy( slbuf2 + len, chk_start);
|
2690
|
-
if (slbuf2[ 0] == PATH_DELIM) { /* Absolute path */
|
2691
|
-
strcpy( slbuf1, slbuf2);
|
2692
|
-
chk_start = slbuf1 + len + 1;
|
2693
|
-
} else {
|
2694
|
-
if (cp2)
|
2695
|
-
chk_start = cp2 + 1;
|
2696
|
-
else
|
2697
|
-
chk_start = slbuf1;
|
2698
|
-
strcpy( chk_start, slbuf2); /* Rewrite the path */
|
2699
|
-
chk_start += len;
|
2700
|
-
}
|
2701
|
-
} else {
|
2702
|
-
*chk_start++ = PATH_DELIM;
|
2703
|
-
}
|
2704
|
-
}
|
2705
|
-
}
|
2706
|
-
#endif
|
2707
|
-
|
2708
|
-
#if COMPILER == GNUC
|
2709
|
-
|
2710
|
-
static void init_gcc_macro( void)
|
2711
|
-
/*
|
2712
|
-
* Predefine GCC macros.
|
2713
|
-
* This routine should be called after opening output file in order to putout
|
2714
|
-
* macro informations by -K option into the file.
|
2715
|
-
* Also this routine should be called before undef_macros() in order to
|
2716
|
-
* permit undefining a macro by -U option.
|
2717
|
-
*/
|
2718
|
-
{
|
2719
|
-
char fname[ BUFSIZ];
|
2720
|
-
char lbuf[ BUFSIZ];
|
2721
|
-
char * include_dir; /* The version-specific include directory */
|
2722
|
-
char * tmp;
|
2723
|
-
FILE * fp;
|
2724
|
-
DEFBUF * defp;
|
2725
|
-
const char * cp;
|
2726
|
-
char * tp;
|
2727
|
-
int i;
|
2728
|
-
|
2729
|
-
if (nflag) /* -undef option */
|
2730
|
-
goto undef_special;
|
2731
|
-
|
2732
|
-
tmp = xmalloc( strlen( INC_DIR) + strlen( "/mingw/mcpp-gcc-")
|
2733
|
-
+ strlen( arch) + 1);
|
2734
|
-
#if SYSTEM == SYS_CYGWIN
|
2735
|
-
if (no_cygwin) {
|
2736
|
-
sprintf( tmp, "%s/mingw/mcpp-gcc-%s", INC_DIR, arch);
|
2737
|
-
} else {
|
2738
|
-
sprintf( tmp, "%s/mcpp-gcc-%s", INC_DIR, arch);
|
2739
|
-
}
|
2740
|
-
#else
|
2741
|
-
sprintf( tmp, "%s/mcpp-gcc-%s", INC_DIR, arch);
|
2742
|
-
#endif
|
2743
|
-
include_dir = norm_path( tmp, NULL, TRUE, FALSE);
|
2744
|
-
free( tmp);
|
2745
|
-
|
2746
|
-
for (i = 0; i <= 1; i++) {
|
2747
|
-
int nargs;
|
2748
|
-
|
2749
|
-
if ((mcpp_mode == POST_STD || ansi) && i == 0)
|
2750
|
-
continue; /* POST_STD or __STRICT_ANSI__ does not */
|
2751
|
-
/* predefine non-conforming macros */
|
2752
|
-
/* The predefined macro file */
|
2753
|
-
cp = i ? "std" : "old";
|
2754
|
-
sprintf( fname, "%sg%s%d%d_predef_%s.h"
|
2755
|
-
, include_dir, cplus_val ? "xx" : "cc"
|
2756
|
-
, gcc_maj_ver, gcc_min_ver, cp);
|
2757
|
-
/* Note that norm_path() append a PATH_DELIM. */
|
2758
|
-
if ((fp = fopen( fname, "r")) == NULL) {
|
2759
|
-
mcpp_fprintf( ERR, "The mode for %s has not been installed.\n"
|
2760
|
-
, arch);
|
2761
|
-
longjmp( error_exit, -1);
|
2762
|
-
}
|
2763
|
-
nargs = i ? 0 : DEF_NOARGS_PREDEF_OLD;
|
2764
|
-
/* g*_predef_std.h has DEF_NOARGS_PREDEF or non-negative args */
|
2765
|
-
/* while g*_predef_old.h has only DEF_NOARGS_PREDEF_OLD args */
|
2766
|
-
while (fgets( lbuf, BUFSIZ, fp) != NULL) {
|
2767
|
-
unget_string( lbuf, "gcc_predefine");
|
2768
|
-
if (skip_ws() == '#'
|
2769
|
-
&& scan_token( skip_ws(), (tp = work_buf, &tp), work_end)
|
2770
|
-
== NAM
|
2771
|
-
&& str_eq( work_buf, "define")) {
|
2772
|
-
defp = do_define( TRUE, nargs); /* Ignore re-definition */
|
2773
|
-
}
|
2774
|
-
skip_nl();
|
2775
|
-
}
|
2776
|
-
}
|
2777
|
-
free( include_dir);
|
2778
|
-
|
2779
|
-
undef_special:
|
2780
|
-
if (look_id( "__OPTIMIZE__")) /* -O option is specified */
|
2781
|
-
undefine( "__NO_INLINE__");
|
2782
|
-
}
|
2783
|
-
|
2784
|
-
static void chk_env( void)
|
2785
|
-
/*
|
2786
|
-
* Check the environment variables to specify output of dependency lines.
|
2787
|
-
*/
|
2788
|
-
{
|
2789
|
-
char * env;
|
2790
|
-
char * cp;
|
2791
|
-
|
2792
|
-
/* Output of dependency lines */
|
2793
|
-
if ((env = getenv( "DEPENDENCIES_OUTPUT")) == NULL) {
|
2794
|
-
if ((env = getenv( "SUNPRO_DEPENDENCIES")) == NULL)
|
2795
|
-
return;
|
2796
|
-
else
|
2797
|
-
mkdep |= MD_SYSHEADER;
|
2798
|
-
}
|
2799
|
-
mkdep |= MD_MKDEP;
|
2800
|
-
if ((cp = strchr( env, ' ')) != NULL) {
|
2801
|
-
*cp++ = EOS;
|
2802
|
-
while (*cp == ' ')
|
2803
|
-
cp++;
|
2804
|
-
}
|
2805
|
-
if (! mkdep_fp) /* Command line option precedes */
|
2806
|
-
mkdep_fp = fopen( env, "a");
|
2807
|
-
if (! mkdep_target)
|
2808
|
-
mkdep_target = cp;
|
2809
|
-
}
|
2810
|
-
|
2811
|
-
#elif COMPILER == MSC
|
2812
|
-
|
2813
|
-
static void init_msc_macro( void)
|
2814
|
-
/*
|
2815
|
-
* Define a few MSC-specific predefined macros.
|
2816
|
-
*/
|
2817
|
-
{
|
2818
|
-
DEFBUF * defp;
|
2819
|
-
int i;
|
1179
|
+
int len; /* Should be int, not size_t */
|
2820
1180
|
|
2821
|
-
|
2822
|
-
|
2823
|
-
|
2824
|
-
|
2825
|
-
|
2826
|
-
|
2827
|
-
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
1181
|
+
while ((chk_start = strchr( chk_start, PATH_DELIM)) != NULL) {
|
1182
|
+
*chk_start = EOS;
|
1183
|
+
if ((len = readlink( slbuf1, slbuf2, PATHMAX)) > 0) {
|
1184
|
+
/* Dereference symbolic linked directory */
|
1185
|
+
cp2 = strrchr( slbuf1, PATH_DELIM); /* Previous delimiter */
|
1186
|
+
*chk_start = PATH_DELIM;
|
1187
|
+
strcpy( slbuf2 + len, chk_start);
|
1188
|
+
if (slbuf2[ 0] == PATH_DELIM) { /* Absolute path */
|
1189
|
+
strcpy( slbuf1, slbuf2);
|
1190
|
+
chk_start = slbuf1 + len + 1;
|
1191
|
+
} else {
|
1192
|
+
if (cp2)
|
1193
|
+
chk_start = cp2 + 1;
|
1194
|
+
else
|
1195
|
+
chk_start = slbuf1;
|
1196
|
+
strcpy( chk_start, slbuf2); /* Rewrite the path */
|
1197
|
+
chk_start += len;
|
1198
|
+
}
|
1199
|
+
} else {
|
1200
|
+
*chk_start++ = PATH_DELIM;
|
2831
1201
|
}
|
2832
1202
|
}
|
2833
1203
|
}
|
2834
|
-
|
2835
1204
|
#endif
|
2836
1205
|
|
2837
1206
|
static void def_macros( void)
|
@@ -2888,12 +1257,10 @@ void put_depend(
|
|
2888
1257
|
size_t fnamlen; /* Length of filename */
|
2889
1258
|
|
2890
1259
|
if (fp == NULL) { /* Main source file. Have to initialize. */
|
2891
|
-
#if MCPP_LIB
|
2892
1260
|
if (output != NULL) {
|
2893
1261
|
free( output);
|
2894
1262
|
free( pos);
|
2895
1263
|
}
|
2896
|
-
#endif
|
2897
1264
|
output = xmalloc( mkdep_len = MKDEP_INITLEN);
|
2898
1265
|
pos = (size_t *) xmalloc( (pos_max = MKDEP_INIT) * sizeof (size_t));
|
2899
1266
|
out_p = md_init( filename, output);
|
@@ -3104,7 +1471,7 @@ int do_include(
|
|
3104
1471
|
}
|
3105
1472
|
fname = infile->bptr - 1; /* Current token for diagnosis */
|
3106
1473
|
|
3107
|
-
if (
|
1474
|
+
if ((char_type[ delim] & LET)) { /* Maybe macro */
|
3108
1475
|
int c;
|
3109
1476
|
char *hp;
|
3110
1477
|
|
@@ -3148,17 +1515,9 @@ found_name:
|
|
3148
1515
|
fname = save_string( &work_buf[ 1]); /* the starting delimiter. */
|
3149
1516
|
|
3150
1517
|
if (skip_ws() != '\n') {
|
3151
|
-
|
3152
|
-
|
3153
|
-
|
3154
|
-
goto error;
|
3155
|
-
} else if (mcpp_mode == OLD_PREP) {
|
3156
|
-
skip_nl();
|
3157
|
-
} else {
|
3158
|
-
if (warn_level & 1)
|
3159
|
-
cwarn( excess_token, infile->bptr-1, 0L, NULL);
|
3160
|
-
skip_nl();
|
3161
|
-
}
|
1518
|
+
cerror( excess_token, infile->bptr-1, 0L, NULL);
|
1519
|
+
skip_nl();
|
1520
|
+
goto error;
|
3162
1521
|
}
|
3163
1522
|
|
3164
1523
|
#if SYS_FAMILY == SYS_WIN
|
@@ -3224,14 +1583,6 @@ static int open_include(
|
|
3224
1583
|
if (mcpp_debug & PATH)
|
3225
1584
|
mcpp_fprintf( DBG, "filename: %s\n", filename);
|
3226
1585
|
|
3227
|
-
#if COMPILER == GNUC
|
3228
|
-
if (! full_path) {
|
3229
|
-
if (i_split /* -I- option is specified */
|
3230
|
-
|| next) /* or #include_next */
|
3231
|
-
goto search_dirs;
|
3232
|
-
}
|
3233
|
-
#endif
|
3234
|
-
|
3235
1586
|
if ((searchlocal && ((search_rule & CURRENT) || !has_dir)) || full_path) {
|
3236
1587
|
/*
|
3237
1588
|
* Look in local directory first.
|
@@ -3253,28 +1604,6 @@ static int open_include(
|
|
3253
1604
|
return TRUE;
|
3254
1605
|
}
|
3255
1606
|
|
3256
|
-
#if COMPILER == MSC
|
3257
|
-
if (searchlocal) {
|
3258
|
-
/* Visual C searches ancestor source's directory, too. */
|
3259
|
-
FILEINFO * file = infile;
|
3260
|
-
while ((file = file->parent) != NULL) {
|
3261
|
-
/* Search each parent includer's directory */
|
3262
|
-
if (open_file( file->dirp, src_dir, filename, TRUE, FALSE, FALSE))
|
3263
|
-
return TRUE;
|
3264
|
-
}
|
3265
|
-
}
|
3266
|
-
#endif
|
3267
|
-
#if COMPILER == GNUC
|
3268
|
-
search_dirs:
|
3269
|
-
if (searchlocal) {
|
3270
|
-
/* Search the directories specified by -iquote option, if any. */
|
3271
|
-
const char ** qdir;
|
3272
|
-
for (qdir = quote_dir; qdir < quote_dir_end; qdir++) {
|
3273
|
-
if (open_file( qdir, NULL, filename, FALSE, FALSE, FALSE))
|
3274
|
-
return TRUE;
|
3275
|
-
}
|
3276
|
-
}
|
3277
|
-
#endif
|
3278
1607
|
/* Search the include directories */
|
3279
1608
|
if (search_dir( filename, searchlocal, next))
|
3280
1609
|
return TRUE;
|
@@ -3344,26 +1673,10 @@ static int search_dir(
|
|
3344
1673
|
const char ** incptr; /* -> inlcude directory */
|
3345
1674
|
|
3346
1675
|
incptr = incdir;
|
3347
|
-
#if COMPILER == GNUC
|
3348
|
-
if (next && **inc_dirp != EOS)
|
3349
|
-
incptr = inc_dirp + 1;
|
3350
|
-
/* In case of include_next search after the includer's directory */
|
3351
|
-
#endif
|
3352
1676
|
|
3353
1677
|
for ( ; incptr < incend; incptr++) {
|
3354
1678
|
if (strlen( *incptr) + strlen( filename) >= PATHMAX)
|
3355
1679
|
cfatal( toolong_fname, *incptr, 0L, filename); /* _F_ */
|
3356
|
-
#if SYSTEM == SYS_MAC
|
3357
|
-
if (incptr == to_search_framework && ! searchlocal) {
|
3358
|
-
/* Now search the framework dirs */
|
3359
|
-
if (search_framework( filename)) { /* Found */
|
3360
|
-
if (in_import) /* "#import"ed file is once only */
|
3361
|
-
do_once( infile->full_fname);
|
3362
|
-
return TRUE;
|
3363
|
-
}
|
3364
|
-
/* Else continue to search incptr */
|
3365
|
-
}
|
3366
|
-
#endif
|
3367
1680
|
if (open_file( incptr, NULL, filename, FALSE, FALSE, FALSE))
|
3368
1681
|
/* Now infile has been renewed */
|
3369
1682
|
return TRUE;
|
@@ -3400,17 +1713,6 @@ static int open_file(
|
|
3400
1713
|
const char * fname;
|
3401
1714
|
|
3402
1715
|
errno = 0; /* Clear errno possibly set by path searching */
|
3403
|
-
#if SYSTEM == SYS_MAC && COMPILER == GNUC
|
3404
|
-
if (strlen( *dirp) > 5
|
3405
|
-
&& str_case_eq( *dirp + strlen( *dirp) - 5, ".hmap")) {
|
3406
|
-
/* Search header map file for a header */
|
3407
|
-
if (! search_header_map( *dirp, filename, dir_fname))
|
3408
|
-
return NULL;
|
3409
|
-
fname = dir_fname; /* Found a path-list */
|
3410
|
-
dirp = &null;
|
3411
|
-
goto search;
|
3412
|
-
} else
|
3413
|
-
#endif
|
3414
1716
|
{
|
3415
1717
|
if (mcpp_debug & PATH)
|
3416
1718
|
mcpp_fprintf( DBG, "Searching %s%s%s\n", *dirp
|
@@ -3425,12 +1727,12 @@ static int open_file(
|
|
3425
1727
|
} else {
|
3426
1728
|
fname = filename;
|
3427
1729
|
}
|
3428
|
-
|
1730
|
+
|
3429
1731
|
fullname = norm_path( *dirp, fname, TRUE, FALSE);
|
3430
1732
|
/* Convert to absolute path */
|
3431
1733
|
if (! fullname) /* Non-existent or directory */
|
3432
1734
|
return FALSE;
|
3433
|
-
if (
|
1735
|
+
if (included( fullname)) /* Once included */
|
3434
1736
|
goto true;
|
3435
1737
|
|
3436
1738
|
if ((max_open != 0 && max_open <= include_nest)
|
@@ -3483,25 +1785,10 @@ search:
|
|
3483
1785
|
infile->dirp = inc_dirp = dirp;
|
3484
1786
|
#if 0 /* This part is only for debugging */
|
3485
1787
|
chk_dirp( dirp);
|
3486
|
-
#endif
|
3487
|
-
#if COMPILER == GNUC
|
3488
|
-
if ((**dirp != EOS && sys_dirp <= dirp && dirp <= incend)
|
3489
|
-
#if SYSTEM == SYS_MAC
|
3490
|
-
|| sys_frame
|
3491
|
-
#endif
|
3492
|
-
)
|
3493
|
-
infile->sys_header = TRUE; /* Found in a system header dir */
|
3494
|
-
else
|
3495
|
-
infile->sys_header = FALSE;
|
3496
1788
|
#endif
|
3497
1789
|
cur_fullname = fullname;
|
3498
1790
|
|
3499
|
-
if (
|
3500
|
-
no_output++; /* Don't output the included file */
|
3501
|
-
if (include_nest == 2)
|
3502
|
-
mcpp_fprintf( OUT, "#include \"%s\"\n", fullname);
|
3503
|
-
/* Output #include line instead, if it is in main source file */
|
3504
|
-
} else if (! include_opt) { /* Do not sharp() on -include */
|
1791
|
+
if (! include_opt) { /* Do not sharp() on -include */
|
3505
1792
|
src_line = 1; /* Working on line 1 now */
|
3506
1793
|
sharp( NULL, 1); /* Print out the included file name */
|
3507
1794
|
}
|
@@ -3538,7 +1825,7 @@ void add_file(
|
|
3538
1825
|
//
|
3539
1826
|
// When encoding is UTF-8, skip BOM if present.
|
3540
1827
|
//
|
3541
|
-
if(
|
1828
|
+
if(fp != NULL && ftell(fp) == 0)
|
3542
1829
|
{
|
3543
1830
|
const unsigned char UTF8_BOM[3] = {0xEF, 0xBB, 0xBF};
|
3544
1831
|
unsigned char FILE_HEAD[3] = {0, 0, 0};
|
@@ -3570,7 +1857,7 @@ void add_file(
|
|
3570
1857
|
|
3571
1858
|
if (include_nest >= INCLUDE_NEST) /* Probably recursive #include */
|
3572
1859
|
cfatal( too_many_include_nest, NULL, (long) INCLUDE_NEST, NULL);
|
3573
|
-
if (
|
1860
|
+
if ((warn_level & 4)
|
3574
1861
|
&& include_nest == std_limits.inc_nest + 1)
|
3575
1862
|
cwarn( too_many_include_nest, NULL, (long) std_limits.inc_nest, NULL);
|
3576
1863
|
include_nest++;
|
@@ -3616,228 +1903,6 @@ static const char * set_fname(
|
|
3616
1903
|
return filename;
|
3617
1904
|
}
|
3618
1905
|
|
3619
|
-
#if SYSTEM == SYS_MAC
|
3620
|
-
#if COMPILER == GNUC
|
3621
|
-
|
3622
|
-
/* Routines to search "header map" file of Xcode / Apple-GCC. */
|
3623
|
-
/* search_header_map() and hmap_hash() were written referring to */
|
3624
|
-
/* c-incpath.c of Apple-GCC-4.0.1. */
|
3625
|
-
|
3626
|
-
static char * search_header_map(
|
3627
|
-
const char * hmap_file, /* Header map file */
|
3628
|
-
const char * filename, /* Filename to search */
|
3629
|
-
char * pathlist /* Buffer for a found pathlist */
|
3630
|
-
)
|
3631
|
-
/*
|
3632
|
-
* Search a table in "header map" file for a header.
|
3633
|
-
*/
|
3634
|
-
{
|
3635
|
-
struct stat stat_buf;
|
3636
|
-
FILE * fp;
|
3637
|
-
size_t fsize;
|
3638
|
-
const char * contents;
|
3639
|
-
struct hmap_header_map * hmap;
|
3640
|
-
struct hmap_bucket * buckets;
|
3641
|
-
const char * strings;
|
3642
|
-
uint32 mask;
|
3643
|
-
uint32 key_offs;
|
3644
|
-
uint32 i;
|
3645
|
-
|
3646
|
-
stat( hmap_file, &stat_buf); /* Get size of the file */
|
3647
|
-
fsize = stat_buf.st_size;
|
3648
|
-
contents = xmalloc( fsize + 1);
|
3649
|
-
fp = fopen( hmap_file, "r");
|
3650
|
-
fread( contents, fsize, 1, fp); /* Read whole of the file at once */
|
3651
|
-
hmap = (struct hmap_header_map *) contents;
|
3652
|
-
|
3653
|
-
strings = ((const char *) hmap) + hmap->strings_offset;
|
3654
|
-
buckets = hmap->buckets;
|
3655
|
-
mask = hmap->capacity - 1;
|
3656
|
-
i = hmap_hash( filename) & mask;
|
3657
|
-
while ((key_offs = buckets[ i].key) != 0) {
|
3658
|
-
if (str_case_eq( filename, strings + key_offs)) {
|
3659
|
-
/* The names match. Make path-list. */
|
3660
|
-
char * cp = stpcpy( pathlist, strings + buckets[ i].value.prefix);
|
3661
|
-
strcpy( cp, strings + buckets[ i].value.suffix);
|
3662
|
-
break;
|
3663
|
-
}
|
3664
|
-
i = ++i & mask;
|
3665
|
-
}
|
3666
|
-
free( contents);
|
3667
|
-
return key_offs ? pathlist : NULL;
|
3668
|
-
}
|
3669
|
-
|
3670
|
-
static unsigned hmap_hash(
|
3671
|
-
const char * fname /* header name */
|
3672
|
-
)
|
3673
|
-
/*
|
3674
|
-
* Get hash value for the fname.
|
3675
|
-
*/
|
3676
|
-
{
|
3677
|
-
const char * sp;
|
3678
|
-
unsigned hash_code = 0;
|
3679
|
-
|
3680
|
-
for (sp = fname; *sp; sp++)
|
3681
|
-
hash_code += tolower( *sp & 0xFF) * 13;
|
3682
|
-
return hash_code;
|
3683
|
-
}
|
3684
|
-
#endif /* COMPILER == GNUC */
|
3685
|
-
|
3686
|
-
static void init_framework( void)
|
3687
|
-
/*
|
3688
|
-
* Initialize framework[].
|
3689
|
-
*/
|
3690
|
-
{
|
3691
|
-
char * framework_dir;
|
3692
|
-
/* Some frameworks may have been already specified by -F option. */
|
3693
|
-
sys_framework = num_framework; /* These are system frameworks */
|
3694
|
-
#ifdef FRAMEWORK1
|
3695
|
-
framework_dir = norm_dir( FRAMEWORK1, TRUE);
|
3696
|
-
if (framework_dir)
|
3697
|
-
framework[ num_framework++] = framework_dir;
|
3698
|
-
#endif
|
3699
|
-
#ifdef FRAMEWORK2
|
3700
|
-
framework_dir = norm_dir( FRAMEWORK2, TRUE);
|
3701
|
-
if (framework_dir)
|
3702
|
-
framework[ num_framework++] = framework_dir;
|
3703
|
-
#endif
|
3704
|
-
#ifdef FRAMEWORK3
|
3705
|
-
framework_dir = norm_dir( FRAMEWORK3, TRUE);
|
3706
|
-
if (framework_dir)
|
3707
|
-
framework[ num_framework++] = framework_dir;
|
3708
|
-
#endif
|
3709
|
-
if (num_framework >= MAX_FRAMEWORK) {
|
3710
|
-
mcpp_fputs( "Too many Framework directories.", ERR);
|
3711
|
-
longjmp( error_exit, -1);
|
3712
|
-
}
|
3713
|
-
}
|
3714
|
-
|
3715
|
-
static const char * dot_frame = ".framework";
|
3716
|
-
|
3717
|
-
static int search_framework(
|
3718
|
-
char * filename
|
3719
|
-
)
|
3720
|
-
/*
|
3721
|
-
* Search "Framework" directories.
|
3722
|
-
* 'frame/header.h' is converted to
|
3723
|
-
* '/System/Library/Frameworks/frame.framework/Headers/header.h',
|
3724
|
-
* '/System/Library/Frameworks/frame.framework/PrivateHeaders/header.h',
|
3725
|
-
* and so on.
|
3726
|
-
*/
|
3727
|
-
{
|
3728
|
-
char fullname[ PATHMAX + 1];
|
3729
|
-
FILEINFO * file;
|
3730
|
-
char * frame, * fname, * cp1, * cp2;
|
3731
|
-
int sys_frame = FALSE;
|
3732
|
-
int i;
|
3733
|
-
|
3734
|
-
cp1 = cp2 = strchr( filename, PATH_DELIM);
|
3735
|
-
/*
|
3736
|
-
* 'filename' should be <frame/header> format or sometimes
|
3737
|
-
* <frame/dir/header>.
|
3738
|
-
* e.g.: <Foundation/Foundation.h>, <CarbonCore/OSUtils.h>
|
3739
|
-
* or <IOKit/pwr_mgt/IOPMLib.h>.
|
3740
|
-
*/
|
3741
|
-
if (! cp1)
|
3742
|
-
return FALSE;
|
3743
|
-
*cp1 = EOS;
|
3744
|
-
frame = filename;
|
3745
|
-
fname = cp1 + 1;
|
3746
|
-
|
3747
|
-
/* Search framework[] directories */
|
3748
|
-
for (i = 0; i < num_framework; i++) {
|
3749
|
-
cp1 = stpcpy( fullname, framework[ i]);
|
3750
|
-
/* 'fullname' e.g.: /System/Library/Frameworks/ */
|
3751
|
-
if (search_subdir( fullname, cp1, frame, fname, sys_framework <= i))
|
3752
|
-
return TRUE;
|
3753
|
-
}
|
3754
|
-
|
3755
|
-
/*
|
3756
|
-
* Search subframework dirs searching its possible parent framework
|
3757
|
-
* starting from current file's directory to its ancestors.
|
3758
|
-
* Header file in subframework directories should be included only
|
3759
|
-
* by its parent or sibling framework headers.
|
3760
|
-
*/
|
3761
|
-
for (i = sys_framework; i < num_framework; i++) {
|
3762
|
-
size_t frame_len, fname_len;
|
3763
|
-
frame_len = strlen( framework[ i]);
|
3764
|
-
fname_len = strlen( infile->real_fname);
|
3765
|
-
if (fname_len <= frame_len)
|
3766
|
-
continue;
|
3767
|
-
if (memcmp( framework[ i], infile->real_fname, frame_len) == 0) {
|
3768
|
-
sys_frame = TRUE;
|
3769
|
-
break;
|
3770
|
-
}
|
3771
|
-
}
|
3772
|
-
for (file = infile; file; file = file->parent) {
|
3773
|
-
const char * dot;
|
3774
|
-
size_t len;
|
3775
|
-
|
3776
|
-
if (! file->fp)
|
3777
|
-
continue;
|
3778
|
-
dot = strstr( file->real_fname, dot_frame);
|
3779
|
-
if (! dot)
|
3780
|
-
continue;
|
3781
|
-
len = dot - file->real_fname + strlen( dot_frame) + 1;
|
3782
|
-
memcpy( fullname, file->real_fname, len);
|
3783
|
-
cp1 = fullname + len;
|
3784
|
-
cp1 = stpcpy( cp1, "Frameworks/");
|
3785
|
-
/* 'fullname' e.g.: */
|
3786
|
-
/* /System/Library/Frameworks/Foundation.framework/Frameworks/ */
|
3787
|
-
if (search_subdir( fullname, cp1, frame, fname, sys_frame))
|
3788
|
-
return TRUE;
|
3789
|
-
}
|
3790
|
-
|
3791
|
-
*cp2 = PATH_DELIM; /* Restore original include file format */
|
3792
|
-
|
3793
|
-
return FALSE;
|
3794
|
-
}
|
3795
|
-
|
3796
|
-
static int search_subdir(
|
3797
|
-
char * fullname, /* Buffer for path-list to open */
|
3798
|
-
char * cp, /* Latter half of 'fullname' */
|
3799
|
-
char * frame, /* 'frame' of <frame/header> */
|
3800
|
-
char * fname, /* 'header' of <frame/header> */
|
3801
|
-
/* or sometimes 'dir/header' of <frame/dir/header> */
|
3802
|
-
int sys_frame /* System framework header ? */
|
3803
|
-
)
|
3804
|
-
/*
|
3805
|
-
* Make path-list and try to open.
|
3806
|
-
*/
|
3807
|
-
{
|
3808
|
-
static const char * subdir[] = { "Headers", "PrivateHeaders", NULL};
|
3809
|
-
int j, n;
|
3810
|
-
|
3811
|
-
cp += sprintf( cp, "%s%s%c", frame, dot_frame, PATH_DELIM);
|
3812
|
-
for (j = 0; subdir[ j] != NULL; j++) {
|
3813
|
-
n = sprintf( cp, "%s%c%s", subdir[ j], PATH_DELIM, fname);
|
3814
|
-
/*
|
3815
|
-
* 'fullname' is for example:
|
3816
|
-
* /System/Library/Frameworks/Foundation.framework/Headers/
|
3817
|
-
* Foundation.h,
|
3818
|
-
* /System/Library/Frameworks/Foundation.framework/Frameworks/
|
3819
|
-
* CarbonCore.framework/Headers/OSUtils.h,
|
3820
|
-
* or /System/Library/Frameworks/IOKit.framework/Headers/
|
3821
|
-
* pwr_mgt/IOPMLib.h.
|
3822
|
-
* Pass this as one filename argument to open_file() rather than
|
3823
|
-
* deviding to directory part and file part. The first argument to
|
3824
|
-
* open_file() which is a pointer to the directory part is remembered
|
3825
|
-
* by FILEINFO struct. But, 'fullname' is over-written each time,
|
3826
|
-
* and the former path-list is lost soon. Therefore, it cannot be
|
3827
|
-
* passed as the first argument. In addition, though the first
|
3828
|
-
* argument to open_file() is needed for #include_next, this directive
|
3829
|
-
* has no meaning in framework.
|
3830
|
-
*/
|
3831
|
-
if ((cp - fullname) + n > PATHMAX)
|
3832
|
-
cfatal( "Too long framework path", NULL, 0L, NULL); /* _F_ */
|
3833
|
-
if (open_file( &null, NULL, fullname, FALSE, FALSE, sys_frame))
|
3834
|
-
return TRUE;
|
3835
|
-
}
|
3836
|
-
return FALSE;
|
3837
|
-
}
|
3838
|
-
|
3839
|
-
#endif /* SYSTEM == SYS_MAC */
|
3840
|
-
|
3841
1906
|
#if 0 /* This part is only for debugging */
|
3842
1907
|
static int chk_dirp(
|
3843
1908
|
const char ** dirp
|
@@ -3906,7 +1971,7 @@ void sharp(
|
|
3906
1971
|
while (! file->fp)
|
3907
1972
|
file = file->parent;
|
3908
1973
|
line = sharp_file ? sharp_file->line : src_line;
|
3909
|
-
if (no_output ||
|
1974
|
+
if (no_output || file == NULL
|
3910
1975
|
|| (file == sh_file && line == sh_line))
|
3911
1976
|
goto sharp_exit;
|
3912
1977
|
sh_file = file;
|
@@ -3956,16 +2021,6 @@ static void cur_file(
|
|
3956
2021
|
sharp_filename = save_string( name);
|
3957
2022
|
}
|
3958
2023
|
mcpp_fprintf( OUT, " \"%s\"", name);
|
3959
|
-
#if COMPILER == GNUC
|
3960
|
-
if (! std_line_prefix) {
|
3961
|
-
if (flag) {
|
3962
|
-
mcpp_fputc( ' ', OUT);
|
3963
|
-
mcpp_fputc( '0' + flag, OUT);
|
3964
|
-
}
|
3965
|
-
if (file->sys_header)
|
3966
|
-
mcpp_fputs( " 3", OUT);
|
3967
|
-
}
|
3968
|
-
#endif
|
3969
2024
|
}
|
3970
2025
|
|
3971
2026
|
#if SYS_FAMILY == SYS_WIN
|
@@ -3983,18 +2038,6 @@ static char * bsl2sl(
|
|
3983
2038
|
cp = filename;
|
3984
2039
|
|
3985
2040
|
while (*cp) {
|
3986
|
-
if (bsl_in_mbchar) {
|
3987
|
-
int c;
|
3988
|
-
c = *cp & UCHARMAX;
|
3989
|
-
if (char_type[ c] & mbchk) { /* First byte of MBCHAR */
|
3990
|
-
char tmp[ PATHMAX];
|
3991
|
-
char * tp = tmp;
|
3992
|
-
*tp++ = *cp++;
|
3993
|
-
mb_read( c, &cp, &tp);
|
3994
|
-
/* Read over the multi-byte characters */
|
3995
|
-
continue;
|
3996
|
-
}
|
3997
|
-
}
|
3998
2041
|
if (*cp == '\\') {
|
3999
2042
|
*cp++ = PATH_DELIM;
|
4000
2043
|
if (!diagnosed && (warn_level & 2) && (warn_level != -1)) {
|
@@ -4073,13 +2116,8 @@ void do_pragma( void)
|
|
4073
2116
|
}
|
4074
2117
|
token_type = scan_token( c, (tp = work_buf, &tp), work_end);
|
4075
2118
|
#if EXPAND_PRAGMA
|
4076
|
-
#if COMPILER == MSC
|
4077
|
-
if (token_type == NAM
|
4078
|
-
&& !str_eq( identifier, "STDC") && !str_eq( identifier, "MCPP")) {
|
4079
|
-
#else
|
4080
2119
|
if (stdc3 && token_type == NAM
|
4081
2120
|
&& !str_eq( identifier, "STDC") && !str_eq( identifier, "MCPP")) {
|
4082
|
-
#endif
|
4083
2121
|
DEFBUF * defp;
|
4084
2122
|
char * mp;
|
4085
2123
|
char * mp_end;
|
@@ -4157,80 +2195,7 @@ void do_pragma( void)
|
|
4157
2195
|
if (warn && (warn_level & 1))
|
4158
2196
|
cwarn( unknown_arg, identifier, 0L, NULL);
|
4159
2197
|
goto skip_nl; /* Do not putout the line */
|
4160
|
-
#if COMPILER == GNUC
|
4161
|
-
/* The #pragma lines for GCC is skipped not to confuse cc1. */
|
4162
|
-
} else if (str_eq( identifier, "GCC")) { /* #pragma GCC * */
|
4163
|
-
if (scan_token( skip_ws(), (tp = work_buf, &tp), work_end) == NAM) {
|
4164
|
-
if (str_eq( identifier, "poison")
|
4165
|
-
|| str_eq( identifier, "dependency")) {
|
4166
|
-
if (warn_level & 2)
|
4167
|
-
cwarn( "Skipped the #pragma line" /*_W2_ */
|
4168
|
-
, NULL, 0L, NULL);
|
4169
|
-
goto skip_nl;
|
4170
|
-
} else if (str_eq( identifier, "system_header")) {
|
4171
|
-
infile->sys_header = TRUE; /* Mark as a system header */
|
4172
|
-
goto skip_nl;
|
4173
|
-
}
|
4174
|
-
}
|
4175
|
-
#endif
|
4176
|
-
|
4177
|
-
#if COMPILER == MSC
|
4178
|
-
} else if (str_eq( identifier, "setlocale")) {
|
4179
|
-
if (skip_ws() == '('
|
4180
|
-
&& scan_token( skip_ws(), (tp = work_buf, &tp), work_end)
|
4181
|
-
== STR
|
4182
|
-
&& skip_ws() == ')') {
|
4183
|
-
if (! is_junk()) {
|
4184
|
-
work_buf[ 0] = *(tp - 1) = '\0';
|
4185
|
-
set_encoding( work_buf + 1, NULL, SETLOCALE);
|
4186
|
-
work_buf[ 0] = *(tp - 1) = '"';
|
4187
|
-
} /* else warned by is_junk() */
|
4188
|
-
} else {
|
4189
|
-
warn = TRUE;
|
4190
|
-
}
|
4191
|
-
#else /* COMPILER != MSC */
|
4192
|
-
} else if (str_eq( identifier, "__setlocale")) {
|
4193
|
-
if (skip_ws() == '('
|
4194
|
-
&& scan_token( skip_ws(), (tp = work_buf, &tp), work_end)
|
4195
|
-
== STR
|
4196
|
-
&& skip_ws() == ')') {
|
4197
|
-
if (! is_junk()) { /* #pragma __setlocale */
|
4198
|
-
work_buf[ 0] = *(tp - 1) = '\0';
|
4199
|
-
set_encoding( work_buf + 1, NULL, __SETLOCALE);
|
4200
|
-
work_buf[ 0] = *(tp - 1) = '"';
|
4201
|
-
} /* else warned by is_junk() */
|
4202
|
-
} else {
|
4203
|
-
warn = TRUE;
|
4204
|
-
}
|
4205
|
-
#endif
|
4206
|
-
|
4207
|
-
#if COMPILER == MSC
|
4208
|
-
} else if (str_eq( identifier, "push_macro")) {
|
4209
|
-
push_or_pop( PUSH);
|
4210
|
-
goto skip_nl;
|
4211
|
-
} else if (str_eq( identifier, "pop_macro")) {
|
4212
|
-
push_or_pop( POP);
|
4213
|
-
goto skip_nl;
|
4214
|
-
#endif
|
4215
|
-
|
4216
|
-
#if COMPILER == LCC
|
4217
|
-
} else if (str_eq( identifier, "optimize")
|
4218
|
-
&& (skip_ws() == '(')
|
4219
|
-
&& (char_type[ (c = skip_ws()) & UCHARMAX] == DIG)
|
4220
|
-
&& (skip_ws() == ')')) {
|
4221
|
-
char tmp[ 2];
|
4222
2198
|
|
4223
|
-
tmp[ 0] = c;
|
4224
|
-
tmp[ 1] = EOS;
|
4225
|
-
look_and_install( optim_name, DEF_NOARGS_PREDEF, null, tmp);
|
4226
|
-
#endif
|
4227
|
-
|
4228
|
-
#if COMPILER == COMPILER_UNKNOWN
|
4229
|
-
/*
|
4230
|
-
* Write here any compiler-specific #pragma sub-directive which should
|
4231
|
-
* be processed by preprocessor.
|
4232
|
-
*/
|
4233
|
-
#endif
|
4234
2199
|
}
|
4235
2200
|
|
4236
2201
|
if (warn) {
|
@@ -4268,7 +2233,7 @@ static void do_once(
|
|
4268
2233
|
once_end = &once_list[ max_once];
|
4269
2234
|
max_once *= 2;
|
4270
2235
|
}
|
4271
|
-
once_end->name = fullname;
|
2236
|
+
once_end->name = (char*)fullname;
|
4272
2237
|
once_end->len = strlen( fullname);
|
4273
2238
|
once_end++;
|
4274
2239
|
}
|
@@ -4340,8 +2305,7 @@ static void push_or_pop(
|
|
4340
2305
|
/* Else the current definition exists. Push it */
|
4341
2306
|
s_def = sizeof (DEFBUF) + 3 + s_name
|
4342
2307
|
+ strlen( defp->repl) + strlen( defp->fname);
|
4343
|
-
|
4344
|
-
s_def += strlen( defp->parmnames);
|
2308
|
+
s_def += strlen( defp->parmnames);
|
4345
2309
|
dp = (DEFBUF *) xmalloc( s_def);
|
4346
2310
|
memcpy( dp, defp, s_def); /* Copy the definition */
|
4347
2311
|
dp->link = *prevp; /* Insert to linked-list*/
|
@@ -4382,28 +2346,6 @@ static void push_or_pop(
|
|
4382
2346
|
}
|
4383
2347
|
}
|
4384
2348
|
|
4385
|
-
static void do_asm(
|
4386
|
-
int asm_start /* #asm ? */
|
4387
|
-
)
|
4388
|
-
/*
|
4389
|
-
* #asm, #endasm
|
4390
|
-
* Originally written for OS-9/09 Microware C.
|
4391
|
-
*/
|
4392
|
-
{
|
4393
|
-
if (! compiling)
|
4394
|
-
return;
|
4395
|
-
if (asm_start == (in_asm != 0L)) {
|
4396
|
-
if (in_asm)
|
4397
|
-
cerror( "In #asm block started at line %.0s%ld" /* _E_ */
|
4398
|
-
, NULL, in_asm, NULL);
|
4399
|
-
else
|
4400
|
-
cerror( "Without #asm", NULL, 0L, NULL); /* _E_ */
|
4401
|
-
skip_nl();
|
4402
|
-
unget_ch();
|
4403
|
-
return;
|
4404
|
-
}
|
4405
|
-
in_asm = asm_start ? src_line : 0L;
|
4406
|
-
}
|
4407
2349
|
|
4408
2350
|
void do_old( void)
|
4409
2351
|
/*
|
@@ -4413,91 +2355,9 @@ void do_old( void)
|
|
4413
2355
|
{
|
4414
2356
|
static const char * const unknown
|
4415
2357
|
= "Unknown #directive \"%s\"%.0ld%s"; /* _E_ _W8_ */
|
4416
|
-
static const char * const ext
|
4417
|
-
= "%s is not allowed by Standard%.0ld%s"; /* _W2_ _W8_*/
|
4418
|
-
|
4419
|
-
#if COMPILER == GNUC
|
4420
|
-
if (str_eq( identifier, "include_next")) {
|
4421
|
-
if ((compiling && (warn_level & 2))
|
4422
|
-
|| (! compiling && (warn_level & 8)))
|
4423
|
-
cwarn( ext, "#include_next", 0L
|
4424
|
-
, compiling ? NULL : " (in skipped block)");
|
4425
|
-
if (! compiling)
|
4426
|
-
return;
|
4427
|
-
in_include = TRUE;
|
4428
|
-
do_include( TRUE);
|
4429
|
-
in_include = FALSE;
|
4430
|
-
return;
|
4431
|
-
} else if (str_eq( identifier, "warning")) {
|
4432
|
-
if ((compiling && (warn_level & 2))
|
4433
|
-
|| (! compiling && (warn_level & 8)))
|
4434
|
-
cwarn( ext, "#warning", 0L
|
4435
|
-
, compiling ? NULL : " (in skipped block)");
|
4436
|
-
if (! compiling)
|
4437
|
-
return;
|
4438
|
-
cwarn( infile->buffer, NULL, 0L, NULL);
|
4439
|
-
/* Always output the warning */
|
4440
|
-
skip_nl();
|
4441
|
-
unget_ch();
|
4442
|
-
return;
|
4443
|
-
} else if (str_eq( identifier, "ident") || str_eq( identifier, "sccs")) {
|
4444
|
-
if ((compiling && (warn_level & 1))
|
4445
|
-
|| (! compiling && (warn_level & 8))) {
|
4446
|
-
if (str_eq( identifier, "ident"))
|
4447
|
-
cwarn(
|
4448
|
-
compiling ? "Ignored #ident" : "#ident (in skipped block)" /* _W1_ _W8_*/
|
4449
|
-
, NULL, 0L, NULL);
|
4450
|
-
else
|
4451
|
-
cwarn(
|
4452
|
-
compiling ? "Ignored #sccs" : "#sccs (in skipped block)" /* _W1_ _W8_*/
|
4453
|
-
, NULL, 0L, NULL);
|
4454
|
-
}
|
4455
|
-
if (! compiling)
|
4456
|
-
return;
|
4457
|
-
skip_nl();
|
4458
|
-
unget_ch();
|
4459
|
-
return;
|
4460
|
-
}
|
4461
|
-
#endif /* COMPILER == GNUC */
|
4462
|
-
|
4463
|
-
#if COMPILER == MSC
|
4464
|
-
if (str_eq( identifier, "using") || str_eq( identifier, "import")) {
|
4465
|
-
/* #using or #import */
|
4466
|
-
if (! compiling)
|
4467
|
-
return;
|
4468
|
-
mcpp_fputs( infile->buffer, OUT); /* Putout the line as is*/
|
4469
|
-
skip_nl();
|
4470
|
-
unget_ch();
|
4471
|
-
return;
|
4472
|
-
}
|
4473
|
-
#endif
|
4474
|
-
|
4475
|
-
#if SYSTEM == SYS_MAC
|
4476
|
-
if (str_eq( identifier, "import")) {
|
4477
|
-
if ((compiling && (warn_level & 2))
|
4478
|
-
|| (! compiling && (warn_level & 8)))
|
4479
|
-
cwarn( ext, "#import", 0L
|
4480
|
-
, compiling ? NULL : " (in skipped block)");
|
4481
|
-
if (! compiling)
|
4482
|
-
return;
|
4483
|
-
in_import = in_include = TRUE;
|
4484
|
-
do_include( FALSE);
|
4485
|
-
in_import = in_include = FALSE;
|
4486
|
-
return;
|
4487
|
-
}
|
4488
|
-
#endif
|
4489
|
-
|
4490
|
-
if (! standard && do_prestd_directive())
|
4491
|
-
return;
|
4492
2358
|
|
4493
2359
|
if (compiling) {
|
4494
|
-
|
4495
|
-
if (warn_level & 1)
|
4496
|
-
cwarn( unknown, identifier, 0L, NULL);
|
4497
|
-
mcpp_fputs( infile->buffer, OUT); /* Putout the line */
|
4498
|
-
} else {
|
4499
|
-
cerror( unknown, identifier, 0L, NULL);
|
4500
|
-
}
|
2360
|
+
cerror( unknown, identifier, 0L, NULL);
|
4501
2361
|
} else if (warn_level & 8) {
|
4502
2362
|
cwarn( unknown, identifier, 0L, " (in skipped block)");
|
4503
2363
|
}
|
@@ -4506,80 +2366,6 @@ void do_old( void)
|
|
4506
2366
|
return;
|
4507
2367
|
}
|
4508
2368
|
|
4509
|
-
static int do_prestd_directive( void)
|
4510
|
-
/*
|
4511
|
-
* Process directives for pre-Standard mode.
|
4512
|
-
*/
|
4513
|
-
{
|
4514
|
-
#if COMPILER != GNUC
|
4515
|
-
if (str_eq( identifier, "assert")) { /* #assert */
|
4516
|
-
if (! compiling) /* Only validity check */
|
4517
|
-
return TRUE;
|
4518
|
-
if (eval_if() == 0L) { /* Assert expression */
|
4519
|
-
cerror( "Preprocessing assertion failed" /* _E_ */
|
4520
|
-
, NULL, 0L, NULL);
|
4521
|
-
skip_nl();
|
4522
|
-
unget_ch();
|
4523
|
-
}
|
4524
|
-
return TRUE;
|
4525
|
-
} else
|
4526
|
-
#endif
|
4527
|
-
if (str_eq( identifier, "put_defines")) {
|
4528
|
-
if (! compiling) /* Only validity check */
|
4529
|
-
return TRUE;
|
4530
|
-
if (mcpp_mode != OLD_PREP && ! is_junk())
|
4531
|
-
dump_def( TRUE, FALSE); /* #put_defines */
|
4532
|
-
skip_nl();
|
4533
|
-
unget_ch();
|
4534
|
-
return TRUE;
|
4535
|
-
} else if (str_eq( identifier, "preprocess")) {
|
4536
|
-
if (! compiling) /* Only validity check */
|
4537
|
-
return TRUE;
|
4538
|
-
if (mcpp_mode != OLD_PREP && ! is_junk())
|
4539
|
-
/* Just putout the directive for the succeding preprocessor */
|
4540
|
-
mcpp_fputs( "#preprocessed\n", OUT);
|
4541
|
-
skip_nl();
|
4542
|
-
unget_ch();
|
4543
|
-
return TRUE;
|
4544
|
-
} else if (str_eq( identifier, "preprocessed")) {
|
4545
|
-
if (! compiling) /* Only validity check */
|
4546
|
-
return TRUE;
|
4547
|
-
if (mcpp_mode != OLD_PREP && ! is_junk()) {
|
4548
|
-
skip_nl();
|
4549
|
-
do_preprocessed(); /* #preprocessed */
|
4550
|
-
return TRUE;
|
4551
|
-
}
|
4552
|
-
skip_nl();
|
4553
|
-
unget_ch();
|
4554
|
-
return TRUE;
|
4555
|
-
}
|
4556
|
-
|
4557
|
-
if (str_eq( identifier, "debug")) { /* #debug <args> */
|
4558
|
-
if (! compiling) /* Only validity check */
|
4559
|
-
return TRUE;
|
4560
|
-
do_debug( TRUE);
|
4561
|
-
return TRUE;
|
4562
|
-
} else if (str_eq( identifier, "end_debug")) {
|
4563
|
-
if (! compiling)
|
4564
|
-
return TRUE;
|
4565
|
-
do_debug( FALSE); /* #end_debug <args> */
|
4566
|
-
return TRUE;
|
4567
|
-
}
|
4568
|
-
|
4569
|
-
if (str_eq( identifier, "asm")) { /* #asm */
|
4570
|
-
do_asm( TRUE);
|
4571
|
-
return TRUE;
|
4572
|
-
}
|
4573
|
-
if (str_eq( identifier, "endasm")) { /* #endasm */
|
4574
|
-
do_asm( FALSE);
|
4575
|
-
skip_nl(); /* Skip comments, etc. */
|
4576
|
-
unget_ch();
|
4577
|
-
return TRUE;
|
4578
|
-
}
|
4579
|
-
|
4580
|
-
return FALSE; /* Unknown directive */
|
4581
|
-
}
|
4582
|
-
|
4583
2369
|
static void do_preprocessed( void)
|
4584
2370
|
/*
|
4585
2371
|
* The source file has been already preprocessed.
|
@@ -4731,14 +2517,15 @@ static int do_debug(
|
|
4731
2517
|
else if (num == MEMORY)
|
4732
2518
|
print_heap();
|
4733
2519
|
else if (num == MACRO_CALL)
|
4734
|
-
option_flags.k = TRUE; /* This pragma needs this mode */
|
2520
|
+
// option_flags.k = TRUE; /* This pragma needs this mode */
|
2521
|
+
;
|
4735
2522
|
} else {
|
4736
2523
|
mcpp_debug &= ~num;
|
4737
2524
|
}
|
4738
2525
|
}
|
4739
2526
|
c = skip_ws();
|
4740
2527
|
}
|
4741
|
-
if (
|
2528
|
+
if (c != '\n') {
|
4742
2529
|
if (warn_level & 1) {
|
4743
2530
|
if (c != '\n') {
|
4744
2531
|
cwarn( not_ident, work_buf, 0L, NULL);
|
@@ -4757,18 +2544,6 @@ diagnosed:
|
|
4757
2544
|
return TRUE;
|
4758
2545
|
}
|
4759
2546
|
|
4760
|
-
void put_asm( void)
|
4761
|
-
/*
|
4762
|
-
* Put out source line as it is.
|
4763
|
-
*/
|
4764
|
-
{
|
4765
|
-
#if 0
|
4766
|
-
mcpp_fputs( "#2\n", OUT);
|
4767
|
-
mcpp_fputs( infile->buffer, OUT);
|
4768
|
-
skip_nl();
|
4769
|
-
#endif
|
4770
|
-
}
|
4771
|
-
|
4772
2547
|
static void dump_path( void)
|
4773
2548
|
/*
|
4774
2549
|
* Show the include directories.
|
@@ -4777,7 +2552,6 @@ static void dump_path( void)
|
|
4777
2552
|
const char ** incptr;
|
4778
2553
|
const char * inc_dir;
|
4779
2554
|
const char * dir = "./";
|
4780
|
-
int i;
|
4781
2555
|
|
4782
2556
|
mcpp_fputs( "Include paths are as follows --\n", DBG);
|
4783
2557
|
for (incptr = incdir; incptr < incend; incptr++) {
|
@@ -4787,12 +2561,6 @@ static void dump_path( void)
|
|
4787
2561
|
mcpp_fprintf( DBG, " %s\n", inc_dir);
|
4788
2562
|
}
|
4789
2563
|
mcpp_fputs( "End of include path list.\n", DBG);
|
4790
|
-
#if SYSTEM == SYS_MAC
|
4791
|
-
mcpp_fputs( "Framework paths are as follows --\n", DBG);
|
4792
|
-
for (i = 0; i < num_framework; i++ )
|
4793
|
-
mcpp_fprintf( DBG, " %s\n", framework[ i]);
|
4794
|
-
mcpp_fputs( "End of framework path list.\n", DBG);
|
4795
|
-
#endif
|
4796
2564
|
}
|
4797
2565
|
|
4798
2566
|
/*
|
@@ -4912,13 +2680,8 @@ void at_end( void)
|
|
4912
2680
|
* Handle the commands to be executed at the end of processing.
|
4913
2681
|
*/
|
4914
2682
|
{
|
4915
|
-
#if COMPILER == GNUC
|
4916
|
-
if (dMflag || dDflag)
|
4917
|
-
dump_def( FALSE, FALSE);
|
4918
|
-
#endif
|
4919
2683
|
}
|
4920
2684
|
|
4921
|
-
#if MCPP_LIB
|
4922
2685
|
void clear_filelist( void)
|
4923
2686
|
/*
|
4924
2687
|
* Free malloced memory for filename-list and directory-list.
|
@@ -4933,8 +2696,5 @@ void clear_filelist( void)
|
|
4933
2696
|
for (namep = fnamelist; namep < fname_end; namep++)
|
4934
2697
|
free( (void *) namep->name);
|
4935
2698
|
free( (void *) fnamelist);
|
4936
|
-
|
4937
|
-
free( (void *) once_list);
|
2699
|
+
free( (void *) once_list);
|
4938
2700
|
}
|
4939
|
-
#endif
|
4940
|
-
|