vbox: Add support for 5.2.x

Simply add the 5.2 SDK header to the existing unified framework. No
other special handling is needed as there's no API break between
existing 5.1 and the just added 5.2.
This commit is contained in:
Dawid Zamirski 2017-11-07 17:36:34 -05:00 committed by John Ferlan
parent 8f1c88d9d0
commit 0eda09f490
6 changed files with 21 additions and 0 deletions

View File

@ -881,6 +881,7 @@ VBOX_DRIVER_SOURCES = \
vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h \ vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h \
vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h \ vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h \
vbox/vbox_V5_1.c vbox/vbox_CAPI_v5_1.h \ vbox/vbox_V5_1.c vbox/vbox_CAPI_v5_1.h \
vbox/vbox_V5_2.c vbox/vbox_CAPI_v5_2.h \
vbox/vbox_common.c vbox/vbox_common.h \ vbox/vbox_common.c vbox/vbox_common.h \
vbox/vbox_uniformed_api.h \ vbox/vbox_uniformed_api.h \
vbox/vbox_get_driver.h \ vbox/vbox_get_driver.h \

13
src/vbox/vbox_V5_2.c Normal file
View File

@ -0,0 +1,13 @@
/** @file vbox_V5_2.c
* C file to include support for multiple versions of VirtualBox
* at runtime.
*/
#include <config.h>
/** The API Version */
#define VBOX_API_VERSION 5002000
/** Version specific prefix. */
#define NAME(name) vbox52##name
#include "vbox_tmpl.c"

View File

@ -446,6 +446,8 @@ typedef nsISupports IKeyboard;
vbox50InstallUniformedAPI(&gVBoxAPI); \ vbox50InstallUniformedAPI(&gVBoxAPI); \
} else if (uVersion >= 5000051 && uVersion < 5001051) { \ } else if (uVersion >= 5000051 && uVersion < 5001051) { \
vbox51InstallUniformedAPI(&gVBoxAPI); \ vbox51InstallUniformedAPI(&gVBoxAPI); \
} else if (uVersion >= 5001051 && uVersion < 5002051) { \
vbox52InstallUniformedAPI(&gVBoxAPI); \
} else { \ } else { \
result = -1; \ result = -1; \
} \ } \

View File

@ -902,6 +902,8 @@ virStorageDriverPtr vboxGetStorageDriver(uint32_t uVersion)
vbox50InstallUniformedAPI(&gVBoxAPI); vbox50InstallUniformedAPI(&gVBoxAPI);
} else if (uVersion >= 5000051 && uVersion < 5001051) { } else if (uVersion >= 5000051 && uVersion < 5001051) {
vbox51InstallUniformedAPI(&gVBoxAPI); vbox51InstallUniformedAPI(&gVBoxAPI);
} else if (uVersion >= 5001051 && uVersion < 5002051) {
vbox52InstallUniformedAPI(&gVBoxAPI);
} else { } else {
return NULL; return NULL;
} }

View File

@ -65,6 +65,8 @@
# include "vbox_CAPI_v5_0.h" # include "vbox_CAPI_v5_0.h"
#elif VBOX_API_VERSION == 5001000 #elif VBOX_API_VERSION == 5001000
# include "vbox_CAPI_v5_1.h" # include "vbox_CAPI_v5_1.h"
#elif VBOX_API_VERSION == 5002000
# include "vbox_CAPI_v5_2.h"
#else #else
# error "Unsupport VBOX_API_VERSION" # error "Unsupport VBOX_API_VERSION"
#endif #endif

View File

@ -564,5 +564,6 @@ void vbox43InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
void vbox43_4InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); void vbox43_4InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
void vbox50InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); void vbox50InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
void vbox51InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); void vbox51InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
void vbox52InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
#endif /* VBOX_UNIFORMED_API_H */ #endif /* VBOX_UNIFORMED_API_H */