~ubuntu-branches/ubuntu/feisty/libxml++2.6/feisty

« back to all changes in this revision

Viewing changes to MSVC_Net2003/gendef/gendef.cc

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-11-17 14:53:51 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20061117145351-2a403c6h54pzia5l
Tags: 2.17.1-0ubuntu1
* New upstream release: 
  - Node: Added get_parent()
  - TextReader: Added TextReader(const char* data) constructor, for parsing 
    memory buffers.
  - Element::set_attribute(): Really return the new attribute.
  - Build: Added MS Visual Studio 2005 project files.
* debian/control:
  - remove duplicate doxygen build-dep.
* debian/rules, debian/libxml++2.6-doc.docs:
  - 2.14 -> 2.17.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 *  http://www.mico.org/
21
21
 */
22
22
 
 
23
/* Modified by Cedric Gustin <cedric.gustin@gmail.com> on 2006/01/13 :
 
24
 * Redirect the output of dumpbin to dumpbin.out instead of reading the
 
25
 * output stream of popen, as it fails with Visual Studio 2005 in 
 
26
 * pre-link build events.
 
27
 */
 
28
 
23
29
#include <iostream>
24
30
#include <fstream>
25
31
#include <stdio.h>
33
39
          return 2;
34
40
  }
35
41
 
36
 
  string dumpbin = "dumpbin /SYMBOLS";
 
42
  // CG : Explicitly redirect stdout to dumpbin.out.
 
43
  string dumpbin = "dumpbin /SYMBOLS /OUT:dumpbin.out";
37
44
  int i = 3;
38
45
 
39
46
  for(;i<argc;) {
43
50
 
44
51
  FILE * dump; 
45
52
  
46
 
  if( (dump = _popen( dumpbin.c_str(),"r")) == NULL ) {
 
53
  if( (dump = _popen(dumpbin.c_str(),"r")) == NULL ) {
47
54
          cerr << "could not popen dumpbin" << endl;
48
55
          return 3;
49
56
  }
50
57
 
 
58
  // CG : Wait for the dumpbin process to finish and open dumpbin.out.
 
59
  _pclose(dump);
 
60
  dump=fopen("dumpbin.out","r");
 
61
 
51
62
  ofstream def_file(argv[1]);
52
63
 
53
64
  def_file << "LIBRARY " << argv[2] << endl;
75
86
          }
76
87
  }
77
88
 
 
89
  // CG : Close dumpbin.out and delete it.
 
90
  fclose(dump);
 
91
  remove("dumpbin.out");
 
92
 
78
93
  cout << dumpbin.c_str() << endl;
79
94
}