summaryrefslogtreecommitdiffabout
path: root/tools
authorDennis Menschel <demichan at mail dot upb dot de>2009-03-20 23:23:05 (UTC)
committer Michael Krelin <hacker@klever.net>2009-03-22 17:15:32 (UTC)
commit87cbeba4a750b1747dd32538c9c220145169cd2c (patch) (side-by-side diff)
tree7953a6715c8ca0810cfaef4e1939fe2be534de3f /tools
parent0c21a7a0d5b84dc6726462f0fbe51b8c32433262 (diff)
downloadmidillo-87cbeba4a750b1747dd32538c9c220145169cd2c.zip
midillo-87cbeba4a750b1747dd32538c9c220145169cd2c.tar.gz
midillo-87cbeba4a750b1747dd32538c9c220145169cd2c.tar.bz2
Added missing includes for gcc 4.3HEADmaster
Added missing includes <cstring> and <cassert>, which are required/enforced by GCC 4.3. Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'tools') (more/less context) (ignore whitespace changes)
-rw-r--r--tools/mididump.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/mididump.cc b/tools/mididump.cc
index 83b7086..604bcc0 100644
--- a/tools/mididump.cc
+++ b/tools/mididump.cc
@@ -1,69 +1,70 @@
#include <getopt.h>
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
+#include <cstring>
using namespace std;
#include <konforka/exception.h>
#include <midillo/SMF.h>
using namespace midillo;
#include "config.h"
#define PHEADER PACKAGE " " VERSION " - mididump - dump midi files"
#define PCOPY "Copyright (c) 2006 Klever Group"
static void usage(const char *p) {
cerr << PHEADER << endl
<< PCOPY << endl << endl
<< " " << p << " [options] [<input-file>[ <output-file>]]" << endl << endl
<< " -h, --help" << endl
<< " --usage display this text" << endl
<< " -V, --version display version number" << endl
<< " -L, --license show license" << endl;
}
main(int argc,char **argv) {
try {
while(true) {
static struct option opts[] = {
{ "help", no_argument, 0, 'h' },
{ "usage", no_argument, 0, 'h' },
{ "version", no_argument, 0, 'V' },
{ "license", no_argument, 0, 'L' },
{ NULL, 0, 0, 0 }
};
int c = getopt_long(argc,argv,"f:hVLl",opts,NULL);
if(c==-1)
break;
switch(c) {
case 'h':
usage(*argv);
exit(0);
break;
case 'V':
cerr << VERSION << endl;
exit(0);
break;
case 'L':
extern const char *COPYING;
cerr << COPYING << endl;
exit(0);
break;
default:
cerr << "Huh??" << endl;
break;
}
}
const char *infile = "-";
if(optind<argc)
infile = argv[optind++];
const char *oufile = "-";
if(optind<argc)
oufile = argv[optind++];
if(optind<argc) {
usage(*argv);
exit(1);
}
SMF_t in(infile);
if(strcmp(oufile,"-")) {
ofstream s(oufile); s << in;