[ctypes-commit] ctypes/sandbox/tools/codegen _makexml.py,1.3,1.4
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-01-14 14:28:09
|
Update of /cvsroot/ctypes/ctypes/sandbox/tools/codegen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14497 Modified Files: _makexml.py Log Message: A slightly simpler C++ template speeds the script up from 62 sec to 27 sec (!). Index: _makexml.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/sandbox/tools/codegen/_makexml.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _makexml.py 14 Jan 2005 14:15:01 -0000 1.3 --- _makexml.py 14 Jan 2005 14:28:00 -0000 1.4 *************** *** 3,6 **** --- 3,8 ---- import typedesc + import time + start = time.clock() # C keywords, according to MSDN, plus some additional *************** *** 234,242 **** ofi = create_file() MAGIC = """ ! #define DECLARE(sym) \ ! template <typename T> T symbol_##sym(T, T val = sym) {} - #define DEFINE(sym) \ - symbol_##sym(sym, sym) """ ofi.write(MAGIC) --- 236,242 ---- ofi = create_file() MAGIC = """ ! #define DECLARE(sym) template <typename T> T symbol_##sym(T) {} ! #define DEFINE(sym) symbol_##sym(sym) """ ofi.write(MAGIC) *************** *** 284,285 **** --- 284,287 ---- print "... finding preprocessor symbol values" os.system("gccxml glut.cpp -fxml=glut.xml") + + print "took %.2f seconds" % (time.clock() - start) |