OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [common/] [win32/] [StdAfx.cpp] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
2
// -------------------------------------------                              
3
// This file is part of the eCos host tools.                                
4
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
5
//
6
// This program is free software; you can redistribute it and/or modify     
7
// it under the terms of the GNU General Public License as published by     
8
// the Free Software Foundation; either version 2 or (at your option) any   
9
// later version.                                                           
10
//
11
// This program is distributed in the hope that it will be useful, but      
12
// WITHOUT ANY WARRANTY; without even the implied warranty of               
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
14
// General Public License for more details.                                 
15
//
16
// You should have received a copy of the GNU General Public License        
17
// along with this program; if not, write to the                            
18
// Free Software Foundation, Inc., 51 Franklin Street,                      
19
// Fifth Floor, Boston, MA  02110-1301, USA.                                
20
// -------------------------------------------                              
21
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
22
//#####DESCRIPTIONBEGIN####
23
//
24
// Author(s):   sdf
25
// Contact(s):  sdf
26
// Date:                1998/08/11
27
// Version:             0.01
28
// Purpose:     
29
// Description: This is the source file that includes just the standard includes
30
//                              stdafx.obj will contain the pre-compiled type information
31
//
32
// Requires:    
33
// Provides:    
34
// See also:    
35
// Known bugs:  
36
// Usage:       
37
//
38
//####DESCRIPTIONEND####
39
//
40
//===========================================================================
41
 
42
#include "stdafx.h"
43
 
44
void __Trace(LPCTSTR pszFormat, ...)
45
{
46
  va_list args;
47
  va_start(args, pszFormat);
48
  for(int nLength=100;nLength;) {
49
    TCHAR *buf=new TCHAR[1+nLength];
50
    int n=_vsntprintf(buf, nLength, pszFormat, args);
51
    if(-1==n){
52
      nLength*=2;  // NT behavior
53
    } else if (n<nLength){
54
      OutputDebugString(buf);
55
      nLength=0;   // trigger exit from loop
56
    } else {
57
      nLength=n+1; // UNIX behavior generally, or NT behavior when buffer size exactly matches required length
58
    }
59
    delete [] buf;
60
  }
61
  va_end(args);
62
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.