#!/bin/bash # patch_core_dtc_h.sh - Post-Build Patch für core_dtc.h # Fügt fehlenden Include und using-Declarationen hinzu set -e CORE_DTC_H="/repo/build/Lts/DDS/Core/core_dtc.h" if [ ! -f "$CORE_DTC_H" ]; then echo "ERROR: $CORE_DTC_H not found!" exit 1 fi echo "Patching $CORE_DTC_H..." # Prüfen ob bereits gepatcht if grep -q "// PATCHED BY patch_core_dtc_h.sh" "$CORE_DTC_H"; then echo "File already patched, skipping..." exit 0 fi # 1. Include für core_dtc_types.h nach core.hpp hinzufügen sed -i '/#include "core.hpp"/a #include "core_dtc_types.h" // PATCHED BY patch_core_dtc_h.sh' "$CORE_DTC_H" # 2. Using-Declarationen im Core Namespace hinzufügen (nach namespace Core { ) # Wir fügen nach "namespace Core {" einen Block mit using-Declarationen ein sed -i '/^namespace Core {/a\ // PATCHED BY patch_core_dtc_h.sh - DTC type aliases\ using DTC::CurrentRunningState;\ using DTC::LockedEntity;\ using DTC::PartitionTime;\ using DTC::RelativePositionAbsoluteTime;\ using DTC::RelativePositionRelativeTime;\ using DTC::ReplayPartition;\ ' "$CORE_DTC_H" echo "Patching complete!"