`CreateDirectory` might clash with the `CreateDirectoryA`/`CreateDirectoryW` macros on MSVC

pull/1/head
Daniel Cohen Gindi 10 years ago
parent b2b705aa33
commit 51d0db7107

@ -627,6 +627,10 @@ CloseUndoneFileTransfer(rfbClientPtr cl, rfbTightClientPtr rtcp)
* Method to handle create directory request.
******************************************************************************/
#ifdef _MSC_VER
#undef CreateDirectory /* Prevent macro clashes under Windows */
#endif /* _MSC_VER */
void
CreateDirectory(char* dirName)
{
@ -637,4 +641,3 @@ CreateDirectory(char* dirName)
__FILE__, __FUNCTION__, dirName);
}
}

@ -26,6 +26,11 @@
#ifndef FILE_TRANSFER_MSG_H
#define FILE_TRANSFER_MSG_H
#ifdef _MSC_VER
#pragma push_macro("CreateDirectory")
#undef CreateDirectory /* Prevent macro clashes under Windows */
#endif /* _MSC_VER */
typedef struct _FileTransferMsg {
char* data;
unsigned int length;
@ -50,5 +55,9 @@ void CloseUndoneFileTransfer(rfbClientPtr cl, rfbTightClientPtr data);
void FreeFileTransferMsg(FileTransferMsg ftm);
#ifdef _MSC_VER
# pragma pop_macro("CreateDirectory") /* Restore original macro */
#endif /* _MSC_VER */
#endif

Loading…
Cancel
Save