Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 16 Apr 2003 13:10:45 -0400 From: Lester Ingber To: cygwin AT cygwin DOT com Subject: why use __stdcall? Message-ID: <20030416171045.GA3056@ingber.com> Reply-To: Lester Ingber Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-URL-ALT: http://www.alumni.caltech.edu/~ingber/ When using Cygwin to produce DLLs for use in other software (Excel, TradeStation, Maple), etc., is it necessary to insert __stdcall between types/typedefs and function names? I'm just considering vanilla C code that runs on all platforms I've tested. If so, is it necessary to introduce __stdcall for all functions, or only those that are actually called by those utilities (and these call other C functions, etc.). I.e., do I have to rewrite lots of good working C code to introduce __stdcall throughout all code? If I do not use __stdcall (I do not seem to need this for simple cases?), what dangers lurk? To be explicit, I am creating DLLs and .def files using scripts like: set module = mydll gcc -c ${module}.c set old_lib = ${module}.o gcc -shared -mno-cygwin -o ${module}.dll \ -Wl,--out-implib=lib${module}.a \ -Wl,--export-all-symbols \ -Wl,--export-dynamic \ -Wl,--add-stdcall-alias \ -Wl,--enable-auto-import \ -Wl,--output-def=${module}.def \ -Wl,--whole-archive ${old_lib} \ -Wl,--no-whole-archive ${dependency_libs} Thanks. Lester -- Prof. Lester Ingber ingber AT ingber DOT com ingber AT alumni DOT caltech DOT edu www.ingber.com www.alumni.caltech.edu/~ingber -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/