Changeset 72973 in vbox for trunk/src/VBox/Main/idl
- Timestamp:
- Jul 8, 2018 1:23:58 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123525
- Location:
- trunk/src/VBox/Main/idl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/comimpl.xsl
r60977 r72973 303 303 <xsl:choose> 304 304 <xsl:when test="@safearray='yes'"> 305 <xsl:variable name="elemtype"> 306 <xsl:call-template name="typeIdl2Back"> 307 <xsl:with-param name="type" select="@type" /> 308 <xsl:with-param name="safearray" select="''" /> 309 <xsl:with-param name="dir" select="'in'" /> 310 </xsl:call-template> 311 </xsl:variable> 312 <xsl:value-of select=" '#ifdef RT_OS_WINDOWS '"/> 313 <xsl:value-of select="concat(' SAFEARRAY *aPtr_', @name, ' = va_arg(args, SAFEARRAY *); ')"/> 314 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aPtr_', @name, '); ')"/> 315 <xsl:value-of select=" '#else '"/> 316 <xsl:value-of select="concat(' PRUint32 aArrSize_', @name, ' = va_arg(args, PRUint32); ')"/> 317 <xsl:value-of select="concat(' void* aPtr_', @name, ' = va_arg(args, void*); ')"/> 318 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aArrSize_', @name, ', (', $elemtype,'*)aPtr_', @name, '); ')"/> 319 <xsl:value-of select=" '#endif '"/> 320 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(ComSafeArrayAsInParam(aArr_', @name, ')); ')"/> 305 <xsl:variable name="elemtype"> 306 <xsl:call-template name="typeIdl2Back"> 307 <xsl:with-param name="type" select="@type" /> 308 <xsl:with-param name="safearray" select="''" /> 309 <xsl:with-param name="dir" select="'in'" /> 310 </xsl:call-template> 311 </xsl:variable> 312 <xsl:value-of select=" '#ifdef RT_OS_WINDOWS '"/> 313 <xsl:value-of select="concat(' SAFEARRAY *aPtr_', @name, ' = va_arg(args, SAFEARRAY *); ')"/> 314 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aPtr_', @name, '); ')"/> 315 <xsl:value-of select=" '#else '"/> 316 <xsl:value-of select="concat(' PRUint32 aArrSize_', @name, ' = va_arg(args, PRUint32); ')"/> 317 <xsl:value-of select="concat(' void* aPtr_', @name, ' = va_arg(args, void*); ')"/> 318 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aArrSize_', @name, ', (', $elemtype,'*)aPtr_', @name, '); ')"/> 319 <xsl:value-of select=" '#endif '"/> 320 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(ComSafeArrayAsInParam(aArr_', @name, ')); ')"/> 321 </xsl:when> 322 <xsl:when test="substring($aType, string-length($aType) - 1) = '_T'"> <!-- To avoid pedantic gcc warnings/errors. --> 323 <xsl:value-of select=" '#ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK '"/> 324 <xsl:value-of select="concat(' ',$aTypeName, ' = (',$aType,')va_arg(args, int); ')"/> 325 <xsl:value-of select=" '#else '"/> 326 <xsl:value-of select="concat(' ',$aTypeName, ' = va_arg(args, ',$aType,'); ')"/> 327 <xsl:value-of select=" '#endif '"/> 328 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(',$aName, '); ')"/> 321 329 </xsl:when> 322 330 <xsl:otherwise> -
trunk/src/VBox/Main/idl/xpidl.xsl
r69379 r72973 23 23 24 24 <xsl:include href="typemap-shared.inc.xsl"/> 25 26 27 <!-- - - - - - - - - - - - - - - - - - - - - - - 28 XSLT parameters 29 - - - - - - - - - - - - - - - - - - - - - - --> 30 31 <!-- xpidl doesn't support enums. This parameter performs certain hacks that helps 32 us bridge the gap and get similar behaviour as msidl. 33 34 The https://bugzilla.mozilla.org/show_bug.cgi?id=8781 bug discusses why xpidl 35 doesn't do enums. It boils down to the gcc short-enum option and similar 36 portability concerns. 37 --> 38 <xsl:param name="g_fHackEnumsOntoCppEnums" select="'no'"/> 39 25 40 26 41 <!-- … … 701 716 </xsl:for-each> 702 717 <xsl:text>};

</xsl:text> 703 <!-- --> 704 <xsl:value-of select="concat('/* cross-platform type name for ', @name, ' */
')"/> 705 <xsl:text>%{C++
</xsl:text> 706 <xsl:value-of select="concat('#define ', @name, '_T', ' ', 707 'PRUint32
')"/> 708 <xsl:text>%}

</xsl:text> 709 <!-- --> 710 <xsl:value-of select="concat('/* cross-platform constants for ', @name, ' */
')"/> 711 <xsl:text>%{C++
</xsl:text> 712 <xsl:for-each select="const"> 713 <xsl:value-of select="concat('#define ', ../@name, '_', @name, ' ', 714 ../@name, '::', @name, '
')"/> 715 </xsl:for-each> 716 <xsl:text>%}

</xsl:text> 718 <xsl:choose> 719 <xsl:when test="$g_fHackEnumsOntoCppEnums = 'yes'"> 720 <xsl:text> 721 /* IDL typedef for enum ', @name, ' */ 722 typedef PRUint32 </xsl:text><xsl:value-of select="concat(@name, '_EnumT')" /><xsl:text>; 723 724 /* C++ enum type name for ', @name, ' */ 725 %{C++ 726 typedef enum </xsl:text> 727 <xsl:value-of select="concat(@name, '_T')" /> 728 <xsl:text> { 729 </xsl:text> 730 <xsl:for-each select="const"> 731 <xsl:value-of select="concat(' ', ../@name, '_', @name, ' = ', ../@name, '::', @name, ',
')"/> 732 </xsl:for-each> 733 <xsl:value-of select="concat(' ', @name, '_32BitHack = 0x7fffffff', '
')"/> 734 <xsl:text>} </xsl:text><xsl:value-of select="concat(@name, '_T')"/><xsl:text>; 735 #ifdef AssertCompileSize 736 AssertCompileSize(</xsl:text><xsl:value-of select="concat(@name, '_T')"/><xsl:text>, sizeof(PRUint32)); 737 #endif 738 /* Use the preprocessor to replace the IDL enum typedef with our C++ enum so it will 739 behave just like we had real enum support in xpidl or if were using msidl. */ 740 #define </xsl:text><xsl:value-of select="concat(@name, '_EnumT ', @name, '_T')" /><xsl:text> 741 #ifndef VBOX_WITH_XPCOM_CPP_ENUM_HACK 742 # define VBOX_WITH_XPCOM_CPP_ENUM_HACK 1 743 #endif 744 %} 745 746 </xsl:text> 747 </xsl:when> 748 749 <xsl:otherwise> 750 <!-- --> 751 <xsl:value-of select="concat('/* cross-platform type name for ', @name, ' */
')"/> 752 <xsl:text>%{C++
</xsl:text> 753 <xsl:value-of select="concat('#define ', @name, '_T', ' ', 754 'PRUint32
')"/> 755 <xsl:text>%}

</xsl:text> 756 <!-- --> 757 <xsl:value-of select="concat('/* cross-platform constants for ', @name, ' */
')"/> 758 <xsl:text>%{C++
</xsl:text> 759 <xsl:for-each select="const"> 760 <xsl:value-of select="concat('#define ', ../@name, '_', @name, ' ', 761 ../@name, '::', @name, '
')"/> 762 </xsl:for-each> 763 <xsl:text>%}

</xsl:text> 764 </xsl:otherwise> 765 </xsl:choose> 717 766 </xsl:template> 718 767 … … 902 951 (ancestor::library/application/if[@target=$self_target]/enum[@name=current()]) 903 952 "> 904 <xsl:text>PRUint32</xsl:text> 953 <xsl:choose> 954 <xsl:when test="$g_fHackEnumsOntoCppEnums = 'yes'"> 955 <xsl:value-of select="concat(., '_EnumT')" /> 956 </xsl:when> 957 <xsl:otherwise> 958 <xsl:text>PRUint32</xsl:text> 959 </xsl:otherwise> 960 </xsl:choose> 905 961 </xsl:when> 906 962 <!-- custom interface types -->
Note:
See TracChangeset
for help on using the changeset viewer.