Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2017-10-17 00:00:00Z and 2017-10-18 00:00:00Z
Avatar
dfc53b4 Fix victim handling - heinrich5991 5aca38e Merge #902 - bors[bot]
Avatar
what actually boris does?
Avatar
<Learath2> boris makes sure the CI tests pass before merging, also it checks whether merging pr A breaks the tests for merging pr B
Avatar
This still has a heap-use-after-free but I couldn't really figure out how to get rid of that one without making lots of changes. The CJob being a part of CFetchTask turned out to be a problem as if I free the CFetchTask the job result can no longer be written. If Destroy() is called after the job is done the free works as expected, otherwise we are either leaking memory, or using after free.
13:44
Not sure if this is the best way to go about this, but it works :/
Avatar
ddnet\src\engine\client\backend_sdl.cpp:561:41: error: 'putenv' was not declared in this scope putenv("SDL_VIDEO_WINDOW_POS=center"); // ignore_convention
14:03
mingw :/
Avatar
try _putenv
Avatar
error: '_putenv' was not declared in this scope
Avatar
is stdlib.h included?
14:05
if not, try that
Avatar
added it, not wokring
14:06
my ide tells me that include is not being used also
14:07
same with cstdlib
14:13
i wonder why it even uses getenv and putenv for sdl flags
14:13
oh, i just noticed they modernized the sdl documentation, neat http://sdl.beuc.net/sdl.wiki/FrontPage
14:14
(oh nvm, this is not the oficial docs..)
14:15
i guess for some reason mingw decided not to include putenv in the headers??
Avatar
putenv is not a standard C function
Avatar
yeah, i meant stdlib.h and cstdlib
Avatar
yes. but it's not a standard C function, so they aren't obliged to put it in there
Avatar
so what can i do?
Avatar
I'm looking for a soltuion
Avatar
and why would they define _CRTIMP __cdecl __MINGW_NOTHROW char *getenv (const char *); and not putenv
14:17
makes no sense to me
Avatar
(you could also google it)
14:18
to just hackily compile it, you could put a int putenv(char *string); above the function that uses it
Avatar
i found why
14:19
the putenv declaration is inside #if !defined (_STRICT_ANSI)
14:19
#if !defined (__STRICT_ANSI__)
14:19
and it looks like its defined for some reason (in mingw?)
14:22
your fix doesnt work, int putenv(const char*); undefined reference to `putenv(char const*)'
Avatar
ok
14:23
maybe try int _putenv(const char *); #define putenv _putenv
Avatar
undefined reference to `_putenv(char const*)'
Avatar
mhhh
14:28
tried extern int putenv(const char *); but also doesnt work
Avatar
extern is the same as without for function prototypes
14:29
I don't know. were you able to compile it with mingw in the past?
Avatar
ah, never used extern before, i found it on internet
14:29
i think yes
14:29
its weird..
14:29
I'm trying to compile a library on windows with mingw, that uses boost. I compiled boost with: bootstrap mingw b2 toolset=gcc After that I build the library with cmake and mingw. Building the ...
14:29
in this answer they say mingw doesnt define putenv
14:30
#ifdef __MINGW32__ // Mingw doesn't define putenv() needed by Boost.Test extern int putenv(char*); #endif
Avatar
wait
14:30
you wrote const char *. can you try char *?
Avatar
or even
14:31
extern "C" { int putenv(char *); }
Avatar
i tried also extern int _putenv(char *);
14:31
with _
14:31
warning: ISO C++ forbids converting a string constant to 'char*'
14:31
this means it could work?
Avatar
yes
Avatar
but adding const makes it undefined reference
Avatar
have you done the extern "C" version? maybe with const to get rid of the warning?
Avatar
extern "C" { int putenv(const char *); }
14:33
this worked
Avatar
cool 🙂
Avatar
#ifdef __MINGW32__ extern "C" { int putenv(const char *); } #endif i guess this is how it shold be (edited)
Avatar
this is a workaround, hopefully, there's a better fix
Avatar
I'd prefer a better version tbh
Avatar
if u know it ^^
Avatar
no, I don't
14:35
and I'm gone now
Avatar
cya then
Avatar
Seems like putenv is not defined in mingw. (i couldn't compile the client without this, with mingw) Heinrich prefers a better version so maybe don't merge yet.
22:40
[ddnet/ddnet] New branch created: staging.tmp
22:40
3408d4f MinGW putenv workaround. - Ryozuki 7e83471 [ci skip] -bors-staging-tmp-905 - bors[bot]
22:40
3408d4f MinGW putenv workaround. - Ryozuki aa5f2d6 Merge #905 - bors[bot]
Avatar
semester started btw, I'll have less time for ddnet now :/
Exported 82 message(s)