These functions were part of Cygwin 1.x, but were removed in Cygwin 2.x.
Therefore we have to make some utility functions that utilizes new functions from version 2, but keeps the same name and interface (an adapter). As I needed to use some code made in 2006 I also need to accomplish this. So let's start by looking at the documentation ...
This is the function definition for the current function for converting paths
ssize_t cygwin_conv_path(
cygwin_conv_path_t what,
const void * from,
void * to,
size_t size
);
This is the function definition for the previous function for converting paths
void cygwin_posix_to_win32_path_list(const char *posix, char * win32);
Using this and the example (from the official docs), we can probably make something work.
/**
* Adapter for old Cygwin 1.x functions missing from Cygwin 2.x
*
* Based on the documentation for 1.4 and 2.x
* - http://pipeline.lbl.gov/code/3rd_party/licenses.win/cygwin-doc-1.4/html/cygwin-api/func-cygwin-posix-to-win32-path-list.html
* - https://cygwin.com/cygwin-api/func-cygwin-conv-path.html
*
*/
#include <sys/cygwin.h>
void cygwin_posix_to_win32_path_list(const char *posix, char * win32){
// We do not know the size of the win32 buffer, but hopefully
// it is at least size long ...
ssize_t size = cygwin_conv_path( CCP_POSIX_TO_WIN_A, posix, NULL, 0);
cygwin_conv_path( CCP_POSIX_TO_WIN_A, posix, win32, size);
}
There are many ways to use this to fix your code:
- copy-paste into the code
- save into adapter.c and
#include adapter.c
in the relevant code - compile it into adapter.o and link it to the other object files using
ld