Revision 0a1574bb os-win32.c

b/os-win32.c
34 34
#include "qemu-options.h"
35 35

  
36 36
/***********************************************************/
37
/* Functions missing in mingw */
38

  
39
int setenv(const char *name, const char *value, int overwrite)
40
{
41
    int result = 0;
42
    if (overwrite || !getenv(name)) {
43
        size_t length = strlen(name) + strlen(value) + 2;
44
        char *string = qemu_malloc(length);
45
        snprintf(string, length, "%s=%s", name, value);
46
        result = putenv(string);
47
    }
48
    return result;
49
}
50

  
51
/***********************************************************/
37 52
/* Polling handling */
38 53

  
39 54
typedef struct PollingEntry {

Also available in: Unified diff