VirtualBox

Changeset 7207 in vbox for trunk/src/VBox/Main/idl/midl.xsl


Ignore:
Timestamp:
Feb 28, 2008 6:43:08 PM (17 years ago)
Author:
vboxsync
Message:

Main: Reworked enums to avoid 1) weird duplication of enum name when referring to enum values in cross-platform code; 2) possible clashes on Win32 due to putting identifiers like Paused or Disabled to the global namespace (via C enums). In the new style, enums are used like this: a) USBDeviceState_T v = USBDeviceState_Busy from cross-platform non-Qt code; b) KUSBDeviceState v = KUSBDeviceState_Busy from Qt code; c) USBDeviceState v = USBDeviceState_Busy from plain Win32 and d) PRUInt32 USBDeviceState v = USBDeviceState::Busy from plain XPCOM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/midl.xsl

    r6851 r7207  
    379379    <xsl:for-each select="const">
    380380        <xsl:text>    </xsl:text>
    381         <xsl:value-of select="@name"/> = <xsl:value-of select="@value"/>
     381        <xsl:value-of select="concat(../@name,'_',@name)"/> = <xsl:value-of select="@value"/>
    382382        <xsl:choose>
    383383            <xsl:when test="position()!=last()"><xsl:text>,&#x0A;</xsl:text></xsl:when>
     
    392392    <xsl:value-of select="concat('cpp_quote(&quot;#define ', @name, '_T', ' ',
    393393                                 @name, '&quot;)&#x0A;&#x0A;')"/>
    394     <xsl:text>cpp_quote("")&#x0A;</xsl:text>
    395     <!-- -->
    396     <xsl:value-of select="concat('/* cross-platform constants for ', @name, ' */&#x0A;')"/>
    397     <xsl:for-each select="const">
    398         <xsl:value-of select="concat('cpp_quote(&quot;#define ', ../@name, '_', @name, ' ',
    399                                      @name, '&quot;)&#x0A;')"/>
    400         <xsl:choose>
    401             <xsl:when test="position()=last()"><xsl:text>cpp_quote("")&#x0A;</xsl:text></xsl:when>
    402         </xsl:choose>
    403     </xsl:for-each>
    404394    <xsl:text>&#x0A;&#x0A;</xsl:text>
    405395</xsl:template>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette