Files
source/Laptop
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
2013-10-19 12:47:53 +00:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00
2007-05-09 13:16:37 +00:00
2023-01-03 15:51:48 +02:00
2012-10-21 16:10:49 +00:00
2020-05-17 14:13:57 +00:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00
2023-01-14 02:08:39 -03:00
2020-05-30 14:26:16 +00:00
2023-01-03 15:51:48 +02:00
2023-10-08 16:48:18 +03:00
2022-04-13 10:43:49 +00:00
2023-10-08 16:48:18 +03:00
2022-10-22 17:54:06 -07:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00
2023-10-08 16:48:18 +03:00
2023-07-04 20:58:56 -07:00
2017-01-13 20:19:44 +00:00
2023-01-03 15:51:48 +02:00
2012-08-24 23:52:55 +00:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00
2018-02-27 00:49:42 +00:00
2023-10-08 16:48:18 +03:00
2023-01-03 15:51:48 +02:00
2023-07-26 23:44:25 -07:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00