Revision 976aaedca0c6f64b37f4241bf06fa7ab06095986 authored by Johannes Schindelin on 29 July 2019, 20:08:12 UTC, committed by Junio C Hamano on 29 July 2019, 21:51:43 UTC
The entire idea of generating the VS solution makes only sense if we
generate it via Continuous Integration; otherwise potential users would
still have to download the entire Git for Windows SDK.

If we pre-generate the Visual Studio solution, Git can be built entirely
within Visual Studio, and the test scripts can be run in a regular Git
for Windows (e.g. the Portable Git flavor, which does not include a full
GCC toolchain and therefore weighs only about a tenth of Git for
Windows' SDK).

So let's just add a target in the Makefile that can be used to generate
said solution; The generated files will then be committed so that they
can be pushed to a branch ready to check out by Visual Studio users.

To make things even more useful, we also generate and commit other files
that are required to run the test suite, such as templates and
bin-wrappers: with this, developers can run the test suite in a regular
Git Bash after building the solution in Visual Studio.

Note: for this build target, we do not actually need to initialize the
`vcpkg` system, so we don't.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 384a61b
Raw File
precompose_utf8.h
#ifndef PRECOMPOSE_UNICODE_H
#define PRECOMPOSE_UNICODE_H

#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include <iconv.h>


typedef struct dirent_prec_psx {
	ino_t d_ino;            /* Posix */
	size_t max_name_len;    /* See below */
	unsigned char d_type;   /* available on all systems git runs on */

	/*
	 * See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html
	 * NAME_MAX + 1 should be enough, but some systems have
	 * NAME_MAX=255 and strlen(d_name) may return 508 or 510
	 * Solution: allocate more when needed, see precompose_utf8_readdir()
	 */
	char   d_name[NAME_MAX+1];
} dirent_prec_psx;


typedef struct {
	iconv_t ic_precompose;
	DIR *dirp;
	struct dirent_prec_psx *dirent_nfc;
} PREC_DIR;

void precompose_argv(int argc, const char **argv);
void probe_utf8_pathname_composition(void);

PREC_DIR *precompose_utf8_opendir(const char *dirname);
struct dirent_prec_psx *precompose_utf8_readdir(PREC_DIR *dirp);
int precompose_utf8_closedir(PREC_DIR *dirp);

#ifndef PRECOMPOSE_UNICODE_C
#define dirent dirent_prec_psx
#define opendir(n) precompose_utf8_opendir(n)
#define readdir(d) precompose_utf8_readdir(d)
#define closedir(d) precompose_utf8_closedir(d)
#define DIR PREC_DIR
#endif /* PRECOMPOSE_UNICODE_C */

#endif /* PRECOMPOSE_UNICODE_H */
back to top