@@ -39,7 +39,11 @@ extern String gUploadPrefix;
3939static ::cl::list<String> uri_args (::cl::Positional, ::cl::desc(" sw uri arguments" ), ::cl::sub(subcommand_uri));
4040
4141#define F_ARGS sw::SwContext &swctx, sw::LocalStorage &sdb, const sw::LocalPackage &p
42+ #ifdef _MSC_VER
4243#define F (n, ...) static void n (F_ARGS, __VA_ARGS__)
44+ #else
45+ #define F (n, ...) static void n (F_ARGS, ##__VA_ARGS__)
46+ #endif
4347
4448F (open_dir, const path &d)
4549{
@@ -187,15 +191,25 @@ static void dispatcher()
187191 auto &sdb = swctx->getLocalStorage ();
188192 sw::LocalPackage p (sdb, id);
189193
194+ #ifdef _MSC_VER
190195#define URI_CMD2 (x, f, ...) \
191- if (uri_args[0 ] == " sw:" ## #x) \
196+ if (uri_args[0 ] == " sw:" #x) \
192197 { \
193198 f (*swctx, sdb, p, __VA_ARGS__); \
194199 return ; \
195200 }
196-
197201#define URI_CMD (x, ...) \
198202 URI_CMD2 (x, x, __VA_ARGS__)
203+ #else
204+ #define URI_CMD2 (x, f, ...) \
205+ if (uri_args[0 ] == " sw:" #x) \
206+ { \
207+ f (*swctx, sdb, p, ##__VA_ARGS__); \
208+ return ; \
209+ }
210+ #define URI_CMD (x, ...) \
211+ URI_CMD2 (x, x, ##__VA_ARGS__)
212+ #endif
199213
200214 URI_CMD2 (sdir, open_dir, p.getDirSrc2 ());
201215 URI_CMD2 (bdir, open_dir, p.getDirObj ());
0 commit comments