Files
source/Strategic
Marco Antonio J. Costa d008d10b31 Replace a ton of trivial #ifdefs with runtime checks
This one is big, but unless I missed something, should be all be
trivial.

scripted-diff with the following, then manually tweaked whatever needed:
```

if [ $# -ne 3 ]; then
    echo "Usage: $0 '<pattern>' '<replacement>' '<filename>'"
    exit 1
fi

pattern="$1"
replacement="$2"
filename="$3"

if [ ! -f "$filename" ]; then
    echo "Error: File $filename does not exist."
    exit 1
fi

sed -i '/'"$pattern"'/ {
    :loop
    $ !{
        N
        /'"$pattern"'.*\n.*#endif/ {
            s/'"$pattern"'/'"$replacement"'/
            s/#else/} else {/
            s/#endif/}/
            P
            D
        }
        /'"$pattern"'/ b loop
    }
}' "$filename"

echo "Replacement complete in $filename"
```

h/t to Grok2 for the sed command
2024-12-31 16:28:44 -03:00
..
2023-01-03 15:51:48 +02:00
2022-10-25 09:13:51 -07:00
2023-10-08 16:45:06 +03:00
2023-01-03 15:51:48 +02:00
2013-08-25 13:38:21 +00:00
2023-01-03 15:51:48 +02:00
2020-07-24 19:27:34 +00:00
2023-01-03 15:51:48 +02:00
2023-01-22 23:35:08 +02:00
2023-01-22 23:35:08 +02:00
2023-01-03 15:51:48 +02:00
2023-10-08 16:45:06 +03:00
2023-01-03 15:51:48 +02:00
2023-01-22 23:35:08 +02:00
2023-01-03 15:51:48 +02:00
2014-08-31 20:42:20 +00:00