FILES=$(rg 'DRM_IO(.?)(.?)\(0' /usr/include/libdrm/drm.h | awk '{print $2}') for F in $FILES; do echo "const __u64 _$F = $F;" echo "#undef $F" echo "const __u64 $F = _$F;" done FILES=$(rg 'DRM_IO(.?)(.?)\(' /usr/include/libdrm/i915_drm.h | awk '{print $2}') for F in $FILES; do echo "const __u64 _$F = $F;" echo "#undef $F" echo "const __u64 $F = _$F;" done