From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Wed, 27 Jun 2018 19:02:09 +0000 (+0000) Subject: ICU-13814 Visual Studio IntelliSense should ignore the 'urename.h' content so that... X-Git-Tag: last-svn-commit~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b0a30d6e71f6d9c1a123f3f3c72056dedda789f;p=icu ICU-13814 Visual Studio IntelliSense should ignore the 'urename.h' content so that 'Go-to-Definition' (F12) will actually work in the IDE. X-SVN-Rev: 41551 --- diff --git a/icu4c/source/common/unicode/urename.h b/icu4c/source/common/unicode/urename.h index 4175e527f40..523fcc1523a 100644 --- a/icu4c/source/common/unicode/urename.h +++ b/icu4c/source/common/unicode/urename.h @@ -33,6 +33,9 @@ #if !U_DISABLE_RENAMING +// Disable Renaming for Visual Studio's IntelliSense feature, so that 'Go-to-Definition' (F12) will work. +#if defined(_MSC_VER) && defined(__INTELLISENSE__) + /* We need the U_ICU_ENTRY_POINT_RENAME definition. There's a default one in unicode/uvernum.h we can use, but we will give the platform a chance to define it first. Normally (if utypes.h or umachine.h was included first) this will not be necessary as it will already be defined. @@ -1827,6 +1830,8 @@ #define ztrans_setTime U_ICU_ENTRY_POINT_RENAME(ztrans_setTime) #define ztrans_setTo U_ICU_ENTRY_POINT_RENAME(ztrans_setTo) -#endif +#endif /* defined(_MSC_VER) && defined(__INTELLISENSE__) */ -#endif +#endif /* U_DISABLE_RENAMING */ + +#endif /* URENAME_H */ diff --git a/icu4c/source/tools/genren/genren.pl b/icu4c/source/tools/genren/genren.pl index 8859a27ef57..d9a6d88a5d6 100755 --- a/icu4c/source/tools/genren/genren.pl +++ b/icu4c/source/tools/genren/genren.pl @@ -106,6 +106,9 @@ print HEADER <<"EndOfHeaderComment"; #if !U_DISABLE_RENAMING +// Disable Renaming for Visual Studio's IntelliSense feature, so that 'Go-to-Definition' (F12) will work. +#if defined(_MSC_VER) && defined(__INTELLISENSE__) + /* We need the U_ICU_ENTRY_POINT_RENAME definition. There's a default one in unicode/uvernum.h we can use, but we will give the platform a chance to define it first. Normally (if utypes.h or umachine.h was included first) this will not be necessary as it will already be defined. @@ -236,8 +239,15 @@ foreach(sort keys(%CFuncs)) { # print HEADER "#define $_ $_$U_ICU_VERSION_SUFFIX\n"; } -print HEADER "\n#endif\n"; -print HEADER "\n#endif\n"; + +print HEADER <<"EndOfHeaderFooter"; + +#endif /* defined(_MSC_VER) && defined(__INTELLISENSE__) */ +#endif /* U_DISABLE_RENAMING */ +#endif /* URENAME_H */ + +EndOfHeaderFooter + close HEADER;