Date: Sun, 4 May 1997 18:19:32 +0300 (IDT) From: Nadav Eiron <nadav@barcode.co.il> To: hackers@freebsd.org Subject: /usr/include/ftpio.h is not C++ safe Message-ID: <Pine.BSF.3.91.970504174746.26341A-200000@gatekeeper.barcode.co.il>
next in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1674567254-862759172=:26341 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, This is a second try on this, following some comments from Chuck Robey. /usr/include/ftpio.h (the same as src/lib/libftpio/ftpio.h) does not work with C++ files. It compiles, but missing extern "C" on all externs, it does not link correctly. I know most of FreeBSD is not C++, but I think having files from /usr/include work correctly is worth the effort (anyhow, I needed ftp access from a C++ program, and libftpio seems to do the job right). Well, here is the diff for the changes (it should also make it compile under K&R). The diff is against 2.1.7, but it's the same for 2.2.1 (sorry, I don't run -current here). comments? --0-1674567254-862759172=:26341 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ftpio.h.diff" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.BSF.3.91.970504181932.26341B@gatekeeper.barcode.co.il> Content-Description: KioqIC91c3Ivc3JjL2xpYi9saWJmdHBpby9mdHBpby5oLm9yaWcJRnJpIEZl YiAgNyAwNDo1MTozMyAxOTk3DQotLS0gL3Vzci9zcmMvbGliL2xpYmZ0cGlv L2Z0cGlvLmgJRnJpIE1heSAgMiAxMDowMjozNiAxOTk3DQoqKioqKioqKioq KioqKioNCioqKiAyLDcgKioqKg0KLS0tIDIsOCAtLS0tDQogICNkZWZpbmUg X0ZUUF9IX0lOQ0xVREUNCiAgDQogICNpbmNsdWRlIDxzeXMvdHlwZXMuaD4N CisgI2luY2x1ZGUgPHN5cy9jZGVmcy5oPg0KICAjaW5jbHVkZSA8c3RkaW8u aD4NCiAgI2luY2x1ZGUgPHRpbWUuaD4NCiAgDQoqKioqKioqKioqKioqKioN CioqKiA0Miw2NCAqKio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klMRSAqZnApKTsNCiEgZXh0ZXJuIGludAlmdHBCaW5hcnkJX19QKChGSUxF ICpmcCkpOw0KISBleHRlcm4gaW50CWZ0cFBhc3NpdmUJX19QKChGSUxFICpm cCwgaW50IHN0YXR1cykpOw0KISBleHRlcm4gdm9pZAlmdHBWZXJib3NlCV9f UCgoRklMRSAqZnAsIGludCBzdGF0dXMpKTsNCiEgZXh0ZXJuIEZJTEUJKmZ0 cEdldFVSTAlfX1AoKGNoYXIJKnVybCwgY2hhciAqdXNlciwgY2hhciAqcGFz c3dkLAlpbnQgKnJldGNvZGUpKTsNCiEgZXh0ZXJuIEZJTEUJKmZ0cFB1dFVS TAlfX1AoKGNoYXIJKnVybCwgY2hhciAqdXNlciwgY2hhciAqcGFzc3dkLAlp bnQgKnJldGNvZGUpKTsNCiEgZXh0ZXJuIHRpbWVfdAlmdHBHZXRNb2R0aW1l CV9fUCgoRklMRSAqZnAsIGNoYXIgKnMpKTsNCiEgZXh0ZXJuIGNvbnN0CWNo YXIgKmZ0cEVyclN0cmluZwlfX1AoKGludCBlcnJubykpOw0KISBfX0VORF9E RUNMUw0KICANCiAgI2VuZGlmCS8qIF9GVFBfSF9JTkNMVURFICovDQo= --0-1674567254-862759172=:26341--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.970504174746.26341A-200000>