return serverGeneration;
}
+void vncFatalError(const char *format, ...)
+{
+ va_list args;
+ char buffer[4096];
+
+ va_start(args, format);
+ vsnprintf(buffer, sizeof(buffer), format, args);
+ va_end(args);
+
+ FatalError("%s", buffer);
+}
+
int vncGetScreenCount(void)
{
return screenInfo.numScreens;
extern "C" {
#endif
+#ifdef __GNUC__
+# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b)))
+# define __noreturn_attr __attribute__((noreturn))
+#else
+# define __printf_attr(a, b)
+# define __noreturn_attr
+#endif // __GNUC__
+
const char *vncGetDisplay(void);
unsigned long vncGetServerGeneration(void);
+void vncFatalError(const char *format, ...) __printf_attr(1, 2) __noreturn_attr;
+
int vncGetScreenCount(void);
void vncGetScreenFormat(int scrIdx, int *depth, int *bpp,
void vncRefreshScreenLayout(int scrIdx)
{
- desktop[scrIdx]->refreshScreenLayout();
+ try {
+ desktop[scrIdx]->refreshScreenLayout();
+ } catch (rdr::Exception& e) {
+ vncFatalError("%s", e.str());
+ }
}
int vncOverrideParam(const char *nameAndValue)