Changeset 48

Show
Ignore:
Timestamp:
11/30/06 14:25:57 (2 years ago)
Author:
KirkMcDonald
Message:

Conditionalized StackThreads? use in Pyd.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dcompiler.py

    r46 r48  
    158158        # And Pyd! 
    159159        if not flags[0]: 
     160            # If we're not using StackThreads, don't use iteration.d in Pyd 
     161            if flags[1]: 
     162                _pydFiles.remove('iteration.d'); 
    160163            for file in _pydFiles: 
    161164                filePath = os.path.join(_infraDir, 'pyd', file) 
     
    174177                    ) 
    175178                sources.append(filePath) 
     179            # Add the version conditional for st 
     180            macros.append(('Pyd_with_StackThreads', 'version')) 
    176181        # And meta 
    177182        if not flags[2]: 
  • trunk/html_doc/celerid.html

    r46 r48  
    5555    <dt><code>raw_only</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of Pyd, StackThreads, and meta. This is useful if you only want to write a raw Python/C extension without the overhead of Pyd and its auxiliary packages. This is equivalent to specifying <code>True</code> to the next three flags.</dd> 
    5656    <dt><code>no_pyd</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of Pyd. This is useful if you want to write a raw Python/C extension and don't want the overhead of compiling Pyd.</dd> 
    57     <dt><code>no_st</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of StackThreads. Because Pyd depends on StackThreads, an exception will be raised if this is specified and <code>no_pyd</code> is not.</dd> 
     57    <dt><code>no_st</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of StackThreads. Pyd uses StackThreads for its iteration wrapping support. By specifying this, opApply wrapping, <code>wrapped_class.iter</code>, and <code>wrapped_class.alt_iter</code> will be unavailable. If <code>no_pyd</code> and this are <code>False</code>, then the <code>Pyd_with_StackThreads</code> version flag will be defined (which is used internally by Pyd).</dd> 
    5858    <dt><code>no_meta</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of <code>meta</code> (Pyd's metaprogramming package). Because Pyd depends on meta, an exception will be raised if this is specified and <code>no_pyd</code> is not.</dd> 
    5959    </dl> 
  • trunk/infrastructure/pyd/class_wrap.d

    r45 r48  
    2929    import pyd.exception; 
    3030    import pyd.func_wrap; 
    31     import pyd.iteration; 
     31    version(Pyd_with_StackThreads) { 
     32        import pyd.iteration; 
     33    } 
    3234    import pyd.make_object; 
    3335    import pyd.op_wrap; 
     
    322324        } 
    323325 
     326        // Iteration wrapping support requires StackThreads 
     327        version(Pyd_with_StackThreads) { 
     328 
    324329        /** 
    325330         * Allows selection of alternate opApply overloads. iter_t should be 
     
    349354            wrapped_class_type!(T).tp_methods = list; 
    350355        } 
     356 
     357        } /*Pyd_with_StackThreads*/ 
    351358    } 
    352359} 
     
    391398    // Standard operator overloads 
    392399    // opApply 
    393     static if (is(typeof(&T.opApply))) { 
    394         if (type.tp_iter is null) { 
    395             DPySC_Ready(); 
    396             type.tp_iter = &wrapped_iter!(T, T.opApply).iter; 
     400    version(Pyd_with_StackThreads) { 
     401        static if (is(typeof(&T.opApply))) { 
     402            if (type.tp_iter is null) { 
     403                DPySC_Ready(); 
     404                type.tp_iter = &wrapped_iter!(T, T.opApply).iter; 
     405            } 
    397406        } 
    398407    } 
  • trunk/support.py

    r46 r48  
    4848        no_st   = kwargs.pop('no_st', False) 
    4949        no_meta = kwargs.pop('no_meta', False) 
    50         if not no_pyd and (no_st or no_meta)
     50        if not no_pyd and no_meta
    5151            raise DistutilsOptionError( 
    52                 'Cannot specify no_st or no_meta while using Pyd. Specify' 
     52                'Cannot specify no_meta while using Pyd. Specify' 
    5353                ' raw_only or no_pyd if you want to compile a raw Python/C' 
    5454                ' extension.'