Revision: 1505
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1505&view=rev
Author: roman_yakovenko
Date: 2008-12-26 23:28:13 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
porting to linux
Modified Paths:
--------------
pygccxml_dev/pygccxml/msvc/common_utils.py
Modified: pygccxml_dev/pygccxml/msvc/common_utils.py
===================================================================
--- pygccxml_dev/pygccxml/msvc/common_utils.py 2008-12-26 09:43:47 UTC (rev 1504)
+++ pygccxml_dev/pygccxml/msvc/common_utils.py 2008-12-26 23:28:13 UTC (rev 1505)
@@ -5,8 +5,8 @@
import os
import re
+import sys
import ctypes
-import ctypes.wintypes
from .. import declarations
class UNDECORATE_NAME_OPTIONS:
@@ -77,15 +77,17 @@
#~ return undecorated_name.value
class undname_creator:
- __undname = ctypes.windll.dbghelp.UnDecorateSymbolName
- __undname.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_uint, ctypes.c_uint]
- __clean_ecsu = re.compile( r'(?:(^|\W))(?:(class|enum|struct|union))' )
- __fundamental_types = (
- ( 'short unsigned int', 'unsigned short')
- , ( 'short int', 'short' )
- , ( 'long int', 'long' )
- , ( 'long unsigned int', 'unsigned long' )
- )
+ def __init__( self ):
+ import ctypes.wintypes
+ self.__undname = ctypes.windll.dbghelp.UnDecorateSymbolName
+ self.__undname.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_uint, ctypes.c_uint]
+ self.__clean_ecsu = re.compile( r'(?:(^|\W))(?:(class|enum|struct|union))' )
+ self.__fundamental_types = (
+ ( 'short unsigned int', 'unsigned short')
+ , ( 'short int', 'short' )
+ , ( 'long int', 'long' )
+ , ( 'long unsigned int', 'unsigned long' )
+ )
def undecorate_blob( self, name, options=None ):
if options is None:
@@ -182,10 +184,15 @@
raise NotImplementedError()
return self.__normalize( name )
+if 'win' in sys.platform:
+ undecorate_blob = undname_creator().undecorate_blob
+ undecorate_decl = undname_creator().undecorated_decl
+else:
+ def undecorate_blob( x ):
+ raise NotImplementedError()
+ def undecorate_decl( x ):
+ raise NotImplementedError()
-undecorate_blob = undname_creator().undecorate_blob
-undecorate_decl = undname_creator().undecorated_decl
-
import exceptions
class LicenseWarning( exceptions.UserWarning ):
def __init__( self, *args, **keywd ):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|