mingw build fixes (tested with i686-w64-mingw32 on linux-x86_64)
[ardour.git] / libs / fst / scanner.cc
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <vector>
5
6 #include "ardour/filesystem_paths.h"
7 #ifdef LXVST_SUPPORT
8 #include "ardour/linux_vst_support.h"
9 #endif
10 #include "ardour/vst_info_file.h"
11
12 /* make stupid waf happy.
13  * waf cannot build multiple variants of .o object files from the same
14  * source using different wscripts.. it mingles e.g.
15  * build/libs/ardour/vst_info_file.cc.1.o for
16  * both lib/ardour/wscript and lib/fst/wscript
17  *
18  * ...but waf does track include dependencies.
19  */
20 #include "../ardour/vst_info_file.cc"
21 #ifdef LXVST_SUPPORT
22 #include "../ardour/linux_vst_support.cc"
23 #endif
24 #include "../ardour/filesystem_paths.cc"
25 #include "../ardour/directory_names.cc"
26 #include "../pbd/error.cc"
27 #include "../pbd/basename.cc"
28 #include "../pbd/search_path.cc"
29 #include "../pbd/transmitter.cc"
30 #include "../pbd/whitespace.cc"
31
32 #ifdef LXVST_SUPPORT
33 void
34 vstfx_destroy_editor (VSTState* /*vstfx*/) { }
35 #endif
36
37 int main (int argc, char **argv) {
38         if (argc != 2) {
39                 fprintf(stderr, "usage: %s <vst>\n", argv[0]);
40                 return EXIT_FAILURE;
41         }
42
43         char *dllpath = argv[1];
44         std::vector<VSTInfo *> *infos;
45 #ifdef LXVST_SUPPORT
46         if (strstr (dllpath, ".so")) {
47                 infos = vstfx_get_info_lx(dllpath);
48         }
49 #endif
50
51 #ifdef WINDOWS_VST_SUPPORT
52         if (strstr (dllpath, ".dll")) {
53                 infos = vstfx_get_info_fst(dllpath);
54         }
55 #endif
56
57         if (infos->empty()) {
58                 return EXIT_FAILURE;
59         } else {
60                 return EXIT_SUCCESS;
61         }
62 }
63