compat / msvc.con commit Makefile: -lpthread may still be necessary when libc has only pthread stubs (48793cf)
   1#include "../git-compat-util.h"
   2#include "win32.h"
   3#include <conio.h>
   4#include "../strbuf.h"
   5
   6DIR *opendir(const char *name)
   7{
   8        int len;
   9        DIR *p;
  10        p = (DIR*)malloc(sizeof(DIR));
  11        memset(p, 0, sizeof(DIR));
  12        strncpy(p->dd_name, name, PATH_MAX);
  13        len = strlen(p->dd_name);
  14        p->dd_name[len] = '/';
  15        p->dd_name[len+1] = '*';
  16
  17        if (p == NULL)
  18                return NULL;
  19
  20        p->dd_handle = _findfirst(p->dd_name, &p->dd_dta);
  21
  22        if (p->dd_handle == -1) {
  23                free(p);
  24                return NULL;
  25        }
  26        return p;
  27}
  28int closedir(DIR *dir)
  29{
  30        _findclose(dir->dd_handle);
  31        free(dir);
  32        return 0;
  33}
  34
  35#include "mingw.c"