Exemplo n.º 1
0
        public void UnsetCppDefine(String undefineString)
        {
            if (!Defines.ContainsKey(undefineString))
            {
                return;
            }

            Define defineForRemoval = Defines[undefineString];

            SetOfDefines.Remove(defineForRemoval);
            Defines.Remove(undefineString);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Apply a preprocessor define to a single source file.
        /// </summary>
        /// <param name="defineString">The whole define string without "-D",
        /// for instance, "_FORTIFY_SOURCE=2" or "FEATURE_WANTED".</param>
        public void SetCppDefine(String defineString)
        {
            Define newDefine = new Define(defineString);

            if (Defines.ContainsKey(newDefine.Name))
            {
                Define oldDefine = Defines[newDefine.Name];
                if (oldDefine.Value != newDefine.Value)
                {
                    Logger.WriteLine(LogLevel.Warning, $"'{newDefine.Name}' redefined from '' to '{newDefine.Value}'");
                }
                SetOfDefines.Remove(oldDefine);
            }

            Defines[newDefine.Name] = newDefine;
            SetOfDefines.Add(newDefine);
        }