Moving to MCA 2.5

From Mca2
Revision as of 14:28, 11 August 2009 by Uhl (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

If you use conditional compilation be aware that most macros have changed. The following table shows the mapping between the old MCA2.4 macros and the new MCA2.5 ones.

MCA2.4 MCA2.5
_MCA_LINUX_ _SYSTEM_LINUX_
_MCA_LXRT_ _SYSTEM_LXRT_
_MCA_WIN32_ _SYSTEM_WIN32_
_MCA_SYSTEM_DARWIN_ _SYSTEM_DARWIN_
_MCA_BIG_ENDIAN_ _SYSTEM_BIG_ENDIAN_
_MCA_DEBUG_ _IC_DEBUG_
_MCA_QT_2_ _IC_BUILDER_QT_2_
_MCA_QT_3_ _IC_BUILDER_QT_3_
_MCA_CAN_MCA_ _IC_BUILDER_CAN_MCA_
_MCA_CAN_PEAK_ _IC_BUILDER_CAN_PEAK_
_MCA_CAN_ITEC_ _IC_BUILDER_CAN_ITEC_

The following script can be used on Linux to replace the above macros:

#!/bin/bash
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_LINUX_/_SYSTEM_LINUX_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_LXRT_/_SYSTEM_LXRT_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_WIN32_/_SYSTEM_WIN32_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_SYSTEM_DARWIN_/_SYSTEM_DARWIN_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_BIG_ENDIAN_/_SYSTEM_BIG_ENDIAN_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_DEBUG_/_IC_DEBUG_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_QT_2_/_IC_BUILDER_QT_2_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_QT_3_/_IC_BUILDER_QT_3_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_CAN_MCA_/_IC_BUILDER_CAN_MCA_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_CAN_PEAK_/_IC_BUILDER_CAN_PEAK_/g' $file; done
for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_CAN_ITEC_/_IC_BUILDER_CAN_ITEC_/g' $file; done

or in one line:

for file in *.h *.cpp *.hpp; do sed -i -e 's/_MCA_LINUX_/_SYSTEM_LINUX_/g' -e 's/_MCA_LXRT_/_SYSTEM_LXRT_/g' -e 's/_MCA_WIN32_/_SYSTEM_WIN32_/g' -e 's/_MCA_SYSTEM_DARWIN_/_SYSTEM_DARWIN_/g' -e 's/_MCA_BIG_ENDIAN_/_SYSTEM_BIG_ENDIAN_/g' -e 's/_MCA_DEBUG_/_IC_DEBUG_/g' -e 's/_MCA_QT_2_/_IC_BUILDER_QT_2_/g' -e 's/_MCA_QT_3_/_IC_BUILDER_QT_3_/g' -e 's/_MCA_CAN_MCA_/_IC_BUILDER_CAN_MCA_/g' -e 's/_MCA_CAN_PEAK_/_IC_BUILDER_CAN_PEAK_/g' -e 's/_MCA_CAN_ITEC_/_IC_BUILDER_CAN_ITEC_/g' $file; done
Personal tools