From 8e1b23779f34c421742c6287cc3f28c26039e082 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Thu, 20 Aug 2009 11:42:18 +0000 Subject: [PATCH] - Replace combinations of #if defined (c_plusplus) defined (__cplusplus) followed by extern "C" { and the closing counterpart by BEGIN_C_DECLS and END_C_DECLS. Notable exceptions are: - opal/include/opal_config_bottom.h: This is our generated code, that itself defines BEGIN_C_DECL and END_C_DECL - ompi/mpi/cxx/mpicxx.h: Here we do not include opal_config_bottom.h: - Belongs to external code: opal/mca/backtrace/darwin/MoreBacktrace/MoreDebugging/MoreBacktrace.c opal/mca/backtrace/darwin/MoreBacktrace/MoreDebugging/MoreBacktrace.h - opal/include/opal/prefetch.h: Has C++ specific macros that are protected: - Had #if ... } #endif _and_ END_C_DECLS (aka end up with 2x END_C_DECLS) ompi/mca/btl/openib/btl_openib.h - opal/event/event.h has #ifdef __cplusplus as BEGIN_C_DECLS... - opal/win32/ompi_process.h: had extern "C"\n {... opal/win32/ompi_process.h: dito - ompi/mca/btl/pcie/btl_pcie_lex.l: needed to add *_C_DECLS ompi/mpi/f90/test/align_c.c: dito - ompi/debuggers/msgq_interface.h: used #ifdef __cplusplus - ompi/mpi/f90/xml/common-C.xsl: Amend Tested on linux using --with-openib and --with-mx The following do not contain either opal_config.h, orte_config.h or ompi_config.h (but possibly other header files, that include one of the above): ompi/mca/bml/r2/bml_r2_ft.h ompi/mca/btl/gm/btl_gm_endpoint.h ompi/mca/btl/gm/btl_gm_proc.h ompi/mca/btl/mx/btl_mx_endpoint.h ompi/mca/btl/ofud/btl_ofud_endpoint.h ompi/mca/btl/ofud/btl_ofud_frag.h ompi/mca/btl/ofud/btl_ofud_proc.h ompi/mca/btl/openib/btl_openib_mca.h ompi/mca/btl/portals/btl_portals_endpoint.h ompi/mca/btl/portals/btl_portals_frag.h ompi/mca/btl/sctp/btl_sctp_endpoint.h ompi/mca/btl/sctp/btl_sctp_proc.h ompi/mca/btl/tcp/btl_tcp_endpoint.h ompi/mca/btl/tcp/btl_tcp_ft.h ompi/mca/btl/tcp/btl_tcp_proc.h ompi/mca/btl/template/btl_template_endpoint.h ompi/mca/btl/template/btl_template_proc.h ompi/mca/btl/udapl/btl_udapl_eager_rdma.h ompi/mca/btl/udapl/btl_udapl_endpoint.h ompi/mca/btl/udapl/btl_udapl_mca.h ompi/mca/btl/udapl/btl_udapl_proc.h ompi/mca/mtl/mx/mtl_mx_endpoint.h ompi/mca/mtl/mx/mtl_mx.h ompi/mca/mtl/psm/mtl_psm_endpoint.h ompi/mca/mtl/psm/mtl_psm.h ompi/mca/pml/cm/pml_cm_component.h ompi/mca/pml/csum/pml_csum_comm.h ompi/mca/pml/dr/pml_dr_comm.h ompi/mca/pml/dr/pml_dr_component.h ompi/mca/pml/dr/pml_dr_endpoint.h ompi/mca/pml/dr/pml_dr_recvfrag.h ompi/mca/pml/example/pml_example.h ompi/mca/pml/ob1/pml_ob1_comm.h ompi/mca/pml/ob1/pml_ob1_component.h ompi/mca/pml/ob1/pml_ob1_endpoint.h ompi/mca/pml/ob1/pml_ob1_rdmafrag.h ompi/mca/pml/ob1/pml_ob1_recvfrag.h ompi/mca/pml/v/pml_v_output.h opal/include/opal/prefetch.h opal/mca/timer/aix/timer_aix.h opal/util/qsort.h test/support/components.h This commit was SVN r21855. The following SVN revision numbers were found above: r2 --> open-mpi/ompi@58fdc188553052bc2e893ba28fb28fddbe78435a --- contrib/ompi_cplusplus.sed | 41 ++++ contrib/ompi_cplusplus.sh | 37 ++++ contrib/ompi_cplusplus.txt | 186 ++++++++++++++++++ ompi/class/ompi_free_list.h | 8 +- ompi/class/ompi_rb_tree.h | 8 +- ompi/class/ompi_seq_tracker.h | 8 +- ompi/debuggers/msgq_interface.h | 9 +- ompi/group/group.h | 8 +- ompi/include/mpi.h.in | 2 +- ompi/mca/allocator/base/base.h | 8 +- ompi/mca/allocator/basic/allocator_basic.h | 8 +- .../allocator/bucket/allocator_bucket_alloc.h | 8 +- ompi/mca/bml/base/base.h | 8 +- ompi/mca/bml/base/bml_base_btl.h | 8 +- ompi/mca/bml/r2/bml_r2.h | 8 +- ompi/mca/bml/r2/bml_r2_ft.h | 8 +- ompi/mca/btl/gm/btl_gm.h | 8 +- ompi/mca/btl/gm/btl_gm_endpoint.h | 8 +- ompi/mca/btl/gm/btl_gm_frag.h | 8 +- ompi/mca/btl/gm/btl_gm_proc.h | 8 +- ompi/mca/btl/mx/btl_mx_endpoint.h | 8 +- ompi/mca/btl/ofud/btl_ofud.h | 8 +- ompi/mca/btl/ofud/btl_ofud_endpoint.h | 8 +- ompi/mca/btl/ofud/btl_ofud_frag.h | 8 +- ompi/mca/btl/ofud/btl_ofud_proc.h | 8 +- ompi/mca/btl/openib/btl_openib.h | 3 - ompi/mca/btl/openib/btl_openib_eager_rdma.h | 8 +- ompi/mca/btl/openib/btl_openib_frag.h | 8 +- ompi/mca/btl/openib/btl_openib_lex.h | 8 +- ompi/mca/btl/openib/btl_openib_lex.l | 8 +- ompi/mca/btl/openib/btl_openib_mca.h | 8 +- ompi/mca/btl/pcie/btl_pcie_lex.l | 4 + ompi/mca/btl/portals/btl_portals_endpoint.h | 8 +- ompi/mca/btl/portals/btl_portals_frag.h | 8 +- ompi/mca/btl/sctp/btl_sctp.h | 8 +- ompi/mca/btl/sctp/btl_sctp_endpoint.h | 8 +- ompi/mca/btl/sctp/btl_sctp_frag.h | 8 +- ompi/mca/btl/sctp/btl_sctp_hdr.h | 8 +- ompi/mca/btl/sctp/btl_sctp_proc.h | 8 +- ompi/mca/btl/self/btl_self.h | 8 +- ompi/mca/btl/sm/btl_sm.h | 8 +- ompi/mca/btl/tcp/btl_tcp.h | 8 +- ompi/mca/btl/tcp/btl_tcp_endpoint.h | 8 +- ompi/mca/btl/tcp/btl_tcp_frag.h | 8 +- ompi/mca/btl/tcp/btl_tcp_ft.h | 8 +- ompi/mca/btl/tcp/btl_tcp_proc.h | 8 +- ompi/mca/btl/template/btl_template.h | 8 +- ompi/mca/btl/template/btl_template_endpoint.h | 8 +- ompi/mca/btl/template/btl_template_frag.h | 8 +- ompi/mca/btl/template/btl_template_proc.h | 8 +- ompi/mca/btl/udapl/btl_udapl.h | 8 +- ompi/mca/btl/udapl/btl_udapl_eager_rdma.h | 8 +- ompi/mca/btl/udapl/btl_udapl_endpoint.h | 8 +- ompi/mca/btl/udapl/btl_udapl_frag.h | 8 +- ompi/mca/btl/udapl/btl_udapl_mca.h | 8 +- ompi/mca/btl/udapl/btl_udapl_proc.h | 8 +- ompi/mca/coll/tuned/coll_tuned_dynamic_file.h | 8 +- .../mca/coll/tuned/coll_tuned_dynamic_rules.h | 8 +- ompi/mca/coll/tuned/coll_tuned_topo.h | 8 +- ompi/mca/coll/tuned/coll_tuned_util.h | 8 +- ompi/mca/common/sm/common_sm_mmap.h | 8 +- ompi/mca/crcp/base/base.h | 8 +- ompi/mca/crcp/bkmrk/crcp_bkmrk.h | 8 +- ompi/mca/crcp/bkmrk/crcp_bkmrk_btl.h | 8 +- ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.h | 8 +- ompi/mca/crcp/crcp.h | 8 +- ompi/mca/io/base/base.h | 8 +- ompi/mca/io/base/io_base_request.h | 8 +- ompi/mca/io/romio/src/io_romio.h | 8 +- ompi/mca/mpool/base/mpool_base_mem_cb.h | 8 +- ompi/mca/mpool/fake/mpool_fake.h | 8 +- ompi/mca/mpool/rdma/mpool_rdma.h | 8 +- ompi/mca/mpool/sm/mpool_sm.h | 8 +- ompi/mca/mtl/base/base.h | 8 +- ompi/mca/mtl/mtl.h | 8 +- ompi/mca/mtl/mx/mtl_mx.h | 8 +- ompi/mca/mtl/mx/mtl_mx_endpoint.h | 8 +- ompi/mca/mtl/mx/mtl_mx_types.h | 8 +- ompi/mca/mtl/portals/mtl_portals.h | 8 +- ompi/mca/mtl/psm/mtl_psm.h | 8 +- ompi/mca/mtl/psm/mtl_psm_endpoint.h | 8 +- ompi/mca/mtl/psm/mtl_psm_types.h | 8 +- ompi/mca/pml/cm/pml_cm_component.h | 8 +- ompi/mca/pml/crcpw/pml_crcpw.h | 8 +- ompi/mca/pml/csum/pml_csum_comm.h | 8 +- ompi/mca/pml/dr/pml_dr.h | 8 +- ompi/mca/pml/dr/pml_dr_comm.h | 8 +- ompi/mca/pml/dr/pml_dr_component.h | 8 +- ompi/mca/pml/dr/pml_dr_endpoint.h | 8 +- ompi/mca/pml/dr/pml_dr_recvfrag.h | 8 +- ompi/mca/pml/dr/pml_dr_recvreq.h | 8 +- ompi/mca/pml/dr/pml_dr_sendreq.h | 8 +- ompi/mca/pml/dr/pml_dr_vfrag.h | 8 +- ompi/mca/pml/example/pml_example.h | 8 +- ompi/mca/pml/ob1/pml_ob1_comm.h | 8 +- ompi/mca/pml/ob1/pml_ob1_component.h | 8 +- ompi/mca/pml/ob1/pml_ob1_endpoint.h | 10 +- ompi/mca/pml/ob1/pml_ob1_rdmafrag.h | 8 +- ompi/mca/pml/ob1/pml_ob1_recvfrag.h | 8 +- ompi/mca/pml/pml.h | 8 +- ompi/mca/pml/v/mca/vprotocol/base/base.h | 8 +- .../vprotocol/base/vprotocol_base_request.h | 8 +- ompi/mca/pml/v/mca/vprotocol/vprotocol.h | 8 +- ompi/mca/pml/v/pml_v_output.h | 8 +- ompi/mca/rcache/base/base.h | 8 +- ompi/mca/topo/unity/topo_unity.h | 8 +- ompi/mpi/cxx/mpicxx.h | 5 +- ompi/mpi/f77/f77_strings.h | 8 +- ompi/mpi/f90/test/align_c.c | 9 +- ompi/mpi/f90/xml/common-C.xsl | 4 +- ompi/request/grequest.h | 8 +- ompi/runtime/ompi_cr.h | 8 +- ompi/win/win.h | 8 +- opal/event/event.h | 9 +- opal/include/opal/sys/atomic.h | 8 +- opal/include/opal/sys/timer.h | 8 +- opal/include/opal_config_bottom.h | 2 +- opal/mca/backtrace/backtrace.h | 8 +- opal/mca/backtrace/base/base.h | 8 +- .../backtrace/none/backtrace_none_component.c | 8 +- opal/mca/base/mca_base_component_repository.h | 8 +- opal/mca/base/mca_base_param.h | 8 +- opal/mca/base/mca_base_param_internal.h | 8 +- opal/mca/carto/file/carto_file_lex.l | 8 +- opal/mca/crs/base/base.h | 8 +- opal/mca/crs/blcr/crs_blcr.h | 8 +- opal/mca/crs/crs.h | 8 +- opal/mca/crs/none/crs_none.h | 8 +- opal/mca/crs/self/crs_self.h | 8 +- opal/mca/installdirs/base/base.h | 8 +- opal/mca/installdirs/installdirs.h | 8 +- .../maffinity/first_use/maffinity_first_use.h | 8 +- .../mca/maffinity/libnuma/maffinity_libnuma.h | 8 +- opal/mca/memchecker/base/base.h | 8 +- .../memchecker/valgrind/memchecker_valgrind.h | 8 +- opal/mca/memcpy/base/base.h | 8 +- opal/mca/memory/base/base.h | 8 +- opal/mca/paffinity/linux/paffinity_linux.h | 8 +- .../mca/paffinity/solaris/paffinity_solaris.h | 8 +- .../mca/paffinity/windows/paffinity_windows.h | 8 +- opal/mca/timer/aix/timer_aix.h | 8 +- opal/mca/timer/base/base.h | 8 +- opal/mca/timer/windows/timer_windows.h | 8 +- .../timer/windows/timer_windows_component.h | 8 +- opal/memoryhooks/memory.h | 8 +- opal/memoryhooks/memory_internal.h | 8 +- opal/runtime/opal_cr.h | 8 +- opal/runtime/opal_progress.h | 8 +- opal/threads/threads.h | 8 +- opal/util/cmd_line.h | 8 +- opal/util/crc.h | 8 +- opal/util/daemon_init.h | 8 +- opal/util/error.h | 8 +- opal/util/few.h | 8 +- opal/util/keyval/keyval_lex.l | 11 +- opal/util/keyval_parse.h | 8 +- opal/util/malloc.h | 8 +- opal/util/opal_pty.h | 8 +- opal/util/os_path.h | 8 +- opal/util/qsort.h | 8 +- opal/util/show_help_lex.h | 8 +- opal/util/show_help_lex.l | 8 +- opal/util/strncpy.h | 8 +- opal/util/sys_limits.h | 8 +- opal/util/trace.h | 8 +- opal/win32/ompi_inet.h | 8 +- opal/win32/ompi_process.h | 9 +- opal/win32/ompi_time.h | 9 +- opal/win32/ompi_uio.h | 8 +- opal/win32/ompi_utsname.h | 8 +- orte/mca/filem/filem.h | 8 +- orte/mca/filem/rsh/filem_rsh.h | 8 +- orte/mca/plm/ccp/plm_ccp.h | 8 +- orte/mca/ras/ccp/ras_ccp.h | 8 +- orte/mca/ras/gridengine/ras_gridengine.h | 8 +- orte/mca/ras/loadleveler/ras_loadleveler.h | 8 +- .../mca/rmaps/rank_file/rmaps_rank_file_lex.h | 8 +- orte/mca/rml/ftrm/rml_ftrm.h | 8 +- orte/util/hostfile/hostfile_lex.l | 8 +- test/support/components.h | 8 +- 180 files changed, 623 insertions(+), 1039 deletions(-) create mode 100644 contrib/ompi_cplusplus.sed create mode 100755 contrib/ompi_cplusplus.sh create mode 100644 contrib/ompi_cplusplus.txt diff --git a/contrib/ompi_cplusplus.sed b/contrib/ompi_cplusplus.sed new file mode 100644 index 0000000000..df2c8ca637 --- /dev/null +++ b/contrib/ompi_cplusplus.sed @@ -0,0 +1,41 @@ +# +# Best attempt at a sed script to remove (almost) all combinations +# of C++ namespace occurences: While std. 3-line occurences with any +# combination of spaces and ordering of [c_plusplus,__cplusplus] can +# be detected, sed does not allow multi-line (here >3 lines) parsing. +# This all depends on the number of "N" the macro swallows. +# + +# C_PLUSPLUS || __CPLUSPLUS +/#if *defined *(c_plusplus) *|| *defined *(__cplusplus)/{ +N +N +s/\#if *defined *(c_plusplus) *|| *defined *(__cplusplus) *\n}\n#endif */END_C_DECLS/ +s/\#if *defined *(c_plusplus) *|| *defined *(__cplusplus) *\n *extern *"C" *{ *\n\#endif */BEGIN_C_DECLS/ +} + + +# __CPLUSPLUS || C_PLUSPLUS +/#if *defined *(__cplusplus) *|| *defined *(c_plusplus)/{ +N +N +s/\#if *defined *(__cplusplus) *|| *defined *(c_plusplus) *\n}\n#endif */END_C_DECLS/ +s/\#if *defined *(__cplusplus) *|| *defined *(c_plusplus) *\n *extern *"C" *{ *\n\#endif */BEGIN_C_DECLS/ +} + +# C_PLUSPLUS +/#if *defined *(c_plusplus)/{ +N +N +s/\#if *defined *(c_plusplus) *\n}\n#endif */END_C_DECLS/ +s/\#if *defined *(c_plusplus) *\n *extern *"C" *{ *\n\#endif *\n/BEGIN_C_DECLS/ +} + +# __CPLUSPLUS +/#if *defined *(__cplusplus)/{ +N +N +s/\#if *defined *(__cplusplus) *\n}\n#endif */END_C_DECLS/ +s/\#if *defined *(__cplusplus) *\n *extern *"C" *{ *\n\#endif */BEGIN_C_DECLS/ +} + diff --git a/contrib/ompi_cplusplus.sh b/contrib/ompi_cplusplus.sh new file mode 100755 index 0000000000..693867a433 --- /dev/null +++ b/contrib/ompi_cplusplus.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# +# Change all occurences of #if defined(c_plusplus) and variations +# to BEGIN_C_DECLS and END_C_DECLS using sed. +# +# List of files grepped are in XXX, sed script is in XXX +# +TMPDIR=${TMPDIR:-.} + +while read LINE ; do + if test '#' = ${LINE:0:1} ; then + continue + fi + + FILE=${LINE%%:*} + HAS_OPAL_CONFIG_H=0 + HAS_ORTE_CONFIG_H=0 + HAS_OMPI_CONFIG_H=0 + grep -q "#include \"opal_config.h\"" $FILE && HAS_OPAL_CONFIG_H=1 + grep -q "#include \"orte_config.h\"" $FILE && HAS_ORTE_CONFIG_H=1 + grep -q "#include \"ompi_config.h\"" $FILE && HAS_OMPI_CONFIG_H=1 + + if test $HAS_OPAL_CONFIG_H -eq 0 -a \ + $HAS_ORTE_CONFIG_H -eq 0 -a \ + $HAS_OMPI_CONFIG_H -eq 0 ; then + echo $FILE contains neither header + fi + sed -f contrib/ompi_cplusplus.sed $FILE > $TMPDIR/tmp_file.tmp + mv $TMPDIR/tmp_file.tmp $FILE + + + # + # Sanity check + # + # grep -h -c BEGIN_C_DECLS $FILE | grep -v ':1$' + # grep -h -c END_C_DECLS $FILE | grep -v ':1$' +done < contrib/ompi_cplusplus.txt diff --git a/contrib/ompi_cplusplus.txt b/contrib/ompi_cplusplus.txt new file mode 100644 index 0000000000..468d172516 --- /dev/null +++ b/contrib/ompi_cplusplus.txt @@ -0,0 +1,186 @@ +# The two following belong to a different package +#### ./opal/mca/backtrace/darwin/MoreBacktrace/MoreDebugging/MoreBacktrace.c: defined(__cplusplus) +#### ./opal/mca/backtrace/darwin/MoreBacktrace/MoreDebugging/MoreBacktrace.h: defined(__cplusplus) +# This is our generated code, that itself defines BEGIN_C_DECL and END_C_DECL +#### ./opal/include/opal_config_bottom.h: (defined(c_plusplus) defined(__cplusplus)) +# Here we cannot include opal_config_bottom.h +#### ./ompi/mpi/cxx/mpicxx.h: defined(__cplusplus) defined(c_plusplus) +# These are external: +#### ./opal/mca/memory/ptmalloc2/ +#### ./opal/mca/paffinity/linux/plpa/ +#### ./ompi/include/mpi_portable_platform.h.in +#### ./ompi/mca/io/romio/ +./ompi/mca/topo/unity/topo_unity.h: defined(__cplusplus) defined(c_plusplus) +./opal/win32/ompi_process.h: defined(c_plusplus) defined (__cplusplus) +./opal/win32/ompi_time.h: defined(c_plusplus) defined (__cplusplus) +./opal/win32/ompi_uio.h: defined(c_plusplus) defined (__cplusplus) +./ompi/class/ompi_free_list.h: defined(c_plusplus) defined(__cplusplus) +./ompi/class/ompi_rb_tree.h: defined(c_plusplus) defined(__cplusplus) +./ompi/class/ompi_seq_tracker.h: defined(c_plusplus) defined(__cplusplus) +./ompi/group/group.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/allocator/base/base.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/allocator/basic/allocator_basic.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/allocator/bucket/allocator_bucket_alloc.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/bml/base/base.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/bml/base/bml_base_btl.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/bml/r2/bml_r2_ft.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/bml/r2/bml_r2.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/gm/btl_gm_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/gm/btl_gm_frag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/gm/btl_gm.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/gm/btl_gm_proc.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/mx/btl_mx_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/ofud/btl_ofud_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/ofud/btl_ofud_frag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/ofud/btl_ofud.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/ofud/btl_ofud_proc.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/openib/btl_openib_eager_rdma.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/openib/btl_openib_frag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/openib/btl_openib.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/openib/btl_openib_lex.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/openib/btl_openib_mca.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/portals/btl_portals_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/portals/btl_portals_frag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/sctp/btl_sctp_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/sctp/btl_sctp_frag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/sctp/btl_sctp.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/sctp/btl_sctp_hdr.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/sctp/btl_sctp_proc.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/self/btl_self.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/sm/btl_sm.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/tcp/btl_tcp_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/tcp/btl_tcp_frag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/tcp/btl_tcp_ft.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/tcp/btl_tcp.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/tcp/btl_tcp_proc.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/template/btl_template_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/template/btl_template_frag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/template/btl_template.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/template/btl_template_proc.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/udapl/btl_udapl_eager_rdma.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/udapl/btl_udapl_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/udapl/btl_udapl_frag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/udapl/btl_udapl.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/udapl/btl_udapl_mca.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/udapl/btl_udapl_proc.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/coll/tuned/coll_tuned_dynamic_file.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/coll/tuned/coll_tuned_dynamic_rules.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/coll/tuned/coll_tuned.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/coll/tuned/coll_tuned_topo.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/coll/tuned/coll_tuned_util.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/common/sm/common_sm_mmap.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/crcp/base/base.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/crcp/bkmrk/crcp_bkmrk_btl.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/crcp/bkmrk/crcp_bkmrk.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/crcp/crcp.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/io/base/base.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/io/base/io_base_request.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/io/romio/src/io_romio.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mpool/base/mpool_base_mem_cb.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mpool/fake/mpool_fake.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mpool/rdma/mpool_rdma.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mpool/sm/mpool_sm.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mtl/base/base.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mtl/mtl.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mtl/mx/mtl_mx_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mtl/mx/mtl_mx.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mtl/mx/mtl_mx_types.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mtl/portals/mtl_portals.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mtl/psm/mtl_psm_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mtl/psm/mtl_psm.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/mtl/psm/mtl_psm_types.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/cm/pml_cm_component.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/crcpw/pml_crcpw.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/csum/pml_csum_comm.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/dr/pml_dr_comm.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/dr/pml_dr_component.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/dr/pml_dr_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/dr/pml_dr.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/dr/pml_dr_recvfrag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/dr/pml_dr_recvreq.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/dr/pml_dr_sendreq.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/dr/pml_dr_vfrag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/example/pml_example.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/ob1/pml_ob1_comm.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/ob1/pml_ob1_component.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/ob1/pml_ob1_endpoint.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/ob1/pml_ob1_rdmafrag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/ob1/pml_ob1_recvfrag.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/pml.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/v/mca/vprotocol/base/base.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/v/mca/vprotocol/base/vprotocol_base_request.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/v/mca/vprotocol/vprotocol.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/pml/v/pml_v_output.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/rcache/base/base.h: defined(c_plusplus) defined(__cplusplus) +./ompi/mpi/f77/f77_strings.h: defined(c_plusplus) defined(__cplusplus) +./ompi/request/grequest.h: defined(c_plusplus) defined(__cplusplus) +./ompi/runtime/ompi_cr.h: defined(c_plusplus) defined(__cplusplus) +./ompi/win/win.h: defined(c_plusplus) defined(__cplusplus) +./opal/event/event.h: defined(c_plusplus) defined(__cplusplus) +# Has C++ specific macros that are protected: +####./opal/include/opal/prefetch.h: defined(c_plusplus) defined(__cplusplus) +./opal/include/opal/sys/atomic.h: defined(c_plusplus) defined(__cplusplus) +./opal/include/opal/sys/timer.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/backtrace/backtrace.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/backtrace/base/base.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/backtrace/none/backtrace_none_component.c: defined(c_plusplus) defined(__cplusplus) +./opal/mca/base/mca_base_component_repository.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/base/mca_base_param.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/base/mca_base_param_internal.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/crs/base/base.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/crs/blcr/crs_blcr.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/crs/crs.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/crs/none/crs_none.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/crs/self/crs_self.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/installdirs/base/base.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/installdirs/installdirs.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/maffinity/first_use/maffinity_first_use.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/maffinity/libnuma/maffinity_libnuma.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/memchecker/base/base.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/memchecker/valgrind/memchecker_valgrind.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/memcpy/base/base.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/memory/base/base.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/paffinity/linux/paffinity_linux.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/paffinity/solaris/paffinity_solaris.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/paffinity/windows/paffinity_windows.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/timer/aix/timer_aix.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/timer/base/base.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/timer/windows/timer_windows_component.h: defined(c_plusplus) defined(__cplusplus) +./opal/mca/timer/windows/timer_windows.h: defined(c_plusplus) defined(__cplusplus) +./opal/memoryhooks/memory.h: defined(c_plusplus) defined(__cplusplus) +./opal/memoryhooks/memory_internal.h: defined(c_plusplus) defined(__cplusplus) +./opal/runtime/opal_cr.h: defined(c_plusplus) defined(__cplusplus) +./opal/runtime/opal_progress.h: defined(c_plusplus) defined(__cplusplus) +./opal/threads/threads.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/cmd_line.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/crc.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/daemon_init.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/error.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/few.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/keyval_parse.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/malloc.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/opal_pty.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/os_path.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/qsort.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/show_help_lex.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/strncpy.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/sys_limits.h: defined(c_plusplus) defined(__cplusplus) +./opal/util/trace.h: defined(c_plusplus) defined(__cplusplus) +./opal/win32/ompi_inet.h: defined(c_plusplus) defined(__cplusplus) +./opal/win32/ompi_utsname.h: defined(c_plusplus) defined(__cplusplus) +./orte/mca/filem/filem.h: defined(c_plusplus) defined(__cplusplus) +./orte/mca/filem/rsh/filem_rsh.h: defined(c_plusplus) defined(__cplusplus) +./orte/mca/plm/ccp/plm_ccp.h: defined(c_plusplus) defined(__cplusplus) +./orte/mca/ras/ccp/ras_ccp.h: defined(c_plusplus) defined(__cplusplus) +./orte/mca/ras/gridengine/ras_gridengine.h: defined(c_plusplus) defined(__cplusplus) +./orte/mca/ras/loadleveler/ras_loadleveler.h: defined(c_plusplus) defined(__cplusplus) +./orte/mca/rmaps/rank_file/rmaps_rank_file_lex.h: defined(c_plusplus) defined(__cplusplus) +./orte/mca/rml/ftrm/rml_ftrm.h: defined(c_plusplus) defined(__cplusplus) +./test/support/components.h: defined(c_plusplus) defined(__cplusplus) +# Following some lex files: +./opal/util/keyval/keyval_lex.l: defined(c_plusplus) defined(__cplusplus) +./opal/util/show_help_lex.l: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/openib/btl_openib_lex.l: defined(c_plusplus) defined(__cplusplus) +./ompi/mca/btl/pcie/btl_pcie_lex.l: defined(c_plusplus) defined(__cplusplus) +./orte/util/hostfile/hostfile_lex.l: defined(c_plusplus) defined(__cplusplus) diff --git a/ompi/class/ompi_free_list.h b/ompi/class/ompi_free_list.h index 2f6d79cca8..9e5229813a 100644 --- a/ompi/class/ompi_free_list.h +++ b/ompi/class/ompi_free_list.h @@ -26,9 +26,7 @@ #include "ompi/constants.h" #include "opal/sys/cache.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_mem_pool_t; struct ompi_free_list_item_t; @@ -306,8 +304,6 @@ static inline int __ompi_free_list_wait( ompi_free_list_t* fl, } \ } while(0) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/class/ompi_rb_tree.h b/ompi/class/ompi_rb_tree.h index 854955ccba..a12b814c27 100644 --- a/ompi/class/ompi_rb_tree.h +++ b/ompi/class/ompi_rb_tree.h @@ -31,9 +31,7 @@ #include "opal/class/opal_object.h" #include "ompi/class/ompi_free_list.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Data structures and datatypes */ @@ -215,8 +213,6 @@ OMPI_DECLSPEC int ompi_rb_tree_traverse(ompi_rb_tree_t *tree, */ OMPI_DECLSPEC int ompi_rb_tree_size(ompi_rb_tree_t *tree); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_RB_TREE_H */ diff --git a/ompi/class/ompi_seq_tracker.h b/ompi/class/ompi_seq_tracker.h index 05bfb775ef..bd638967b5 100644 --- a/ompi/class/ompi_seq_tracker.h +++ b/ompi/class/ompi_seq_tracker.h @@ -23,9 +23,7 @@ #include "opal/class/opal_list.h" #include "ompi/constants.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct ompi_seq_tracker_range_t{ opal_list_item_t super; @@ -67,8 +65,6 @@ OMPI_DECLSPEC void ompi_seq_tracker_insert(ompi_seq_tracker_t* seq_tracker, uint */ OMPI_DECLSPEC void ompi_seq_tracker_copy(ompi_seq_tracker_t* dst, ompi_seq_tracker_t* src); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/debuggers/msgq_interface.h b/ompi/debuggers/msgq_interface.h index be7e91aef3..bb34072b83 100644 --- a/ompi/debuggers/msgq_interface.h +++ b/ompi/debuggers/msgq_interface.h @@ -124,9 +124,7 @@ /* No MPI2 support yet */ #define FOR_MPI2 0 -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_C_DECLS /*********************************************************************** * Version of the interface this header represents @@ -693,7 +691,6 @@ extern int mqs_next_new_process (mqs_process *, mqs_process_location *); extern int mqs_set_process_identity (mqs_process *, int); #endif -#ifdef __cplusplus -} -#endif +END_C_DECLS + #endif /* defined (_MPI_INTERFACE_INCLUDED) */ diff --git a/ompi/group/group.h b/ompi/group/group.h index 90ae57a47b..642fb15bc9 100644 --- a/ompi/group/group.h +++ b/ompi/group/group.h @@ -34,9 +34,7 @@ #include "opal/class/opal_pointer_array.h" #include "opal/util/output.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define BSIZE ((int)sizeof(unsigned char)*8) @@ -346,7 +344,5 @@ int ompi_group_dump (ompi_group_t* group); */ int ompi_group_div_ceil (int num, int den); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_GROUP_H */ diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 26323e52b5..6af27d4c35 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -2016,7 +2016,7 @@ OMPI_DECLSPEC double PMPI_Wtime(void); * - We are using a C++ compiler */ #if !defined(OMPI_SKIP_MPICXX) && OMPI_WANT_CXX_BINDINGS && !OMPI_BUILDING -#if defined(__cplusplus) || defined(c_plusplus) +#if defined(c_plusplus) || defined(__cplusplus) #include "openmpi/ompi/mpi/cxx/mpicxx.h" #endif #endif diff --git a/ompi/mca/allocator/base/base.h b/ompi/mca/allocator/base/base.h index f71d5928a0..9258726526 100644 --- a/ompi/mca/allocator/base/base.h +++ b/ompi/mca/allocator/base/base.h @@ -27,9 +27,7 @@ #include "opal/mca/mca.h" #include "ompi/mca/allocator/allocator.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Structure which describes a selected module. */ @@ -69,8 +67,6 @@ OMPI_DECLSPEC mca_allocator_base_component_t* mca_allocator_component_lookup(con */ OMPI_DECLSPEC extern opal_list_t mca_allocator_base_components; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_ALLOCATOR_BASE_H */ diff --git a/ompi/mca/allocator/basic/allocator_basic.h b/ompi/mca/allocator/basic/allocator_basic.h index 27c190df03..19ce9d9b56 100644 --- a/ompi/mca/allocator/basic/allocator_basic.h +++ b/ompi/mca/allocator/basic/allocator_basic.h @@ -58,9 +58,7 @@ struct mca_allocator_basic_module_t { typedef struct mca_allocator_basic_module_t mca_allocator_basic_module_t; -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Component open/cleanup. @@ -158,9 +156,7 @@ mca_allocator_base_module_t* mca_allocator_basic_component_init( OMPI_DECLSPEC extern mca_allocator_base_component_t mca_allocator_basic_component; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* ALLOCATOR_BUCKET_ALLOC_H */ diff --git a/ompi/mca/allocator/bucket/allocator_bucket_alloc.h b/ompi/mca/allocator/bucket/allocator_bucket_alloc.h index 09bb8e981a..5cdec4f72e 100644 --- a/ompi/mca/allocator/bucket/allocator_bucket_alloc.h +++ b/ompi/mca/allocator/bucket/allocator_bucket_alloc.h @@ -28,9 +28,7 @@ #include #include "opal/threads/mutex.h" #include "ompi/mca/allocator/allocator.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Structure for the header of each memory chunk @@ -215,8 +213,6 @@ typedef struct mca_allocator_bucket_t mca_allocator_bucket_t; OMPI_DECLSPEC extern mca_allocator_base_component_t mca_allocator_bucket_component; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* ALLOCATOR_BUCKET_ALLOC_H */ diff --git a/ompi/mca/bml/base/base.h b/ompi/mca/bml/base/base.h index 00a44c5d77..bd65edceee 100644 --- a/ompi/mca/bml/base/base.h +++ b/ompi/mca/bml/base/base.h @@ -30,9 +30,7 @@ * Global functions for the BML */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_bml_base_selected_module_t { @@ -66,7 +64,5 @@ OMPI_DECLSPEC extern mca_bml_base_component_t mca_bml_component; OMPI_DECLSPEC extern opal_list_t mca_bml_base_components_available; OMPI_DECLSPEC extern mca_bml_base_module_t mca_bml; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_BML_BASE_H */ diff --git a/ompi/mca/bml/base/bml_base_btl.h b/ompi/mca/bml/base/bml_base_btl.h index 0313fae83d..090a37c6b4 100644 --- a/ompi/mca/bml/base/bml_base_btl.h +++ b/ompi/mca/bml/base/bml_base_btl.h @@ -28,9 +28,7 @@ * Global functions for the BML */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* forward declarations */ struct mca_bml_base_btl_array_t; @@ -38,8 +36,6 @@ struct mca_bml_base_btl_array_t; OMPI_DECLSPEC int mca_bml_base_btl_array_reserve(struct mca_bml_base_btl_array_t* array, size_t size); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_BML_BASE_H */ diff --git a/ompi/mca/bml/r2/bml_r2.h b/ompi/mca/bml/r2/bml_r2.h index f22402eef0..135450271e 100644 --- a/ompi/mca/bml/r2/bml_r2.h +++ b/ompi/mca/bml/r2/bml_r2.h @@ -32,9 +32,7 @@ #include "ompi/types.h" #include "ompi/mca/bml/bml.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * BML module interface functions and attributes. @@ -69,8 +67,6 @@ int mca_bml_r2_ft_event(int status); int mca_bml_r2_finalize( void ); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_MCA_BML_R2_H */ diff --git a/ompi/mca/bml/r2/bml_r2_ft.h b/ompi/mca/bml/r2/bml_r2_ft.h index d73d26c8e1..59b3445fcb 100644 --- a/ompi/mca/bml/r2/bml_r2_ft.h +++ b/ompi/mca/bml/r2/bml_r2_ft.h @@ -22,12 +22,8 @@ #define MCA_BML_R2_FT_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/gm/btl_gm.h b/ompi/mca/btl/gm/btl_gm.h index 0b910935f7..cecebe4954 100644 --- a/ompi/mca/btl/gm/btl_gm.h +++ b/ompi/mca/btl/gm/btl_gm.h @@ -36,9 +36,7 @@ #include "ompi/mca/btl/btl.h" #include "btl_gm_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define GM_BUFFER_SIZE 7 #define GM_BUFFER_LENGTH gm_max_length_for_size(GM_BUFFER_SIZE) @@ -375,7 +373,5 @@ do { } while (0) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/gm/btl_gm_endpoint.h b/ompi/mca/btl/gm/btl_gm_endpoint.h index 20100915e8..bf8cf34413 100644 --- a/ompi/mca/btl/gm/btl_gm_endpoint.h +++ b/ompi/mca/btl/gm/btl_gm_endpoint.h @@ -28,9 +28,7 @@ #include #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** @@ -91,7 +89,5 @@ typedef mca_btl_base_endpoint_t mca_btl_gm_endpoint_t; OBJ_CLASS_DECLARATION(mca_btl_gm_endpoint_t); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/gm/btl_gm_frag.h b/ompi/mca/btl/gm/btl_gm_frag.h index 56ff3d5d7f..e357d7f2d9 100644 --- a/ompi/mca/btl/gm/btl_gm_frag.h +++ b/ompi/mca/btl/gm/btl_gm_frag.h @@ -26,9 +26,7 @@ #include "ompi/mca/btl/base/btl_base_error.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS typedef enum { MCA_BTL_GM_EAGER, @@ -137,7 +135,5 @@ do { \ -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/gm/btl_gm_proc.h b/ompi/mca/btl/gm/btl_gm_proc.h index ac23f28346..0d3ec02b36 100644 --- a/ompi/mca/btl/gm/btl_gm_proc.h +++ b/ompi/mca/btl/gm/btl_gm_proc.h @@ -24,9 +24,7 @@ #include "btl_gm.h" #include "btl_gm_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OBJ_CLASS_DECLARATION(mca_btl_gm_proc_t); /** @@ -65,7 +63,5 @@ typedef struct mca_btl_gm_proc_t mca_btl_gm_proc_t; mca_btl_gm_proc_t* mca_btl_gm_proc_create(ompi_proc_t* ompi_proc); int mca_btl_gm_proc_insert(mca_btl_gm_proc_t*, mca_btl_base_endpoint_t*); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/mx/btl_mx_endpoint.h b/ompi/mca/btl/mx/btl_mx_endpoint.h index d8463f2d63..fc2f4896f9 100644 --- a/ompi/mca/btl/mx/btl_mx_endpoint.h +++ b/ompi/mca/btl/mx/btl_mx_endpoint.h @@ -26,9 +26,7 @@ #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define MCA_BTL_MX_NOT_CONNECTED 0x0000 #define MCA_BTL_MX_NOT_REACHEABLE 0x0001 @@ -90,7 +88,5 @@ typedef mca_btl_base_endpoint_t mca_btl_mx_endpoint_t; OBJ_CLASS_DECLARATION(mca_btl_mx_endpoint_t); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/ofud/btl_ofud.h b/ompi/mca/btl/ofud/btl_ofud.h index 2d4d0203c4..09f05f5f65 100644 --- a/ompi/mca/btl/ofud/btl_ofud.h +++ b/ompi/mca/btl/ofud/btl_ofud.h @@ -44,9 +44,7 @@ /* TODO - If I want this to go away, addr_t has to come over here */ #include "btl_ofud_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** @@ -359,7 +357,5 @@ do { \ #define MCA_BTL_UD_SHOW_TIME(var) #endif -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/ofud/btl_ofud_endpoint.h b/ompi/mca/btl/ofud/btl_ofud_endpoint.h index f0698849d7..10c9fa4273 100644 --- a/ompi/mca/btl/ofud/btl_ofud_endpoint.h +++ b/ompi/mca/btl/ofud/btl_ofud_endpoint.h @@ -29,9 +29,7 @@ #include "btl_ofud.h" #include "btl_ofud_frag.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_btl_ud_addr_t { uint32_t qp_num; @@ -68,7 +66,5 @@ OBJ_CLASS_DECLARATION(mca_btl_ud_endpoint_t); int mca_btl_ud_endpoint_post_send(struct mca_btl_ud_module_t* ud_btl, struct mca_btl_ud_frag_t * frag); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/ofud/btl_ofud_frag.h b/ompi/mca/btl/ofud/btl_ofud_frag.h index 3fb76e6f24..3d6fd1b8a7 100644 --- a/ompi/mca/btl/ofud/btl_ofud_frag.h +++ b/ompi/mca/btl/ofud/btl_ofud_frag.h @@ -30,9 +30,7 @@ #include "btl_ofud.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** @@ -142,7 +140,5 @@ OBJ_CLASS_DECLARATION(mca_btl_ud_recv_frag_t); struct mca_btl_ud_module_t; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/ofud/btl_ofud_proc.h b/ompi/mca/btl/ofud/btl_ofud_proc.h index ea4b5f448d..f667f8b49f 100644 --- a/ompi/mca/btl/ofud/btl_ofud_proc.h +++ b/ompi/mca/btl/ofud/btl_ofud_proc.h @@ -27,9 +27,7 @@ #include "btl_ofud.h" #include "btl_ofud_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Represents the state of a remote process and the set of addresses @@ -72,7 +70,5 @@ int mca_btl_ud_proc_insert(mca_btl_ud_proc_t*, mca_btl_base_endpoint_t*); int mca_btl_ud_proc_remove(mca_btl_ud_proc_t*, mca_btl_base_endpoint_t*); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/openib/btl_openib.h b/ompi/mca/btl/openib/btl_openib.h index de05938172..47807f62fd 100644 --- a/ompi/mca/btl/openib/btl_openib.h +++ b/ompi/mca/btl/openib/btl_openib.h @@ -648,9 +648,6 @@ static inline int qp_cq_prio(const int qp) #define BTL_OPENIB_RDMA_QP(QP) \ ((QP) == mca_btl_openib_component.rdma_qp) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif END_C_DECLS #endif /* MCA_BTL_IB_H */ diff --git a/ompi/mca/btl/openib/btl_openib_eager_rdma.h b/ompi/mca/btl/openib/btl_openib_eager_rdma.h index 9ede4a5897..b108573a85 100644 --- a/ompi/mca/btl/openib/btl_openib_eager_rdma.h +++ b/ompi/mca/btl/openib/btl_openib_eager_rdma.h @@ -13,9 +13,7 @@ #include "ompi_config.h" #include "btl_openib.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_btl_openib_eager_rdma_local_t { ompi_ptr_t base; /**< buffer for RDMAing eager messages */ @@ -95,8 +93,6 @@ typedef struct mca_btl_openib_eager_rdma_remote_t mca_btl_openib_eager_rdma_remo } while(0) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/openib/btl_openib_frag.h b/ompi/mca/btl/openib/btl_openib_frag.h index 817ad87ea4..eb3f820a0e 100644 --- a/ompi/mca/btl/openib/btl_openib_frag.h +++ b/ompi/mca/btl/openib/btl_openib_frag.h @@ -28,9 +28,7 @@ #include #include "ompi/mca/btl/btl.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_btl_openib_reg_t; @@ -347,7 +345,5 @@ typedef struct mca_btl_openib_frag_init_data_t mca_btl_openib_frag_init_data_t; void mca_btl_openib_frag_init(ompi_free_list_item_t* item, void* ctx); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/openib/btl_openib_lex.h b/ompi/mca/btl/openib/btl_openib_lex.h index 464475fdce..9208a40d15 100644 --- a/ompi/mca/btl/openib/btl_openib_lex.h +++ b/ompi/mca/btl/openib/btl_openib_lex.h @@ -35,9 +35,7 @@ #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS int btl_openib_ini_yylex(void); int btl_openib_ini_init_buffer(FILE *file); @@ -70,8 +68,6 @@ enum { BTL_OPENIB_INI_PARSE_MAX }; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/openib/btl_openib_lex.l b/ompi/mca/btl/openib/btl_openib_lex.l index 21a9d8dc91..e50db26016 100644 --- a/ompi/mca/btl/openib/btl_openib_lex.l +++ b/ompi/mca/btl/openib/btl_openib_lex.l @@ -27,9 +27,7 @@ #include "btl_openib_lex.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * local functions @@ -37,9 +35,7 @@ extern "C" { static int finish_parsing(void) ; static int btl_openib_ini_yywrap(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS /* * global variables diff --git a/ompi/mca/btl/openib/btl_openib_mca.h b/ompi/mca/btl/openib/btl_openib_mca.h index 0751c5abb9..789284cbd9 100644 --- a/ompi/mca/btl/openib/btl_openib_mca.h +++ b/ompi/mca/btl/openib/btl_openib_mca.h @@ -10,16 +10,12 @@ #ifndef MCA_BTL_IB_MCA_H #define MCA_BTL_IB_MCA_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Function to register MCA params and check for sane values */ int btl_openib_register_mca_params(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/pcie/btl_pcie_lex.l b/ompi/mca/btl/pcie/btl_pcie_lex.l index 1d64b217b0..1c55de507d 100644 --- a/ompi/mca/btl/pcie/btl_pcie_lex.l +++ b/ompi/mca/btl/pcie/btl_pcie_lex.l @@ -30,9 +30,13 @@ /* * local functions */ +BEGIN_C_DECLS + static int finish_parsing(void) ; static int btl_pcie_cfg_yywrap(void); +END_C_DECLS + /* * global variables */ diff --git a/ompi/mca/btl/portals/btl_portals_endpoint.h b/ompi/mca/btl/portals/btl_portals_endpoint.h index e3c7a89d9f..370fdc63f3 100644 --- a/ompi/mca/btl/portals/btl_portals_endpoint.h +++ b/ompi/mca/btl/portals/btl_portals_endpoint.h @@ -21,9 +21,7 @@ #include "btl_portals.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * An abstraction that represents a connection to a endpoint process. @@ -34,8 +32,6 @@ extern "C" { typedef ptl_process_id_t mca_btl_base_endpoint_t; typedef mca_btl_base_endpoint_t mca_btl_portals_endpoint_t; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_BTL_PORTALS_ENDPOINT_H */ diff --git a/ompi/mca/btl/portals/btl_portals_frag.h b/ompi/mca/btl/portals/btl_portals_frag.h index 00b6c72abf..8461046e94 100644 --- a/ompi/mca/btl/portals/btl_portals_frag.h +++ b/ompi/mca/btl/portals/btl_portals_frag.h @@ -19,9 +19,7 @@ #ifndef OMPI_BTL_PORTALS_FRAG_H #define OMPI_BTL_PORTALS_FRAG_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Portals send fragment derived type @@ -116,7 +114,5 @@ OBJ_CLASS_DECLARATION(mca_btl_portals_frag_recv_t); } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/sctp/btl_sctp.h b/ompi/mca/btl/sctp/btl_sctp.h index a2586e4ba0..cf5458a426 100644 --- a/ompi/mca/btl/sctp/btl_sctp.h +++ b/ompi/mca/btl/sctp/btl_sctp.h @@ -54,9 +54,7 @@ #endif #define MCA_BTL_SCTP_STATISTICS 0 -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** @@ -326,7 +324,5 @@ extern mca_btl_base_descriptor_t* mca_btl_sctp_prepare_dst( uint32_t flags); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/sctp/btl_sctp_endpoint.h b/ompi/mca/btl/sctp/btl_sctp_endpoint.h index 0d9cc1cca0..ee250836cc 100644 --- a/ompi/mca/btl/sctp/btl_sctp_endpoint.h +++ b/ompi/mca/btl/sctp/btl_sctp_endpoint.h @@ -23,9 +23,7 @@ #include "opal/event/event.h" #include "btl_sctp_frag.h" #include "btl_sctp.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define MCA_BTL_SCTP_ENDPOINT_CACHE 1 @@ -92,7 +90,5 @@ int mca_btl_sctp_endpoint_send(mca_btl_base_endpoint_t*, struct mca_btl_sctp_fr bool mca_btl_sctp_endpoint_accept(mca_btl_base_endpoint_t*, struct sockaddr_in*, int); void mca_btl_sctp_endpoint_shutdown(mca_btl_base_endpoint_t*); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/sctp/btl_sctp_frag.h b/ompi/mca/btl/sctp/btl_sctp_frag.h index 5e331c8b20..d0c81751e7 100644 --- a/ompi/mca/btl/sctp/btl_sctp_frag.h +++ b/ompi/mca/btl/sctp/btl_sctp_frag.h @@ -33,9 +33,7 @@ #include "btl_sctp.h" #include "btl_sctp_hdr.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define MCA_BTL_SCTP_FRAG_IOVEC_NUMBER 4 @@ -131,7 +129,5 @@ bool mca_btl_sctp_frag_send(mca_btl_sctp_frag_t*, int sd); bool mca_btl_sctp_frag_recv(mca_btl_sctp_frag_t*, int sd, char *buf, int len); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/sctp/btl_sctp_hdr.h b/ompi/mca/btl/sctp/btl_sctp_hdr.h index 961d27959d..fbd438c04f 100644 --- a/ompi/mca/btl/sctp/btl_sctp_hdr.h +++ b/ompi/mca/btl/sctp/btl_sctp_hdr.h @@ -25,9 +25,7 @@ #include "btl_sctp.h" #include "opal/types.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * SCTP header. @@ -62,7 +60,5 @@ typedef struct mca_btl_sctp_hdr_t mca_btl_sctp_hdr_t; hdr.size = ntoh64(hdr.size); \ } while (0) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/sctp/btl_sctp_proc.h b/ompi/mca/btl/sctp/btl_sctp_proc.h index 79d4dc0fa6..613f02e10e 100644 --- a/ompi/mca/btl/sctp/btl_sctp_proc.h +++ b/ompi/mca/btl/sctp/btl_sctp_proc.h @@ -26,9 +26,7 @@ #include "btl_sctp_endpoint.h" #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Represents the state of a remote process and the set of addresses @@ -109,7 +107,5 @@ void mca_btl_sctp_proc_add_vpid(orte_vpid_t vpid, struct mca_btl_sctp_proc_t *pr void mca_btl_sctp_proc_add_assoc_id(sctp_assoc_t id, struct mca_btl_sctp_proc_t *proc, struct mca_btl_sctp_proc_table_node *table); mca_btl_sctp_proc_t *mca_btl_sctp_proc_get(sctp_assoc_t id, struct mca_btl_sctp_proc_table_node *table); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/self/btl_self.h b/ompi/mca/btl/self/btl_self.h index 84bcaaa17d..6e3c6d3583 100644 --- a/ompi/mca/btl/self/btl_self.h +++ b/ompi/mca/btl/self/btl_self.h @@ -34,9 +34,7 @@ #include "ompi/mca/btl/btl.h" #include "ompi/mca/btl/base/base.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Shared Memory (SELF) BTL module. @@ -225,9 +223,7 @@ int mca_btl_self_rdma( */ int mca_btl_self_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/sm/btl_sm.h b/ompi/mca/btl/sm/btl_sm.h index eb43d1f0be..15eb0aeb73 100644 --- a/ompi/mca/btl/sm/btl_sm.h +++ b/ompi/mca/btl/sm/btl_sm.h @@ -47,9 +47,7 @@ #include "ompi/mca/mpool/mpool.h" #include "ompi/mca/common/sm/common_sm_mmap.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Shared Memory FIFOs @@ -488,9 +486,7 @@ void mca_btl_sm_component_event_thread(opal_object_t*); #define MCA_BTL_SM_SIGNAL_PEER(peer) #endif -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/tcp/btl_tcp.h b/ompi/mca/btl/tcp/btl_tcp.h index 5eca3a10ea..01320fe5a1 100644 --- a/ompi/mca/btl/tcp/btl_tcp.h +++ b/ompi/mca/btl/tcp/btl_tcp.h @@ -43,9 +43,7 @@ #include "opal/class/opal_hash_table.h" #define MCA_BTL_TCP_STATISTICS 0 -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** @@ -335,7 +333,5 @@ extern mca_btl_base_descriptor_t* mca_btl_tcp_prepare_dst( */ int mca_btl_tcp_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/tcp/btl_tcp_endpoint.h b/ompi/mca/btl/tcp/btl_tcp_endpoint.h index 59a0eb4292..58d831b711 100644 --- a/ompi/mca/btl/tcp/btl_tcp_endpoint.h +++ b/ompi/mca/btl/tcp/btl_tcp_endpoint.h @@ -23,9 +23,7 @@ #include "opal/event/event.h" #include "btl_tcp_frag.h" #include "btl_tcp.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define MCA_BTL_TCP_ENDPOINT_CACHE 1 @@ -81,7 +79,5 @@ int mca_btl_tcp_endpoint_send(mca_btl_base_endpoint_t*, struct mca_btl_tcp_frag bool mca_btl_tcp_endpoint_accept(mca_btl_base_endpoint_t*, struct sockaddr*, int); void mca_btl_tcp_endpoint_shutdown(mca_btl_base_endpoint_t*); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/tcp/btl_tcp_frag.h b/ompi/mca/btl/tcp/btl_tcp_frag.h index ded6b459e5..615bcf1bcf 100644 --- a/ompi/mca/btl/tcp/btl_tcp_frag.h +++ b/ompi/mca/btl/tcp/btl_tcp_frag.h @@ -36,9 +36,7 @@ #include "btl_tcp.h" #include "btl_tcp_hdr.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define MCA_BTL_TCP_FRAG_IOVEC_NUMBER 4 @@ -127,7 +125,5 @@ bool mca_btl_tcp_frag_send(mca_btl_tcp_frag_t*, int sd); bool mca_btl_tcp_frag_recv(mca_btl_tcp_frag_t*, int sd); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/tcp/btl_tcp_ft.h b/ompi/mca/btl/tcp/btl_tcp_ft.h index cc5262066a..bbca866e73 100644 --- a/ompi/mca/btl/tcp/btl_tcp_ft.h +++ b/ompi/mca/btl/tcp/btl_tcp_ft.h @@ -25,14 +25,10 @@ #include #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/tcp/btl_tcp_proc.h b/ompi/mca/btl/tcp/btl_tcp_proc.h index 47f6afbbd1..25238df415 100644 --- a/ompi/mca/btl/tcp/btl_tcp_proc.h +++ b/ompi/mca/btl/tcp/btl_tcp_proc.h @@ -26,9 +26,7 @@ #include "btl_tcp_addr.h" #include "btl_tcp_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Represents the state of a remote process and the set of addresses @@ -121,7 +119,5 @@ static inline mca_btl_tcp_proc_t* mca_btl_tcp_proc_local(void) return mca_btl_tcp_component.tcp_local; } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/template/btl_template.h b/ompi/mca/btl/template/btl_template.h index 758de4a5fd..b3e4768531 100644 --- a/ompi/mca/btl/template/btl_template.h +++ b/ompi/mca/btl/template/btl_template.h @@ -33,9 +33,7 @@ #include "ompi/mca/mpool/mpool.h" #include "ompi/mca/btl/btl.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define MCA_BTL_HAS_MPOOL 1 @@ -313,7 +311,5 @@ extern mca_btl_base_descriptor_t* mca_btl_template_prepare_dst( */ int mca_btl_template_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/template/btl_template_endpoint.h b/ompi/mca/btl/template/btl_template_endpoint.h index 04cb0d42f6..94fb11395b 100644 --- a/ompi/mca/btl/template/btl_template_endpoint.h +++ b/ompi/mca/btl/template/btl_template_endpoint.h @@ -23,9 +23,7 @@ #include "opal/event/event.h" #include "btl_template_frag.h" #include "btl_template.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * An abstraction that represents a connection to a endpoint process. @@ -48,7 +46,5 @@ typedef struct mca_btl_base_endpoint_t mca_btl_base_endpoint_t; typedef mca_btl_base_endpoint_t mca_btl_template_endpoint_t; OBJ_CLASS_DECLARATION(mca_btl_template_endpoint_t); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/template/btl_template_frag.h b/ompi/mca/btl/template/btl_template_frag.h index ec8f5da418..701d765de7 100644 --- a/ompi/mca/btl/template/btl_template_frag.h +++ b/ompi/mca/btl/template/btl_template_frag.h @@ -24,9 +24,7 @@ #include "ompi_config.h" #include "btl_template.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * TEMPLATE send fratemplateent derived type. @@ -106,7 +104,5 @@ OBJ_CLASS_DECLARATION(mca_btl_template_frag_user_t); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/template/btl_template_proc.h b/ompi/mca/btl/template/btl_template_proc.h index 85d162a969..c93dc2441a 100644 --- a/ompi/mca/btl/template/btl_template_proc.h +++ b/ompi/mca/btl/template/btl_template_proc.h @@ -24,9 +24,7 @@ #include "btl_template.h" #include "btl_template_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Represents the state of a remote process and the set of addresses @@ -62,7 +60,5 @@ OBJ_CLASS_DECLARATION(mca_btl_template_proc_t); mca_btl_template_proc_t* mca_btl_template_proc_create(ompi_proc_t* ompi_proc); int mca_btl_template_proc_insert(mca_btl_template_proc_t*, mca_btl_base_endpoint_t*); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/udapl/btl_udapl.h b/ompi/mca/btl/udapl/btl_udapl.h index c8d8788fa9..aa8ac9935b 100644 --- a/ompi/mca/btl/udapl/btl_udapl.h +++ b/ompi/mca/btl/udapl/btl_udapl.h @@ -42,9 +42,7 @@ #include "ompi/mca/btl/btl.h" #include "btl_udapl_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** @@ -467,7 +465,5 @@ extern mca_btl_base_descriptor_t* mca_btl_udapl_prepare_dst( */ int mca_btl_udapl_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/udapl/btl_udapl_eager_rdma.h b/ompi/mca/btl/udapl/btl_udapl_eager_rdma.h index d8e29d9070..f32bc2d68e 100644 --- a/ompi/mca/btl/udapl/btl_udapl_eager_rdma.h +++ b/ompi/mca/btl/udapl/btl_udapl_eager_rdma.h @@ -15,9 +15,7 @@ #include "ompi/mca/btl/udapl/btl_udapl_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Describe endpoint local memory region. @@ -103,7 +101,5 @@ typedef struct mca_btl_udapl_eager_rdma_credit_t mca_btl_udapl_eager_rdma_credit (I) = 0; \ } while (0) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/udapl/btl_udapl_endpoint.h b/ompi/mca/btl/udapl/btl_udapl_endpoint.h index 84e263e3e1..9f18d66a5f 100644 --- a/ompi/mca/btl/udapl/btl_udapl_endpoint.h +++ b/ompi/mca/btl/udapl/btl_udapl_endpoint.h @@ -30,9 +30,7 @@ #include "btl_udapl.h" #include "btl_udapl_eager_rdma.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define BTL_UDAPL_TOKEN_AVAIL(E, C, T) \ @@ -216,7 +214,5 @@ mca_btl_udapl_endpoint_t* mca_btl_udapl_find_endpoint_address_match( struct mca_btl_udapl_module_t* btl, mca_btl_udapl_addr_t addr); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/udapl/btl_udapl_frag.h b/ompi/mca/btl/udapl/btl_udapl_frag.h index b118152f76..3b7c689897 100644 --- a/ompi/mca/btl/udapl/btl_udapl_frag.h +++ b/ompi/mca/btl/udapl/btl_udapl_frag.h @@ -27,9 +27,7 @@ #define MCA_BTL_UDAPL_FRAG_ALIGN (8) #include "ompi_config.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS typedef enum { MCA_BTL_UDAPL_SEND, @@ -195,7 +193,5 @@ OBJ_CLASS_DECLARATION(mca_btl_udapl_frag_eager_rdma_t); 0 : (MCA_BTL_UDAPL_FRAG_ALIGN - ((S) % MCA_BTL_UDAPL_FRAG_ALIGN)); \ } while (0); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/udapl/btl_udapl_mca.h b/ompi/mca/btl/udapl/btl_udapl_mca.h index ac79ada596..d978a563fa 100644 --- a/ompi/mca/btl/udapl/btl_udapl_mca.h +++ b/ompi/mca/btl/udapl/btl_udapl_mca.h @@ -11,9 +11,7 @@ #ifndef MCA_BTL_UDAPL_MCA_H #define MCA_BTL_UDAPL_MCA_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* Define Integer Boundaries */ #define REGINT_NEG_ONE_OK 0x01 /* value = -1 is valid */ @@ -61,7 +59,5 @@ extern "C" { int mca_btl_udapl_register_mca_params(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/btl/udapl/btl_udapl_proc.h b/ompi/mca/btl/udapl/btl_udapl_proc.h index 1dd97f7635..9651da8858 100644 --- a/ompi/mca/btl/udapl/btl_udapl_proc.h +++ b/ompi/mca/btl/udapl/btl_udapl_proc.h @@ -25,9 +25,7 @@ #include "btl_udapl.h" #include "btl_udapl_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Represents the state of a remote process and the set of addresses @@ -68,7 +66,5 @@ OBJ_CLASS_DECLARATION(mca_btl_udapl_proc_t); mca_btl_udapl_proc_t* mca_btl_udapl_proc_create(ompi_proc_t* ompi_proc); int mca_btl_udapl_proc_insert(mca_btl_udapl_proc_t*, mca_btl_base_endpoint_t*); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/coll/tuned/coll_tuned_dynamic_file.h b/ompi/mca/coll/tuned/coll_tuned_dynamic_file.h index 22ecf07527..597321c325 100644 --- a/ompi/mca/coll/tuned/coll_tuned_dynamic_file.h +++ b/ompi/mca/coll/tuned/coll_tuned_dynamic_file.h @@ -25,16 +25,12 @@ #include "coll_tuned_dynamic_rules.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t** rules, int n_collectives); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_COLL_TUNED_DYNAMIC_FILE_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/coll/tuned/coll_tuned_dynamic_rules.h b/ompi/mca/coll/tuned/coll_tuned_dynamic_rules.h index 207c288a7a..bd4a422419 100644 --- a/ompi/mca/coll/tuned/coll_tuned_dynamic_rules.h +++ b/ompi/mca/coll/tuned/coll_tuned_dynamic_rules.h @@ -22,9 +22,7 @@ #include "ompi_config.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS typedef struct msg_rule_s { @@ -100,8 +98,6 @@ int ompi_coll_tuned_get_target_method_params (ompi_coll_com_rule_t* base_com_rul int* max_requests); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_COLL_TUNED_DYNAMIC_RULES_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/coll/tuned/coll_tuned_topo.h b/ompi/mca/coll/tuned/coll_tuned_topo.h index 33e1ef0e01..ae93e2a677 100644 --- a/ompi/mca/coll/tuned/coll_tuned_topo.h +++ b/ompi/mca/coll/tuned/coll_tuned_topo.h @@ -23,9 +23,7 @@ #define MAXTREEFANOUT 32 -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS typedef struct ompi_coll_tree_t { int32_t tree_root; @@ -59,9 +57,7 @@ extern "C" { /* debugging stuff, will be removed later */ int ompi_coll_tuned_topo_dump_tree (ompi_coll_tree_t* tree, int rank); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/coll/tuned/coll_tuned_util.h b/ompi/mca/coll/tuned/coll_tuned_util.h index 441fb436d7..c11d1446c4 100644 --- a/ompi/mca/coll/tuned/coll_tuned_util.h +++ b/ompi/mca/coll/tuned/coll_tuned_util.h @@ -27,9 +27,7 @@ #include "ompi/request/request.h" #include "ompi/mca/pml/pml.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* prototypes */ int ompi_coll_tuned_sendrecv_actual( void* sendbuf, int scount, @@ -121,9 +119,7 @@ ompi_coll_tuned_isendrecv( void* sendbuf, int scount, ompi_datatype_t* sdtype, return ret; } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_COLL_TUNED_UTIL_EXPORT_H */ diff --git a/ompi/mca/common/sm/common_sm_mmap.h b/ompi/mca/common/sm/common_sm_mmap.h index cf566fa4ad..417f879a1c 100644 --- a/ompi/mca/common/sm/common_sm_mmap.h +++ b/ompi/mca/common/sm/common_sm_mmap.h @@ -26,9 +26,7 @@ #include "opal/sys/atomic.h" #include "ompi/mca/mpool/mpool.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_mpool_base_module_t; @@ -124,9 +122,7 @@ int mca_common_sm_mmap_fini( mca_common_sm_mmap_t* sm_mmap ); OMPI_DECLSPEC extern mca_common_sm_mmap_t *mca_common_sm_mmap; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/crcp/base/base.h b/ompi/mca/crcp/base/base.h index 0781bac858..dc6c0bd83b 100644 --- a/ompi/mca/crcp/base/base.h +++ b/ompi/mca/crcp/base/base.h @@ -28,9 +28,7 @@ * Global functions for MCA overall CRCP */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Initialize the CRCP MCA framework @@ -207,8 +205,6 @@ extern "C" { OMPI_DECLSPEC extern ompi_crcp_base_component_t ompi_crcp_base_selected_component; OMPI_DECLSPEC extern ompi_crcp_base_module_t ompi_crcp; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_CRCP_BASE_H */ diff --git a/ompi/mca/crcp/bkmrk/crcp_bkmrk.h b/ompi/mca/crcp/bkmrk/crcp_bkmrk.h index b4845b26c1..ac6eb48562 100644 --- a/ompi/mca/crcp/bkmrk/crcp_bkmrk.h +++ b/ompi/mca/crcp/bkmrk/crcp_bkmrk.h @@ -31,9 +31,7 @@ #include MCA_timer_IMPLEMENTATION_HEADER -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Local Component structures @@ -59,8 +57,6 @@ extern "C" { int ompi_crcp_bkmrk_pml_init(void); int ompi_crcp_bkmrk_pml_finalize(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_CRCP_HOKE_EXPORT_H */ diff --git a/ompi/mca/crcp/bkmrk/crcp_bkmrk_btl.h b/ompi/mca/crcp/bkmrk/crcp_bkmrk_btl.h index 8da473b493..cc126cc7c8 100644 --- a/ompi/mca/crcp/bkmrk/crcp_bkmrk_btl.h +++ b/ompi/mca/crcp/bkmrk/crcp_bkmrk_btl.h @@ -31,9 +31,7 @@ #include "ompi/mca/crcp/crcp.h" #include "ompi/mca/crcp/bkmrk/crcp_bkmrk.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * BTL Coordination functions @@ -121,8 +119,6 @@ extern "C" { (int state, ompi_crcp_base_btl_state_t*); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_CRCP_HOKE_BTL_EXPORT_H */ diff --git a/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.h b/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.h index b477ace49e..8e4a5fd8af 100644 --- a/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.h +++ b/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.h @@ -32,9 +32,7 @@ #include "ompi/mca/crcp/bkmrk/crcp_bkmrk.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * PML Coordination functions @@ -444,8 +442,6 @@ extern "C" { */ extern opal_list_t ompi_crcp_bkmrk_pml_peer_refs; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_CRCP_HOKE_PML_EXPORT_H */ diff --git a/ompi/mca/crcp/crcp.h b/ompi/mca/crcp/crcp.h index d4d2ea7202..6a65e699e7 100644 --- a/ompi/mca/crcp/crcp.h +++ b/ompi/mca/crcp/crcp.h @@ -45,9 +45,7 @@ #include "ompi/mca/btl/btl.h" #include "ompi/mca/btl/base/base.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Module initialization function. @@ -360,8 +358,6 @@ OMPI_DECLSPEC extern ompi_crcp_base_module_t ompi_crcp; #define OMPI_CRCP_REQUEST_COMPLETE(req) ; #endif -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_CRCP_H */ diff --git a/ompi/mca/io/base/base.h b/ompi/mca/io/base/base.h index d96a7b6094..21f7ab29a7 100644 --- a/ompi/mca/io/base/base.h +++ b/ompi/mca/io/base/base.h @@ -38,9 +38,7 @@ * Global functions for MCA overall io open and close */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Initialize the io MCA framework * @@ -321,7 +319,5 @@ OMPI_DECLSPEC extern bool mca_io_base_requests_valid; */ OMPI_DECLSPEC extern ompi_free_list_t mca_io_base_requests; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_BASE_IO_H */ diff --git a/ompi/mca/io/base/io_base_request.h b/ompi/mca/io/base/io_base_request.h index 01fb871843..08267e7ef1 100644 --- a/ompi/mca/io/base/io_base_request.h +++ b/ompi/mca/io/base/io_base_request.h @@ -53,9 +53,7 @@ struct mca_io_base_request_t { */ typedef struct mca_io_base_request_t mca_io_base_request_t; -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Declare the class */ @@ -159,8 +157,6 @@ extern "C" { return 0; } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/io/romio/src/io_romio.h b/ompi/mca/io/romio/src/io_romio.h index 9fff2d0592..0be837371a 100644 --- a/ompi/mca/io/romio/src/io_romio.h +++ b/ompi/mca/io/romio/src/io_romio.h @@ -30,9 +30,7 @@ #include "romio/include/mpio.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OMPI_DECLSPEC extern mca_io_base_component_2_0_0_t mca_io_romio_component; @@ -299,7 +297,5 @@ int mca_io_romio_file_sync (struct ompi_file_t *fh); /* End Prototypes */ -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_IO_ROMIO_H */ diff --git a/ompi/mca/mpool/base/mpool_base_mem_cb.h b/ompi/mca/mpool/base/mpool_base_mem_cb.h index 3ec51c037b..4b94b2d158 100644 --- a/ompi/mca/mpool/base/mpool_base_mem_cb.h +++ b/ompi/mca/mpool/base/mpool_base_mem_cb.h @@ -26,9 +26,7 @@ #include "opal/mca/mca.h" #include "opal/memoryhooks/memory.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * memory hook callback, called when memory is free'd out from under us @@ -36,9 +34,7 @@ extern "C" { void mca_mpool_base_mem_cb(void* base, size_t size, void* cbdata, bool from_alloc); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_MPOOL_BASE_MEM_CB_H */ diff --git a/ompi/mca/mpool/fake/mpool_fake.h b/ompi/mca/mpool/fake/mpool_fake.h index c53cad6774..313ca55741 100644 --- a/ompi/mca/mpool/fake/mpool_fake.h +++ b/ompi/mca/mpool/fake/mpool_fake.h @@ -27,9 +27,7 @@ #include "ompi_config.h" #include "ompi/mca/mpool/mpool.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS typedef struct mca_mpool_fake_component_t { mca_mpool_base_component_t super; @@ -69,7 +67,5 @@ void mca_mpool_fake_finalize(struct mca_mpool_base_module_t *mpool); */ int mca_mpool_fake_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/mpool/rdma/mpool_rdma.h b/ompi/mca/mpool/rdma/mpool_rdma.h index 28f1bf6d85..7e1718d11f 100644 --- a/ompi/mca/mpool/rdma/mpool_rdma.h +++ b/ompi/mca/mpool/rdma/mpool_rdma.h @@ -29,9 +29,7 @@ #include "opal/event/event.h" #include "ompi/mca/mpool/mpool.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_mpool_rdma_component_t { mca_mpool_base_component_t super; @@ -131,7 +129,5 @@ void mca_mpool_rdma_finalize(struct mca_mpool_base_module_t *mpool); */ int mca_mpool_rdma_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/mpool/sm/mpool_sm.h b/ompi/mca/mpool/sm/mpool_sm.h index b25ee8344c..6a6c060d05 100644 --- a/ompi/mca/mpool/sm/mpool_sm.h +++ b/ompi/mca/mpool/sm/mpool_sm.h @@ -27,9 +27,7 @@ #include "ompi/mca/mpool/mpool.h" #include "ompi/mca/allocator/allocator.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_mpool_sm_component_t { mca_mpool_base_component_t super; @@ -100,8 +98,6 @@ void mca_mpool_sm_free( */ int mca_mpool_sm_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/mtl/base/base.h b/ompi/mca/mtl/base/base.h index efe2eb9b89..c2b7e461fc 100644 --- a/ompi/mca/mtl/base/base.h +++ b/ompi/mca/mtl/base/base.h @@ -29,9 +29,7 @@ * Global functions for the MTL */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OMPI_DECLSPEC extern mca_mtl_base_component_t* ompi_mtl_base_selected_component; @@ -44,7 +42,5 @@ OMPI_DECLSPEC int ompi_mtl_base_close(void); OMPI_DECLSPEC extern opal_list_t ompi_mtl_base_components_opened; OMPI_DECLSPEC extern int ompi_mtl_base_output; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_MTL_BASE_H */ diff --git a/ompi/mca/mtl/mtl.h b/ompi/mca/mtl/mtl.h index 0a78dd1501..8c5c0d9be0 100644 --- a/ompi/mca/mtl/mtl.h +++ b/ompi/mca/mtl/mtl.h @@ -38,9 +38,7 @@ #include "ompi/mca/pml/pml.h" /* for send_mode enum */ #include "ompi/request/request.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct ompi_request_t; struct opal_convertor_t; @@ -405,7 +403,5 @@ typedef struct mca_mtl_base_module_t mca_mtl_base_module_t; OMPI_DECLSPEC extern mca_mtl_base_module_t *ompi_mtl; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/mtl/mx/mtl_mx.h b/ompi/mca/mtl/mx/mtl_mx.h index 6dc47f8899..3a69464c25 100644 --- a/ompi/mca/mtl/mx/mtl_mx.h +++ b/ompi/mca/mtl/mx/mtl_mx.h @@ -24,9 +24,7 @@ #include "opal/datatype/opal_convertor.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS int ompi_mtl_mx_send(struct mca_mtl_base_module_t* mtl, @@ -70,9 +68,7 @@ int ompi_mtl_mx_module_init(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MTL_MX_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/mtl/mx/mtl_mx_endpoint.h b/ompi/mca/mtl/mx/mtl_mx_endpoint.h index 04e030b917..ad9d007770 100644 --- a/ompi/mca/mtl/mx/mtl_mx_endpoint.h +++ b/ompi/mca/mtl/mx/mtl_mx_endpoint.h @@ -27,9 +27,7 @@ #include "myriexpress.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OBJ_CLASS_DECLARATION(mca_mtl_mx_endpoint_t); @@ -70,7 +68,5 @@ OBJ_CLASS_DECLARATION(mca_mtl_mx_endpoint); mca_mtl_mx_endpoint_t* mca_mtl_mx_endpoint_create(ompi_proc_t*); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/mtl/mx/mtl_mx_types.h b/ompi/mca/mtl/mx/mtl_mx_types.h index 6f3537e1b1..057f469a11 100644 --- a/ompi/mca/mtl/mx/mtl_mx_types.h +++ b/ompi/mca/mtl/mx/mtl_mx_types.h @@ -29,9 +29,7 @@ #include "myriexpress.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * MTL Module Interface @@ -121,9 +119,7 @@ OMPI_MODULE_DECLSPEC extern mca_mtl_mx_component_t mca_mtl_mx_component; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MTL_MX_TYPES_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/mtl/portals/mtl_portals.h b/ompi/mca/mtl/portals/mtl_portals.h index b2c27036bf..f6f7c913d5 100644 --- a/ompi/mca/mtl/portals/mtl_portals.h +++ b/ompi/mca/mtl/portals/mtl_portals.h @@ -29,9 +29,7 @@ #include "ompi/mca/common/portals/common_portals.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_mtl_portals_module_t { mca_mtl_base_module_t base; @@ -227,8 +225,6 @@ extern int ompi_mtl_portals_cancel(struct mca_mtl_base_module_t* mtl, extern int ompi_mtl_portals_progress(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MTL_PORTALS_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/mtl/psm/mtl_psm.h b/ompi/mca/mtl/psm/mtl_psm.h index cd699b326a..c6567ed5c4 100644 --- a/ompi/mca/mtl/psm/mtl_psm.h +++ b/ompi/mca/mtl/psm/mtl_psm.h @@ -27,9 +27,7 @@ #include #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* MTL interface functions */ @@ -85,9 +83,7 @@ int ompi_mtl_psm_module_init(int local_rank, int num_local_procs); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MTL_PSM_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/mtl/psm/mtl_psm_endpoint.h b/ompi/mca/mtl/psm/mtl_psm_endpoint.h index 8525242454..e7c175602a 100644 --- a/ompi/mca/mtl/psm/mtl_psm_endpoint.h +++ b/ompi/mca/mtl/psm/mtl_psm_endpoint.h @@ -27,9 +27,7 @@ #include "psm.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OBJ_CLASS_DECLARATION(mca_mtl_psm_endpoint_t); @@ -57,7 +55,5 @@ typedef struct mca_mtl_base_endpoint_t mca_mtl_base_endpoint_t; typedef mca_mtl_base_endpoint_t mca_mtl_psm_endpoint_t; OBJ_CLASS_DECLARATION(mca_mtl_psm_endpoint); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/mtl/psm/mtl_psm_types.h b/ompi/mca/mtl/psm/mtl_psm_types.h index 7b29cef202..fd58d4b357 100644 --- a/ompi/mca/mtl/psm/mtl_psm_types.h +++ b/ompi/mca/mtl/psm/mtl_psm_types.h @@ -30,9 +30,7 @@ #include "psm.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * MTL Module Interface @@ -84,9 +82,7 @@ OMPI_DECLSPEC mca_mtl_psm_component_t mca_mtl_psm_component; (tagsel) &= ~0xffff00000000ULL; \ } while (0) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MTL_PSM_TYPES_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/pml/cm/pml_cm_component.h b/ompi/mca/pml/cm/pml_cm_component.h index 880f9afd02..9c61cedcb0 100644 --- a/ompi/mca/pml/cm/pml_cm_component.h +++ b/ompi/mca/pml/cm/pml_cm_component.h @@ -20,17 +20,13 @@ #ifndef MCA_PML_CM_COMPONENT_H #define MCA_PML_CM_COMPONENT_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * PML module functions. */ extern mca_pml_base_component_2_0_0_t mca_pml_cm_component; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/crcpw/pml_crcpw.h b/ompi/mca/pml/crcpw/pml_crcpw.h index e9b4f51f28..2dc8a6f878 100644 --- a/ompi/mca/pml/crcpw/pml_crcpw.h +++ b/ompi/mca/pml/crcpw/pml_crcpw.h @@ -35,9 +35,7 @@ #include "ompi/mca/crcp/crcp.h" #include "ompi/mca/crcp/base/base.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * CRCPW PML module @@ -118,8 +116,6 @@ extern "C" { int mca_pml_crcpw_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_PML_CRCPW_H */ diff --git a/ompi/mca/pml/csum/pml_csum_comm.h b/ompi/mca/pml/csum/pml_csum_comm.h index 9e76f82057..adb65a635a 100644 --- a/ompi/mca/pml/csum/pml_csum_comm.h +++ b/ompi/mca/pml/csum/pml_csum_comm.h @@ -24,9 +24,7 @@ #include "opal/threads/mutex.h" #include "opal/class/opal_list.h" #include "ompi/proc/proc.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_pml_csum_comm_proc_t { @@ -76,8 +74,6 @@ OBJ_CLASS_DECLARATION(mca_pml_csum_comm_t); extern int mca_pml_csum_comm_init_size(mca_pml_csum_comm_t* comm, size_t size); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/dr/pml_dr.h b/ompi/mca/pml/dr/pml_dr.h index 8922498653..dcddbef7f2 100644 --- a/ompi/mca/pml/dr/pml_dr.h +++ b/ompi/mca/pml/dr/pml_dr.h @@ -34,9 +34,7 @@ #include "opal/class/opal_pointer_array.h" #include "ompi/datatype/ompi_datatype.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * DR PML module @@ -209,9 +207,7 @@ extern int mca_pml_dr_start( extern int mca_pml_dr_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/dr/pml_dr_comm.h b/ompi/mca/pml/dr/pml_dr_comm.h index 5b737d3ba7..ee8f9533bc 100644 --- a/ompi/mca/pml/dr/pml_dr_comm.h +++ b/ompi/mca/pml/dr/pml_dr_comm.h @@ -26,9 +26,7 @@ #include "ompi/communicator/communicator.h" #include "ompi/proc/proc.h" #include "pml_dr_endpoint.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_pml_dr_comm_proc_t { @@ -83,8 +81,6 @@ OBJ_CLASS_DECLARATION(mca_pml_dr_comm_t); extern int mca_pml_dr_comm_init(mca_pml_dr_comm_t* dr_comm, ompi_communicator_t* ompi_comm); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/dr/pml_dr_component.h b/ompi/mca/pml/dr/pml_dr_component.h index 53e026912a..8b82504d40 100644 --- a/ompi/mca/pml/dr/pml_dr_component.h +++ b/ompi/mca/pml/dr/pml_dr_component.h @@ -20,17 +20,13 @@ #ifndef MCA_PML_DR_COMPONENT_H #define MCA_PML_DR_COMPONENT_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * PML module functions. */ OMPI_MODULE_DECLSPEC extern mca_pml_base_component_2_0_0_t mca_pml_dr_component; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/dr/pml_dr_endpoint.h b/ompi/mca/pml/dr/pml_dr_endpoint.h index bf0e200a5f..c47d482a4e 100644 --- a/ompi/mca/pml/dr/pml_dr_endpoint.h +++ b/ompi/mca/pml/dr/pml_dr_endpoint.h @@ -24,9 +24,7 @@ #include "ompi/mca/bml/bml.h" #include "ompi/class/ompi_seq_tracker.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * This is the pml level endpoint * simply inherity the bml_base_endpoint and @@ -48,8 +46,6 @@ typedef struct mca_pml_dr_endpoint_t mca_pml_dr_endpoint_t; OBJ_CLASS_DECLARATION(mca_pml_dr_endpoint_t); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/dr/pml_dr_recvfrag.h b/ompi/mca/pml/dr/pml_dr_recvfrag.h index 3a7003c377..b5a186f27f 100644 --- a/ompi/mca/pml/dr/pml_dr_recvfrag.h +++ b/ompi/mca/pml/dr/pml_dr_recvfrag.h @@ -26,9 +26,7 @@ #include "ompi/mca/bml/bml.h" #include "pml_dr_hdr.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_pml_dr_buffer_t { ompi_free_list_item_t super; @@ -166,8 +164,6 @@ bool mca_pml_dr_recv_frag_match( mca_pml_dr_comm_t* comm, mca_btl_base_segment_t* segments, size_t num_segments); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/dr/pml_dr_recvreq.h b/ompi/mca/pml/dr/pml_dr_recvreq.h index 899211401a..450ca4a099 100644 --- a/ompi/mca/pml/dr/pml_dr_recvreq.h +++ b/ompi/mca/pml/dr/pml_dr_recvreq.h @@ -30,9 +30,7 @@ #include "pml_dr_vfrag.h" #include "pml_dr_comm.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_pml_dr_recv_request_t { @@ -400,8 +398,6 @@ do { \ } \ } while(0) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/dr/pml_dr_sendreq.h b/ompi/mca/pml/dr/pml_dr_sendreq.h index 49287e5bec..2fe8ed7c65 100644 --- a/ompi/mca/pml/dr/pml_dr_sendreq.h +++ b/ompi/mca/pml/dr/pml_dr_sendreq.h @@ -37,9 +37,7 @@ #include "pml_dr_endpoint.h" #include "opal/event/event.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_pml_dr_send_request_t { mca_pml_base_send_request_t req_send; @@ -488,8 +486,6 @@ void mca_pml_dr_send_request_frag_ack( void mca_pml_dr_sendreq_cleanup_active(mca_btl_base_module_t* btl); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/dr/pml_dr_vfrag.h b/ompi/mca/pml/dr/pml_dr_vfrag.h index 544bf685cf..08df18c836 100644 --- a/ompi/mca/pml/dr/pml_dr_vfrag.h +++ b/ompi/mca/pml/dr/pml_dr_vfrag.h @@ -26,9 +26,7 @@ #include "opal/types.h" #include "pml_dr.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define MCA_PML_DR_VFRAG_NACKED 0x01 #define MCA_PML_DR_VFRAG_RNDV 0x02 @@ -149,8 +147,6 @@ void mca_pml_dr_vfrag_reset(mca_pml_dr_vfrag_t*); void mca_pml_dr_vfrag_reschedule(mca_pml_dr_vfrag_t*); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/example/pml_example.h b/ompi/mca/pml/example/pml_example.h index d393e35079..5b16e82c3d 100644 --- a/ompi/mca/pml/example/pml_example.h +++ b/ompi/mca/pml/example/pml_example.h @@ -19,9 +19,7 @@ #include "ompi/mca/pml/pml.h" #include "ompi/mca/ptl/ptl.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_pml_example_t { mca_pml_base_module_t super; @@ -126,8 +124,6 @@ extern int mca_pml_example_start( size_t count, ompi_request_t** requests ); extern int mca_pml_example_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* PML_EXAMPLE_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/pml/ob1/pml_ob1_comm.h b/ompi/mca/pml/ob1/pml_ob1_comm.h index b5b02242e0..cadf317d61 100644 --- a/ompi/mca/pml/ob1/pml_ob1_comm.h +++ b/ompi/mca/pml/ob1/pml_ob1_comm.h @@ -24,9 +24,7 @@ #include "opal/threads/mutex.h" #include "opal/class/opal_list.h" #include "ompi/proc/proc.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_pml_ob1_comm_proc_t { @@ -76,8 +74,6 @@ OBJ_CLASS_DECLARATION(mca_pml_ob1_comm_t); extern int mca_pml_ob1_comm_init_size(mca_pml_ob1_comm_t* comm, size_t size); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/ob1/pml_ob1_component.h b/ompi/mca/pml/ob1/pml_ob1_component.h index 271d2d45f3..5021da20be 100644 --- a/ompi/mca/pml/ob1/pml_ob1_component.h +++ b/ompi/mca/pml/ob1/pml_ob1_component.h @@ -20,17 +20,13 @@ #ifndef MCA_PML_OB1_COMPONENT_H #define MCA_PML_OB1_COMPONENT_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * PML module functions. */ OMPI_MODULE_DECLSPEC extern mca_pml_base_component_2_0_0_t mca_pml_ob1_component; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/ob1/pml_ob1_endpoint.h b/ompi/mca/pml/ob1/pml_ob1_endpoint.h index 47cdb13f23..aeef83abc9 100644 --- a/ompi/mca/pml/ob1/pml_ob1_endpoint.h +++ b/ompi/mca/pml/ob1/pml_ob1_endpoint.h @@ -21,12 +21,8 @@ #ifndef MCA_PML_OB1_ENDPOINT_H #define MCA_PML_OB1_ENDPOINT_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif - -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +BEGIN_C_DECLS + +END_C_DECLS #endif diff --git a/ompi/mca/pml/ob1/pml_ob1_rdmafrag.h b/ompi/mca/pml/ob1/pml_ob1_rdmafrag.h index 38d8e028da..f1c9fefa0a 100644 --- a/ompi/mca/pml/ob1/pml_ob1_rdmafrag.h +++ b/ompi/mca/pml/ob1/pml_ob1_rdmafrag.h @@ -25,9 +25,7 @@ #include "ompi/mca/btl/btl.h" #include "pml_ob1_hdr.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS typedef enum { MCA_PML_OB1_RDMA_PUT, @@ -67,8 +65,6 @@ do { \ } while(0) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/ob1/pml_ob1_recvfrag.h b/ompi/mca/pml/ob1/pml_ob1_recvfrag.h index c4fe844d87..d769b128ba 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvfrag.h +++ b/ompi/mca/pml/ob1/pml_ob1_recvfrag.h @@ -26,9 +26,7 @@ #include "ompi/mca/btl/btl.h" #include "pml_ob1_hdr.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct mca_pml_ob1_buffer_t { size_t len; @@ -168,8 +166,6 @@ extern void mca_pml_ob1_recv_frag_callback_fin( mca_btl_base_module_t *btl, void* cbdata ); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/mca/pml/pml.h b/ompi/mca/pml/pml.h index 4a90a393ed..571e601e4d 100644 --- a/ompi/mca/pml/pml.h +++ b/ompi/mca/pml/pml.h @@ -65,9 +65,7 @@ #include "opal/mca/mca.h" #include "mpi.h" /* needed for MPI_ANY_TAG */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * PML component types @@ -538,7 +536,5 @@ typedef mca_pml_base_module_1_0_0_t mca_pml_base_module_t; OMPI_DECLSPEC extern mca_pml_base_module_t mca_pml; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_PML_H */ diff --git a/ompi/mca/pml/v/mca/vprotocol/base/base.h b/ompi/mca/pml/v/mca/vprotocol/base/base.h index c432d92cfd..7581afb99a 100644 --- a/ompi/mca/pml/v/mca/vprotocol/base/base.h +++ b/ompi/mca/pml/v/mca/vprotocol/base/base.h @@ -16,9 +16,7 @@ #include "opal/mca/mca.h" #include "../vprotocol.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OMPI_DECLSPEC int mca_vprotocol_base_open(char *vprotocol_include_list); OMPI_DECLSPEC int mca_vprotocol_base_select(bool enable_progress_threads, @@ -51,8 +49,6 @@ OMPI_DECLSPEC extern mca_vprotocol_base_module_t mca_vprotocol; 0 != mca_vprotocol_component.pmlm_version.mca_type_major_version \ ) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* __INCLUDE_VPROTOCOL_BASE_H_ */ diff --git a/ompi/mca/pml/v/mca/vprotocol/base/vprotocol_base_request.h b/ompi/mca/pml/v/mca/vprotocol/base/vprotocol_base_request.h index a2c1f16e12..0262de95c2 100644 --- a/ompi/mca/pml/v/mca/vprotocol/base/vprotocol_base_request.h +++ b/ompi/mca/pml/v/mca/vprotocol/base/vprotocol_base_request.h @@ -15,9 +15,7 @@ #include "ompi/mca/pml/base/pml_base_request.h" #include "../vprotocol.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** Rebuild the PML requests pools to make room for extra space at end of each @@ -79,8 +77,6 @@ OMPI_DECLSPEC int mca_vprotocol_base_request_parasite(void); ) \ ) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* __INCLUDE_VPROTOCOL_REQUEST_H_ */ diff --git a/ompi/mca/pml/v/mca/vprotocol/vprotocol.h b/ompi/mca/pml/v/mca/vprotocol/vprotocol.h index 4a3539f4e0..d89f3fe5c9 100644 --- a/ompi/mca/pml/v/mca/vprotocol/vprotocol.h +++ b/ompi/mca/pml/v/mca/vprotocol/vprotocol.h @@ -16,9 +16,7 @@ #include "ompi/mca/pml/pml.h" #include "ompi/request/request.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* PML_V->PROTOCOL Called by MCA_PML_V framework to initialize the component. * @@ -90,9 +88,7 @@ typedef struct mca_vprotocol_base_module_2_0_0_t } mca_vprotocol_base_module_2_0_0_t; typedef mca_vprotocol_base_module_2_0_0_t mca_vprotocol_base_module_t; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS /* silently include the pml_v.h as every file including vprotocol.h will also * need it diff --git a/ompi/mca/pml/v/pml_v_output.h b/ompi/mca/pml/v/pml_v_output.h index 25ea59b9ba..6fcf4724c1 100644 --- a/ompi/mca/pml/v/pml_v_output.h +++ b/ompi/mca/pml/v/pml_v_output.h @@ -16,9 +16,7 @@ #include #include "pml_v.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS int pml_v_output_open(char *output, int verbosity); void pml_v_output_close(void); @@ -97,8 +95,6 @@ static inline void V_OUTPUT_VERBOSE(int V, const char* fmt, ... ) { } #endif /* DEBUG */ -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* PML_V_OUTPUT_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/rcache/base/base.h b/ompi/mca/rcache/base/base.h index 33a32e3e15..b2f7ed0910 100644 --- a/ompi/mca/rcache/base/base.h +++ b/ompi/mca/rcache/base/base.h @@ -27,9 +27,7 @@ #include "opal/mca/mca.h" #include "ompi/mca/rcache/rcache.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * create a module by name @@ -66,8 +64,6 @@ OMPI_DECLSPEC extern int mca_rcache_base_output; OMPI_DECLSPEC extern opal_list_t mca_rcache_base_components; OMPI_DECLSPEC extern opal_list_t mca_rcache_base_modules; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_RCACHE_BASE_H */ diff --git a/ompi/mca/topo/unity/topo_unity.h b/ompi/mca/topo/unity/topo_unity.h index cd5b1cf514..6c9a3f881a 100644 --- a/ompi/mca/topo/unity/topo_unity.h +++ b/ompi/mca/topo/unity/topo_unity.h @@ -35,9 +35,7 @@ * structure. They are the "meta" functions to ensure smooth op. * ****************************************************************** */ -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif +BEGIN_C_DECLS int mca_topo_unity_component_init_query(bool enable_progress_threads, bool enable_mpi_threads); @@ -79,8 +77,6 @@ int mca_topo_unity_graph_map (struct ompi_communicator_t *comm, * ****************************************************************** */ -#if defined(__cplusplus) || defined(c_plusplus) - } -#endif +END_C_DECLS #endif /* MCA_TOPO_UNITY_H */ diff --git a/ompi/mpi/cxx/mpicxx.h b/ompi/mpi/cxx/mpicxx.h index ac7296fcaa..4b12b5e9df 100644 --- a/ompi/mpi/cxx/mpicxx.h +++ b/ompi/mpi/cxx/mpicxx.h @@ -27,7 +27,8 @@ // hasn't included just "for completeness" // -#if defined(__cplusplus) || defined(c_plusplus) +// We do not include the opal_config.h and may not replace extern "C" { +#if defined(c_plusplus) || defined(__cplusplus) // do not include ompi_config.h. it will smash free() as a symbol #include "mpi.h" @@ -300,5 +301,5 @@ namespace MPI { #endif #endif -#endif // #if defined(__cplusplus) || defined(c_plusplus) +#endif // #if defined(c_plusplus) || defined(__cplusplus) #endif // #ifndef MPIPP_H_ diff --git a/ompi/mpi/f77/f77_strings.h b/ompi/mpi/f77/f77_strings.h index 99ef21c875..eea41dc7dc 100644 --- a/ompi/mpi/f77/f77_strings.h +++ b/ompi/mpi/f77/f77_strings.h @@ -21,9 +21,7 @@ #include "ompi_config.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Convert a fortran string to a C string. * @@ -94,9 +92,7 @@ extern "C" { OMPI_DECLSPEC int ompi_fortran_multiple_argvs_f2c(int count, char *array, int len, char ****argv); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_F77_STRINGS_H */ diff --git a/ompi/mpi/f90/test/align_c.c b/ompi/mpi/f90/test/align_c.c index 2619d584c7..eb46082eb0 100644 --- a/ompi/mpi/f90/test/align_c.c +++ b/ompi/mpi/f90/test/align_c.c @@ -1,8 +1,7 @@ +#include "ompi_config.h" #include -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_C_DECLS void PRINT_INT(int* i); @@ -70,7 +69,5 @@ void ALIGN_C__(char *a, char *w, char *x, char *y, char *z) align_c(a, w, x, y, z); } +END_C_DECLS -#ifdef __cplusplus -} -#endif diff --git a/ompi/mpi/f90/xml/common-C.xsl b/ompi/mpi/f90/xml/common-C.xsl index 0827e76814..ebf4d71cd2 100644 --- a/ompi/mpi/f90/xml/common-C.xsl +++ b/ompi/mpi/f90/xml/common-C.xsl @@ -82,7 +82,7 @@ - openExternC: open extern "C" declaration --> - #ifdef __cplusplus + #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif @@ -93,7 +93,7 @@ - closeExternC: close extern "C" declaration --> - #ifdef __cplusplus + #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/ompi/request/grequest.h b/ompi/request/grequest.h index e0072ec3f6..9ef38639cd 100644 --- a/ompi/request/grequest.h +++ b/ompi/request/grequest.h @@ -23,9 +23,7 @@ #include "ompi_config.h" #include "ompi/request/request.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_grequest_t); /** @@ -106,8 +104,6 @@ OMPI_DECLSPEC int ompi_grequest_complete(ompi_request_t *req); */ OMPI_DECLSPEC int ompi_grequest_invoke_query(ompi_request_t *request, ompi_status_public_t *status); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/ompi/runtime/ompi_cr.h b/ompi/runtime/ompi_cr.h index 81406f37f8..21b76d5b3d 100644 --- a/ompi/runtime/ompi_cr.h +++ b/ompi/runtime/ompi_cr.h @@ -27,9 +27,7 @@ #include "ompi_config.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Initialization called in ompi_init() @@ -57,8 +55,6 @@ extern "C" { */ OPAL_DECLSPEC extern bool ompi_cr_continue_like_restart; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_CR_H */ diff --git a/ompi/win/win.h b/ompi/win/win.h index 90ac7fe31e..dee0cf6e73 100644 --- a/ompi/win/win.h +++ b/ompi/win/win.h @@ -33,9 +33,7 @@ #include "ompi/group/group.h" #include "ompi/mca/osc/osc.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* flags */ #define OMPI_WIN_FREED 0x00000001 @@ -193,7 +191,5 @@ static inline bool ompi_win_comm_allowed(ompi_win_t *win) { return (0 != (OMPI_WIN_ACCESS_EPOCH & mode || OMPI_WIN_FENCE & mode) ? true : false); } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/opal/event/event.h b/opal/event/event.h index 7e519b8fa2..8cb8aa3b3d 100644 --- a/opal/event/event.h +++ b/opal/event/event.h @@ -162,10 +162,7 @@ #include "event_rename.h" -#ifdef __cplusplus -extern "C" { -#endif - +BEGIN_C_DECLS #ifdef HAVE_SYS_TYPES_H #include @@ -1201,9 +1198,7 @@ int evtag_unmarshal_timeval(struct evbuffer *evbuf, ev_uint32_t need_tag, extern const struct opal_eventop opal_win32ops; #endif /* defined(__WINDOWS__) */ -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS /* #defines to allow callers to know if opal_event_loop is going to do anything */ diff --git a/opal/include/opal/sys/atomic.h b/opal/include/opal/sys/atomic.h index e86c9241c6..679f419a88 100644 --- a/opal/include/opal/sys/atomic.h +++ b/opal/include/opal/sys/atomic.h @@ -84,9 +84,7 @@ #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /********************************************************************** * * Data structures for atomic ops @@ -616,8 +614,6 @@ static inline int64_t opal_atomic_sub_ptr( volatile void* addr, void* delta ); *********************************************************************/ #include "opal/sys/atomic_impl.h" -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_SYS_ATOMIC_H */ diff --git a/opal/include/opal/sys/timer.h b/opal/include/opal/sys/timer.h index 971ed6e651..b149f2b8ca 100644 --- a/opal/include/opal/sys/timer.h +++ b/opal/include/opal/sys/timer.h @@ -70,9 +70,7 @@ * *********************************************************************/ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* If you update this list, you probably also want to update opal/mca/timer/linux/configure.m4. Or not. */ @@ -107,8 +105,6 @@ typedef int opal_timer_t; #endif #endif -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_SYS_TIMER_H */ diff --git a/opal/include/opal_config_bottom.h b/opal/include/opal_config_bottom.h index 1e937fa97a..5dd96779e8 100644 --- a/opal/include/opal_config_bottom.h +++ b/opal/include/opal_config_bottom.h @@ -256,7 +256,7 @@ * Do we have ? */ #ifdef HAVE_STDINT_H -#if defined(__cplusplus) && !defined(__STDC_LIMIT_MACROS) +#if !defined(__STDC_LIMIT_MACROS) && (defined(c_plusplus) || defined (__cplusplus)) /* When using a C++ compiler, the max / min value #defines for std types are only included if __STDC_LIMIT_MACROS is set before including stdint.h */ diff --git a/opal/mca/backtrace/backtrace.h b/opal/mca/backtrace/backtrace.h index 04db71c7a8..ce491254da 100644 --- a/opal/mca/backtrace/backtrace.h +++ b/opal/mca/backtrace/backtrace.h @@ -24,9 +24,7 @@ #include "opal/mca/mca.h" #include "opal/mca/base/base.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Most of this file is just for ompi_info. There are two interface @@ -73,8 +71,6 @@ typedef struct opal_backtrace_base_component_2_0_0_t opal_backtrace_base_compone MCA_BASE_VERSION_2_0_0, \ "backtrace", 2, 0, 0 -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_MCA_BACKTRACE_BACKTRACE_H */ diff --git a/opal/mca/backtrace/base/base.h b/opal/mca/backtrace/base/base.h index d1b0ceb3d0..972a9d2ab7 100644 --- a/opal/mca/backtrace/base/base.h +++ b/opal/mca/backtrace/base/base.h @@ -29,9 +29,7 @@ * Global functions for MCA overall backtrace open and close */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Initialize the backtrace MCA framework @@ -71,7 +69,5 @@ extern "C" { OPAL_DECLSPEC extern opal_list_t opal_backtrace_base_components_opened; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_BASE_BACKTRACE_H */ diff --git a/opal/mca/backtrace/none/backtrace_none_component.c b/opal/mca/backtrace/none/backtrace_none_component.c index 660744c27d..af5180e4d7 100644 --- a/opal/mca/backtrace/none/backtrace_none_component.c +++ b/opal/mca/backtrace/none/backtrace_none_component.c @@ -20,13 +20,9 @@ #include "opal/mca/backtrace/backtrace.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC extern const opal_backtrace_base_component_2_0_0_t mca_backtrace_none_component; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS const opal_backtrace_base_component_2_0_0_t mca_backtrace_none_component = { /* First, the mca_component_t struct containing meta information diff --git a/opal/mca/base/mca_base_component_repository.h b/opal/mca/base/mca_base_component_repository.h index 682154e930..9d33bca0b7 100644 --- a/opal/mca/base/mca_base_component_repository.h +++ b/opal/mca/base/mca_base_component_repository.h @@ -21,9 +21,7 @@ #include "opal_config.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC int mca_base_component_repository_init(void); @@ -77,8 +75,6 @@ extern "C" { OPAL_DECLSPEC void mca_base_component_repository_release(const mca_base_component_t *component); OPAL_DECLSPEC void mca_base_component_repository_finalize(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_BASE_COMPONENT_REPOSITORY_H */ diff --git a/opal/mca/base/mca_base_param.h b/opal/mca/base/mca_base_param.h index a65cc49755..4a4c379383 100644 --- a/opal/mca/base/mca_base_param.h +++ b/opal/mca/base/mca_base_param.h @@ -143,9 +143,7 @@ typedef struct mca_base_param_info_t mca_base_param_info_t; * Global functions for MCA */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Make a real object for the info @@ -858,8 +856,6 @@ extern "C" { const char *comp, const char *param) /* __opal_attribute_deprecated__ */; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_MCA_BASE_PARAM_H */ diff --git a/opal/mca/base/mca_base_param_internal.h b/opal/mca/base/mca_base_param_internal.h index 61784d32ce..1984662e58 100644 --- a/opal/mca/base/mca_base_param_internal.h +++ b/opal/mca/base/mca_base_param_internal.h @@ -39,9 +39,7 @@ #include "opal/class/opal_list.h" #include "opal/mca/base/mca_base_param.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * \internal @@ -179,8 +177,6 @@ OPAL_DECLSPEC extern opal_list_t mca_base_param_file_values; */ OPAL_DECLSPEC int mca_base_parse_paramfile(const char *paramfile); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_MCA_BASE_PARAM_INTERNAL_H */ diff --git a/opal/mca/carto/file/carto_file_lex.l b/opal/mca/carto/file/carto_file_lex.l index 865743bf82..4869645138 100644 --- a/opal/mca/carto/file/carto_file_lex.l +++ b/opal/mca/carto/file/carto_file_lex.l @@ -28,15 +28,11 @@ /* * local functions */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif /* defined(c_plusplus) || defined(__cplusplus) */ +BEGIN_C_DECLS int carto_file_wrap(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif /* defined(c_plusplus) || defined(__cplusplus) */ +END_C_DECLS int carto_file_wrap(void) { diff --git a/opal/mca/crs/base/base.h b/opal/mca/crs/base/base.h index 762be210c8..24237b2bc0 100644 --- a/opal/mca/crs/base/base.h +++ b/opal/mca/crs/base/base.h @@ -28,9 +28,7 @@ * Global functions for MCA overall CRS */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* Some local strings to use genericly with the local metadata file */ #define CRS_METADATA_BASE ("# ") @@ -114,8 +112,6 @@ extern "C" { */ OPAL_DECLSPEC int opal_crs_base_cleanup_flush(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_CRS_BASE_H */ diff --git a/opal/mca/crs/blcr/crs_blcr.h b/opal/mca/crs/blcr/crs_blcr.h index bf17388c17..20b236e856 100644 --- a/opal/mca/crs/blcr/crs_blcr.h +++ b/opal/mca/crs/blcr/crs_blcr.h @@ -33,9 +33,7 @@ #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Local Component structures @@ -80,8 +78,6 @@ extern "C" { int opal_crs_blcr_reg_thread(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_CRS_BLCR_EXPORT_H */ diff --git a/opal/mca/crs/crs.h b/opal/mca/crs/crs.h index 9199c6a094..a330c74b18 100644 --- a/opal/mca/crs/crs.h +++ b/opal/mca/crs/crs.h @@ -51,9 +51,7 @@ #include "opal/mca/base/base.h" #include "opal/class/opal_object.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * States of the module @@ -267,9 +265,7 @@ OPAL_DECLSPEC extern opal_crs_base_module_t opal_crs; MCA_BASE_VERSION_2_0_0, \ "crs", 2, 0, 0 -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_CRS_H */ diff --git a/opal/mca/crs/none/crs_none.h b/opal/mca/crs/none/crs_none.h index 6e534e035c..ae0cf56092 100644 --- a/opal/mca/crs/none/crs_none.h +++ b/opal/mca/crs/none/crs_none.h @@ -25,9 +25,7 @@ #include "opal/mca/mca.h" #include "opal/mca/crs/crs.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Local Component structures @@ -68,8 +66,6 @@ extern "C" { extern bool opal_crs_none_select_warning; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_CRS_NONE_EXPORT_H */ diff --git a/opal/mca/crs/self/crs_self.h b/opal/mca/crs/self/crs_self.h index f06bddd68b..e6c447b6f2 100644 --- a/opal/mca/crs/self/crs_self.h +++ b/opal/mca/crs/self/crs_self.h @@ -31,9 +31,7 @@ #include "opal/mca/mca.h" #include "opal/mca/crs/crs.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define PREFIX_DEFAULT ("opal_crs_self_user") #define SUFFIX_CHECKPOINT ("checkpoint") @@ -90,8 +88,6 @@ extern "C" { int opal_crs_self_reg_thread(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_CRS_SELF_EXPORT_H */ diff --git a/opal/mca/installdirs/base/base.h b/opal/mca/installdirs/base/base.h index f0dffd0845..1b9f64ffbd 100644 --- a/opal/mca/installdirs/base/base.h +++ b/opal/mca/installdirs/base/base.h @@ -20,9 +20,7 @@ /* * Global functions for MCA overall installdirs open and close */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC int opal_installdirs_base_open(void); OPAL_DECLSPEC int opal_installdirs_base_close(void); @@ -32,8 +30,6 @@ OPAL_DECLSPEC int opal_installdirs_base_close(void); */ OPAL_DECLSPEC extern opal_list_t opal_installdirs_components; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_BASE_INSTALLDIRS_H */ diff --git a/opal/mca/installdirs/installdirs.h b/opal/mca/installdirs/installdirs.h index 1c24635e86..a934ba018a 100644 --- a/opal/mca/installdirs/installdirs.h +++ b/opal/mca/installdirs/installdirs.h @@ -16,9 +16,7 @@ #include "opal/mca/mca.h" #include "opal/mca/base/base.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Most of this file is just for ompi_info. The only public interface @@ -77,8 +75,6 @@ typedef struct opal_installdirs_base_component_2_0_0_t opal_installdirs_base_com MCA_BASE_VERSION_2_0_0, \ "installdirs", 2, 0, 0 -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_MCA_INSTALLDIRS_INSTALLDIRS_H */ diff --git a/opal/mca/maffinity/first_use/maffinity_first_use.h b/opal/mca/maffinity/first_use/maffinity_first_use.h index 4fccd16557..b2406a9c86 100644 --- a/opal/mca/maffinity/first_use/maffinity_first_use.h +++ b/opal/mca/maffinity/first_use/maffinity_first_use.h @@ -32,9 +32,7 @@ #include "opal/mca/maffinity/maffinity.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Globally exported variable @@ -53,7 +51,5 @@ extern "C" { */ int opal_maffinity_first_use_component_query(mca_base_module_t **module, int *priority); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_MAFFINITY_FIRST_USE_EXPORT_H */ diff --git a/opal/mca/maffinity/libnuma/maffinity_libnuma.h b/opal/mca/maffinity/libnuma/maffinity_libnuma.h index fc22fc29e8..96e84e1abe 100644 --- a/opal/mca/maffinity/libnuma/maffinity_libnuma.h +++ b/opal/mca/maffinity/libnuma/maffinity_libnuma.h @@ -32,9 +32,7 @@ #include "opal/mca/maffinity/maffinity.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Globally exported variable @@ -53,7 +51,5 @@ extern "C" { */ int opal_maffinity_libnuma_component_query(mca_base_module_t **module, int *priority); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_MAFFINITY_LIBNUMA_EXPORT_H */ diff --git a/opal/mca/memchecker/base/base.h b/opal/mca/memchecker/base/base.h index 0d1de5e50e..72d1ee4ed3 100644 --- a/opal/mca/memchecker/base/base.h +++ b/opal/mca/memchecker/base/base.h @@ -20,9 +20,7 @@ * Global functions for MCA overall memchecker open and close */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Initialize the memchecker MCA framework @@ -290,8 +288,6 @@ OPAL_DECLSPEC int opal_memchecker_base_set_vbits(void * p, char * vbits, size_t #define opal_memchecker_base_set_vbits(p, vbits, len) #endif -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_MEMCHECKER_BASE_H */ diff --git a/opal/mca/memchecker/valgrind/memchecker_valgrind.h b/opal/mca/memchecker/valgrind/memchecker_valgrind.h index 221a71840f..3957c13da0 100644 --- a/opal/mca/memchecker/valgrind/memchecker_valgrind.h +++ b/opal/mca/memchecker/valgrind/memchecker_valgrind.h @@ -24,9 +24,7 @@ #include "opal/mca/mca.h" #include "opal/mca/memchecker/memchecker.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Globally exported variable @@ -44,7 +42,5 @@ OPAL_DECLSPEC extern const opal_memchecker_base_component_2_0_0_t */ int opal_memchecker_valgrind_component_query(mca_base_module_t **module, int *priority); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_MEMCHECKER_VALGRIND_EXPORT_H */ diff --git a/opal/mca/memcpy/base/base.h b/opal/mca/memcpy/base/base.h index 15272dd5d6..a9a8a04400 100644 --- a/opal/mca/memcpy/base/base.h +++ b/opal/mca/memcpy/base/base.h @@ -22,9 +22,7 @@ * Global functions for MCA overall memcpy open and close */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Initialize the memcpy MCA framework @@ -64,9 +62,7 @@ extern "C" { OPAL_DECLSPEC extern opal_list_t opal_memcpy_base_components_opened; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS /* include implementation to call */ #include MCA_timer_IMPLEMENTATION_HEADER diff --git a/opal/mca/memory/base/base.h b/opal/mca/memory/base/base.h index d5db7fe2eb..fa04b63dca 100644 --- a/opal/mca/memory/base/base.h +++ b/opal/mca/memory/base/base.h @@ -29,9 +29,7 @@ * Global functions for MCA overall memory open and close */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Initialize the memory MCA framework @@ -71,7 +69,5 @@ extern "C" { OPAL_DECLSPEC extern opal_list_t opal_memory_base_components_opened; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_BASE_MEMORY_H */ diff --git a/opal/mca/paffinity/linux/paffinity_linux.h b/opal/mca/paffinity/linux/paffinity_linux.h index 7d8e962c13..a0a8b1670c 100644 --- a/opal/mca/paffinity/linux/paffinity_linux.h +++ b/opal/mca/paffinity/linux/paffinity_linux.h @@ -46,9 +46,7 @@ #include "opal/mca/paffinity/linux/plpa/src/libplpa/plpa.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Globally exported variable @@ -67,7 +65,5 @@ extern "C" { */ int opal_paffinity_linux_component_query(mca_base_module_t **module, int *priority); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_PAFFINITY_LINUX_EXPORT_H */ diff --git a/opal/mca/paffinity/solaris/paffinity_solaris.h b/opal/mca/paffinity/solaris/paffinity_solaris.h index caf0fb90e7..ff86852de7 100644 --- a/opal/mca/paffinity/solaris/paffinity_solaris.h +++ b/opal/mca/paffinity/solaris/paffinity_solaris.h @@ -25,9 +25,7 @@ #include "opal/mca/mca.h" #include "opal/mca/paffinity/paffinity.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Globally exported variable @@ -42,7 +40,5 @@ extern "C" { */ int opal_paffinity_solaris_component_query(mca_base_module_t **module, int *priority); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_PAFFINITY_SOLARIS_EXPORT_H */ diff --git a/opal/mca/paffinity/windows/paffinity_windows.h b/opal/mca/paffinity/windows/paffinity_windows.h index c30316829f..958d3e54b3 100644 --- a/opal/mca/paffinity/windows/paffinity_windows.h +++ b/opal/mca/paffinity/windows/paffinity_windows.h @@ -45,9 +45,7 @@ #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Globally exported variable @@ -61,7 +59,5 @@ extern "C" { */ int opal_paffinity_windows_component_query(mca_base_module_t **module, int *priority); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_PAFFINITY_WINDOWS_EXPORT_H */ diff --git a/opal/mca/timer/aix/timer_aix.h b/opal/mca/timer/aix/timer_aix.h index abdb4c70ed..278ee71c97 100644 --- a/opal/mca/timer/aix/timer_aix.h +++ b/opal/mca/timer/aix/timer_aix.h @@ -21,9 +21,7 @@ #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS typedef uint64_t opal_timer_t; @@ -70,8 +68,6 @@ opal_timer_base_get_freq() #define OPAL_TIMER_USEC_NATIVE 1 #define OPAL_TIMER_USEC_SUPPORTED 1 -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/opal/mca/timer/base/base.h b/opal/mca/timer/base/base.h index 2c2e7c405d..1c3b4105af 100644 --- a/opal/mca/timer/base/base.h +++ b/opal/mca/timer/base/base.h @@ -29,9 +29,7 @@ * Global functions for MCA overall timer open and close */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Initialize the timer MCA framework @@ -71,9 +69,7 @@ extern "C" { OPAL_DECLSPEC extern opal_list_t opal_timer_base_components_opened; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS /* include implementation to call */ #include MCA_timer_IMPLEMENTATION_HEADER diff --git a/opal/mca/timer/windows/timer_windows.h b/opal/mca/timer/windows/timer_windows.h index b4734c061d..1617cca738 100644 --- a/opal/mca/timer/windows/timer_windows.h +++ b/opal/mca/timer/windows/timer_windows.h @@ -24,9 +24,7 @@ #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC extern opal_timer_t opal_timer_windows_freq; OPAL_DECLSPEC extern opal_timer_t opal_timer_windows_start; @@ -60,8 +58,6 @@ opal_timer_base_get_freq(void) #define OPAL_TIMER_USEC_NATIVE 0 #define OPAL_TIMER_USEC_SUPPORTED OPAL_HAVE_SYS_TIMER_GET_CYCLES -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/opal/mca/timer/windows/timer_windows_component.h b/opal/mca/timer/windows/timer_windows_component.h index 606d7e6b78..9801a7d67d 100644 --- a/opal/mca/timer/windows/timer_windows_component.h +++ b/opal/mca/timer/windows/timer_windows_component.h @@ -22,14 +22,10 @@ #include "opal_config.h" #include "opal/mca/timer/windows/timer_windows.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC extern const opal_timer_base_component_2_0_0_t mca_timer_windows_component; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/opal/memoryhooks/memory.h b/opal/memoryhooks/memory.h index ab488f4cef..773d6cfecd 100644 --- a/opal/memoryhooks/memory.h +++ b/opal/memoryhooks/memory.h @@ -41,9 +41,7 @@ #include "opal_config.h" #include "memory_internal.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** @@ -159,8 +157,6 @@ OPAL_DECLSPEC int opal_mem_hooks_register_release(opal_mem_hooks_callback_fn_t * OPAL_DECLSPEC int opal_mem_hooks_unregister_release(opal_mem_hooks_callback_fn_t *func); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_MEMORY_MEMORY_H */ diff --git a/opal/memoryhooks/memory_internal.h b/opal/memoryhooks/memory_internal.h index 301088ba9c..bd0d6c7895 100644 --- a/opal/memoryhooks/memory_internal.h +++ b/opal/memoryhooks/memory_internal.h @@ -30,17 +30,13 @@ #define OPAL_MEMORY_MUNMAP_SUPPORT 0x0002 #define OPAL_MEMORY_CHUNK_SUPPORT 0x0004 -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC void opal_mem_hooks_set_support(int support); OPAL_DECLSPEC void opal_mem_hooks_release_hook(void *buf, size_t length, bool from_alloc); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_MEMORY_MEMORY_INTERNAL_H */ diff --git a/opal/runtime/opal_cr.h b/opal/runtime/opal_cr.h index 2ecab90c2e..6827c70b4e 100644 --- a/opal/runtime/opal_cr.h +++ b/opal/runtime/opal_cr.h @@ -33,9 +33,7 @@ #define OPAL_CR_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Some defines shared with opal-[checkpoint|restart] commands @@ -330,9 +328,7 @@ typedef enum opal_cr_ckpt_cmd_state_t opal_cr_ckpt_cmd_state_t; } \ } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_CR_H */ diff --git a/opal/runtime/opal_progress.h b/opal/runtime/opal_progress.h index 326ee762e0..a932f3f5fc 100644 --- a/opal/runtime/opal_progress.h +++ b/opal/runtime/opal_progress.h @@ -28,9 +28,7 @@ #ifndef OPAL_RUNTIME_OPAL_PROGRESS_H #define OPAL_RUNTIME_OPAL_PROGRESS_H -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #include "opal_config.h" #include "opal/threads/mutex.h" @@ -226,9 +224,7 @@ static inline uint32_t opal_progress_recursion_depth(void) } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/opal/threads/threads.h b/opal/threads/threads.h index 3ea674bb5e..a5e106b0c6 100644 --- a/opal/threads/threads.h +++ b/opal/threads/threads.h @@ -29,9 +29,7 @@ #include "opal/class/opal_object.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS typedef void *(*opal_thread_fn_t) (opal_object_t *); @@ -58,8 +56,6 @@ OPAL_DECLSPEC int opal_thread_join(opal_thread_t *, void **thread_return); OPAL_DECLSPEC bool opal_thread_self_compare(opal_thread_t*); OPAL_DECLSPEC opal_thread_t *opal_thread_get_self(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_THREAD_H */ diff --git a/opal/util/cmd_line.h b/opal/util/cmd_line.h index 8254435765..b61a08043a 100644 --- a/opal/util/cmd_line.h +++ b/opal/util/cmd_line.h @@ -116,9 +116,7 @@ #include "opal/class/opal_list.h" #include "opal/threads/mutex.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * \internal * @@ -558,9 +556,7 @@ extern "C" { OPAL_DECLSPEC int opal_cmd_line_get_tail(opal_cmd_line_t *cmd, int *tailc, char ***tailv) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_CMD_LINE_H */ diff --git a/opal/util/crc.h b/opal/util/crc.h index 66776d8d2d..55cdd2c08c 100644 --- a/opal/util/crc.h +++ b/opal/util/crc.h @@ -26,9 +26,7 @@ #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define CRC_POLYNOMIAL ((unsigned int)0x04c11db7) #define CRC_INITIAL_REGISTER ((unsigned int)0xffffffff) @@ -180,9 +178,7 @@ opal_uicrc(const void * source, size_t crclen) return opal_uicrc_partial(source, crclen, CRC_INITIAL_REGISTER); } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/opal/util/daemon_init.h b/opal/util/daemon_init.h index 0c7c5eadae..4055999de4 100644 --- a/opal/util/daemon_init.h +++ b/opal/util/daemon_init.h @@ -22,9 +22,7 @@ #include "opal_config.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * Turn a process into a daemon. @@ -41,8 +39,6 @@ extern "C" { */ OPAL_DECLSPEC int opal_daemon_init(char *working_dir); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_DAEMON_INIT_H */ diff --git a/opal/util/error.h b/opal/util/error.h index 3771a5e444..5b5c32a83e 100644 --- a/opal/util/error.h +++ b/opal/util/error.h @@ -21,9 +21,7 @@ #include "opal_config.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Prints error message for errnum on stderr @@ -84,8 +82,6 @@ OPAL_DECLSPEC int opal_error_register(const char *project, int err_base, int err_max, opal_err2str_fn_t converter); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_UTIL_ERROR_H */ diff --git a/opal/util/few.h b/opal/util/few.h index 20829e6a46..2d282a8c6a 100644 --- a/opal/util/few.h +++ b/opal/util/few.h @@ -21,9 +21,7 @@ #include "opal_config.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Forks, execs, and waits for a subordinate program @@ -57,7 +55,5 @@ extern "C" { */ OPAL_DECLSPEC int opal_few(char *argv[], int *status); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_FEW_H */ diff --git a/opal/util/keyval/keyval_lex.l b/opal/util/keyval/keyval_lex.l index 8a7f1822c0..967316a2c5 100644 --- a/opal/util/keyval/keyval_lex.l +++ b/opal/util/keyval/keyval_lex.l @@ -29,14 +29,13 @@ /* * local functions */ + +BEGIN_C_DECLS + static int finish_parsing(void); -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif int opal_util_keyval_yywrap(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif + +END_C_DECLS /* * global variables diff --git a/opal/util/keyval_parse.h b/opal/util/keyval_parse.h index 01d4672efb..7b0fb1b1f9 100644 --- a/opal/util/keyval_parse.h +++ b/opal/util/keyval_parse.h @@ -23,9 +23,7 @@ #include "opal_config.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Callback triggered for each key = value pair @@ -52,8 +50,6 @@ OPAL_DECLSPEC int opal_util_keyval_parse_init(void); OPAL_DECLSPEC int opal_util_keyval_parse_finalize(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/opal/util/malloc.h b/opal/util/malloc.h index b4e3d0a47b..db5a4d07ed 100644 --- a/opal/util/malloc.h +++ b/opal/util/malloc.h @@ -43,9 +43,7 @@ #define OPAL_MALLOC_DEBUG_LEVEL 2 #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Initialize malloc debug output. * @@ -142,8 +140,6 @@ OPAL_DECLSPEC void opal_free(void *addr, const char *file, int line) __opal_attr */ OPAL_DECLSPEC void opal_malloc_debug(int level); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_MALLOC_H */ diff --git a/opal/util/opal_pty.h b/opal/util/opal_pty.h index b35566c7d4..a06ca137b8 100644 --- a/opal/util/opal_pty.h +++ b/opal/util/opal_pty.h @@ -35,9 +35,7 @@ # endif #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #if OPAL_ENABLE_PTY_SUPPORT @@ -51,8 +49,6 @@ OPAL_DECLSPEC int opal_openpty(int *amaster, int *aslave, char *name, #endif -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_UTIL_PTY_H */ diff --git a/opal/util/os_path.h b/opal/util/os_path.h index 95c1f68cbe..f0ed2c809d 100644 --- a/opal/util/os_path.h +++ b/opal/util/os_path.h @@ -46,9 +46,7 @@ #include #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * @param relative A boolean that specifies if the path name is to be constructed @@ -99,8 +97,6 @@ static inline char* opal_make_filename_os_friendly( char* filename ) #define opal_make_filename_os_friendly(PATH) (PATH) #endif /* defined(__WINDOWS__) */ -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_OS_PATH_H */ diff --git a/opal/util/qsort.h b/opal/util/qsort.h index eb48c42492..5e52cf7ae9 100644 --- a/opal/util/qsort.h +++ b/opal/util/qsort.h @@ -25,15 +25,11 @@ #include /* for size_t */ #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS void opal_qsort(void *a, size_t n, size_t es, int (*cmp)(const void *, const void*)); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #else #error "Don't include opal/qsort/qsort.h directly" diff --git a/opal/util/show_help_lex.h b/opal/util/show_help_lex.h index 211d201567..4d9f8fc39f 100644 --- a/opal/util/show_help_lex.h +++ b/opal/util/show_help_lex.h @@ -33,9 +33,7 @@ #endif #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS int opal_show_help_yylex(void); int opal_show_help_init_buffer(FILE *file); @@ -63,7 +61,5 @@ enum { OPAL_SHOW_HELP_PARSE_MAX }; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/opal/util/show_help_lex.l b/opal/util/show_help_lex.l index 2c5e0b3793..165ba6c015 100644 --- a/opal/util/show_help_lex.l +++ b/opal/util/show_help_lex.l @@ -26,9 +26,7 @@ #include "opal/util/show_help_lex.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * public functions @@ -40,9 +38,7 @@ extern int opal_show_help_finish_parsing(void); */ static int opal_show_help_yywrap(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS /* * global variables diff --git a/opal/util/strncpy.h b/opal/util/strncpy.h index 2e5f002a14..c389c4cdc0 100644 --- a/opal/util/strncpy.h +++ b/opal/util/strncpy.h @@ -32,15 +32,11 @@ #endif #define strncpy opal_strncpy -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* Might also be pure? */ OPAL_DECLSPEC char *opal_strncpy(char *dest, const char *src, size_t len) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_STRNCPY_H */ diff --git a/opal/util/sys_limits.h b/opal/util/sys_limits.h index 0c63c0c6b9..611b96227c 100644 --- a/opal/util/sys_limits.h +++ b/opal/util/sys_limits.h @@ -25,9 +25,7 @@ #include #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* define a structure to hold the various limits we find * so that users can neatly access them @@ -49,8 +47,6 @@ OPAL_DECLSPEC extern opal_sys_limits_t opal_sys_limits; */ OPAL_DECLSPEC int opal_util_init_sys_limits(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_STRNCPY_H */ diff --git a/opal/util/trace.h b/opal/util/trace.h index fef5e34c9a..411ccb7017 100644 --- a/opal/util/trace.h +++ b/opal/util/trace.h @@ -55,16 +55,12 @@ #endif /* ENABLE_TRACE */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC extern int opal_trace_handle; OPAL_DECLSPEC void opal_trace_init(void); OPAL_DECLSPEC void opal_trace_finalize(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_TRACE_H */ diff --git a/opal/win32/ompi_inet.h b/opal/win32/ompi_inet.h index e5ecaf6b8a..fb3c7f3ba8 100644 --- a/opal/win32/ompi_inet.h +++ b/opal/win32/ompi_inet.h @@ -25,16 +25,12 @@ #error This file is supposed to be included only from win_compat.h #endif /* OMPI_WIN_COMPAT_H */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC int inet_pton(int af, const char *src, void *dst); OPAL_DECLSPEC const char *inet_ntop(int af, const void *src, char *dst, size_t size); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_INET_H */ \ No newline at end of file diff --git a/opal/win32/ompi_process.h b/opal/win32/ompi_process.h index 4a44f084ca..cbce91131a 100644 --- a/opal/win32/ompi_process.h +++ b/opal/win32/ompi_process.h @@ -25,17 +25,12 @@ #error This file is supposed to be included only from win_compat.h #endif /* OMPI_WIN_COMPAT_H */ -#if defined(c_plusplus) || defined (__cplusplus) -extern "C" -{ -#endif +BEGIN_C_DECLS OPAL_DECLSPEC pid_t waitpid (pid_t pid, int *status, int options) ; OPAL_DECLSPEC int kill(pid_t pid, int sig) ; -#if defined(c_plusplus) || defined (__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_PROCESS_H */ diff --git a/opal/win32/ompi_time.h b/opal/win32/ompi_time.h index 25c06eaebf..440d1d0f79 100644 --- a/opal/win32/ompi_time.h +++ b/opal/win32/ompi_time.h @@ -173,15 +173,10 @@ struct timezone int tz_dsttime; }; -#if defined(c_plusplus) || defined (__cplusplus) -extern "C" -{ -#endif +BEGIN_C_DECLS OPAL_DECLSPEC int gettimeofday (struct timeval *tv, struct timezone *tz); -#if defined(c_plusplus) || defined (__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_TIME_H */ diff --git a/opal/win32/ompi_uio.h b/opal/win32/ompi_uio.h index 26d5717bfa..c4b29f4daf 100644 --- a/opal/win32/ompi_uio.h +++ b/opal/win32/ompi_uio.h @@ -32,9 +32,7 @@ struct iovec { #define iov_base data.buf #define iov_len data.len -#if defined(c_plusplus) || defined (__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /* * writev: writev writes data to file descriptor fd, and from the buffers @@ -53,8 +51,6 @@ OPAL_DECLSPEC int writev (int fd, struct iovec *iov, int cnt); */ OPAL_DECLSPEC int readv (int fd, struct iovec *iov, int cnt); -#if defined(c_plusplus) || defined (__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_UIO_H */ diff --git a/opal/win32/ompi_utsname.h b/opal/win32/ompi_utsname.h index 0eae57eb95..5b7607ba32 100644 --- a/opal/win32/ompi_utsname.h +++ b/opal/win32/ompi_utsname.h @@ -31,12 +31,8 @@ struct utsname { char machine[OMPI_UTSNAME_LEN]; }; -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC int uname(struct utsname *un); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* oMPI_UTSNAME_H */ diff --git a/orte/mca/filem/filem.h b/orte/mca/filem/filem.h index a4a0a2f187..a443a8f326 100644 --- a/orte/mca/filem/filem.h +++ b/orte/mca/filem/filem.h @@ -34,9 +34,7 @@ #include "opal/class/opal_object.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * A set of flags that determine the type of the file @@ -369,9 +367,7 @@ ORTE_DECLSPEC extern orte_filem_base_module_t orte_filem; MCA_BASE_VERSION_2_0_0, \ "filem", 2, 0, 0 -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* ORTE_FILEM_H */ diff --git a/orte/mca/filem/rsh/filem_rsh.h b/orte/mca/filem/rsh/filem_rsh.h index a47f22b7f0..3c62b5b962 100644 --- a/orte/mca/filem/rsh/filem_rsh.h +++ b/orte/mca/filem/rsh/filem_rsh.h @@ -29,9 +29,7 @@ #include "opal/mca/mca.h" #include "orte/mca/filem/filem.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS #define ORTE_FILEM_RSH_ASK 0 #define ORTE_FILEM_RSH_ALLOW 1 @@ -79,8 +77,6 @@ extern "C" { int orte_filem_rsh_wait( orte_filem_base_request_t *request); int orte_filem_rsh_wait_all( opal_list_t *request_list); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* MCA_FILEM_RSH_EXPORT_H */ diff --git a/orte/mca/plm/ccp/plm_ccp.h b/orte/mca/plm/ccp/plm_ccp.h index 2e28d4c8e7..273229ad33 100644 --- a/orte/mca/plm/ccp/plm_ccp.h +++ b/orte/mca/plm/ccp/plm_ccp.h @@ -19,9 +19,7 @@ #include "opal/mca/mca.h" #include "orte/mca/plm/plm.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct orte_plm_ccp_component_t { orte_plm_base_component_t super; @@ -39,8 +37,6 @@ typedef struct orte_plm_ccp_component_t orte_plm_ccp_component_t; ORTE_DECLSPEC extern orte_plm_ccp_component_t mca_plm_ccp_component; extern orte_plm_base_module_t orte_plm_ccp_module; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* ORTE_plm_CCP_EXPORT_H */ diff --git a/orte/mca/ras/ccp/ras_ccp.h b/orte/mca/ras/ccp/ras_ccp.h index 975559e770..aa0e436882 100644 --- a/orte/mca/ras/ccp/ras_ccp.h +++ b/orte/mca/ras/ccp/ras_ccp.h @@ -24,9 +24,7 @@ #include "orte/mca/ras/ras.h" #include "orte/mca/ras/base/base.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct orte_ras_ccp_component_t { /** Base RAS component */ @@ -39,8 +37,6 @@ extern "C" { ORTE_DECLSPEC extern orte_ras_ccp_component_t mca_ras_ccp_component; ORTE_DECLSPEC extern orte_ras_base_module_t orte_ras_ccp_module; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/orte/mca/ras/gridengine/ras_gridengine.h b/orte/mca/ras/gridengine/ras_gridengine.h index 9950a0001d..17d6be522a 100644 --- a/orte/mca/ras/gridengine/ras_gridengine.h +++ b/orte/mca/ras/gridengine/ras_gridengine.h @@ -28,9 +28,7 @@ #include "orte/mca/ras/ras.h" #include "orte/mca/ras/base/base.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** @@ -49,8 +47,6 @@ ORTE_DECLSPEC extern orte_ras_gridengine_component_t mca_ras_gridengine_componen ORTE_DECLSPEC extern orte_ras_base_module_t orte_ras_gridengine_module; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/orte/mca/ras/loadleveler/ras_loadleveler.h b/orte/mca/ras/loadleveler/ras_loadleveler.h index a35eaca5fa..be8f573c8d 100644 --- a/orte/mca/ras/loadleveler/ras_loadleveler.h +++ b/orte/mca/ras/loadleveler/ras_loadleveler.h @@ -27,15 +27,11 @@ #include "orte/mca/ras/ras.h" #include "orte/mca/ras/base/base.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS ORTE_DECLSPEC extern orte_ras_base_component_t mca_ras_loadleveler_component; ORTE_DECLSPEC extern orte_ras_base_module_t orte_ras_loadleveler_module; -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/orte/mca/rmaps/rank_file/rmaps_rank_file_lex.h b/orte/mca/rmaps/rank_file/rmaps_rank_file_lex.h index c18eaa9dbd..7321d3b213 100644 --- a/orte/mca/rmaps/rank_file/rmaps_rank_file_lex.h +++ b/orte/mca/rmaps/rank_file/rmaps_rank_file_lex.h @@ -35,9 +35,7 @@ #include -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS typedef union { int ival; @@ -77,9 +75,7 @@ int orte_rmaps_rank_file_wrap(void); #define ORTE_RANKFILE_SLOT 15 #define ORTE_RANKFILE_RELATIVE 16 -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/orte/mca/rml/ftrm/rml_ftrm.h b/orte/mca/rml/ftrm/rml_ftrm.h index 59f8b4c193..7de13cbfc2 100644 --- a/orte/mca/rml/ftrm/rml_ftrm.h +++ b/orte/mca/rml/ftrm/rml_ftrm.h @@ -27,9 +27,7 @@ #include "orte/mca/rml/rml.h" #include "orte/mca/rml/rml_types.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS extern int rml_ftrm_output_handle; @@ -165,8 +163,6 @@ extern "C" { */ int orte_rml_ftrm_ft_event(int state); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif diff --git a/orte/util/hostfile/hostfile_lex.l b/orte/util/hostfile/hostfile_lex.l index 50119168dc..133da73af1 100644 --- a/orte/util/hostfile/hostfile_lex.l +++ b/orte/util/hostfile/hostfile_lex.l @@ -28,15 +28,11 @@ /* * local functions */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif /* defined(c_plusplus) || defined(__cplusplus) */ +BEGIN_C_DECLS int orte_util_hostfile_wrap(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif /* defined(c_plusplus) || defined(__cplusplus) */ +END_C_DECLS int orte_util_hostfile_wrap(void) { diff --git a/test/support/components.h b/test/support/components.h index 1021cbbcac..6db1f0d7c1 100644 --- a/test/support/components.h +++ b/test/support/components.h @@ -23,9 +23,7 @@ #include "opal/libltdl/ltdl.h" #include "opal/mca/mca.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Generic function pointer, suitable for casting @@ -80,8 +78,6 @@ extern "C" { int test_component_close(test_component_handle_t *handle); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OMPI_SUPPORT_COMPONENTS_H */