mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-13 16:15:48 +01:00
[WIN32] mod-script-pipe: fix compile error with GCC (#469)
When compiling with CMake and MinGW, I got these two errors:
audacity/lib-src/mod-script-pipe/PipeServer.cpp:18:29: warning: ISO C++ forbids converting a string constant to 'LPTSTR' {aka 'char*'} [-Wwrite-strings]
18 | LPTSTR pipeNameToSrv= _T("\\\\.\\pipe\\ToSrvPipe");
audacity/lib-src/mod-script-pipe/PipeServer.cpp:32:32: warning: ISO C++ forbids converting a string constant to 'LPTSTR' {aka 'char*'} [-Wwrite-strings]
32 | LPTSTR pipeNameFromSrv= __T("\\\\.\\pipe\\FromSrvPipe");
The solution is to replace LPTSTR and convert these two pointers into two const objects.
This commit is contained in:
@@ -15,7 +15,7 @@ void PipeServer()
|
|||||||
HANDLE hPipeToSrv;
|
HANDLE hPipeToSrv;
|
||||||
HANDLE hPipeFromSrv;
|
HANDLE hPipeFromSrv;
|
||||||
|
|
||||||
LPTSTR pipeNameToSrv= _T("\\\\.\\pipe\\ToSrvPipe");
|
static const TCHAR pipeNameToSrv[] = _T("\\\\.\\pipe\\ToSrvPipe");
|
||||||
|
|
||||||
hPipeToSrv = CreateNamedPipe(
|
hPipeToSrv = CreateNamedPipe(
|
||||||
pipeNameToSrv ,
|
pipeNameToSrv ,
|
||||||
@@ -29,7 +29,7 @@ void PipeServer()
|
|||||||
if( hPipeToSrv == INVALID_HANDLE_VALUE)
|
if( hPipeToSrv == INVALID_HANDLE_VALUE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LPTSTR pipeNameFromSrv= __T("\\\\.\\pipe\\FromSrvPipe");
|
static const TCHAR pipeNameFromSrv[] = __T("\\\\.\\pipe\\FromSrvPipe");
|
||||||
|
|
||||||
hPipeFromSrv = CreateNamedPipe(
|
hPipeFromSrv = CreateNamedPipe(
|
||||||
pipeNameFromSrv ,
|
pipeNameFromSrv ,
|
||||||
|
|||||||
Reference in New Issue
Block a user