From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to link new libraries when building emacs Date: Thu, 04 Apr 2024 09:47:36 +0300 Message-ID: <864jch8vzr.fsf@gnu.org> References: <87le5v2dto.fsf@yahoo.com> <8734s22cpe.fsf@yahoo.com> <87r0fl24yo.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27204"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eg642616@gmail.com, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 04 08:48:43 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rsGtv-0006rK-0F for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Apr 2024 08:48:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsGt3-0003OE-LT; Thu, 04 Apr 2024 02:47:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsGsv-0003O1-UH for emacs-devel@gnu.org; Thu, 04 Apr 2024 02:47:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsGsu-0005nB-6w; Thu, 04 Apr 2024 02:47:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3buTYkllVvOxLHpqu5ntrw8L4k8dpVfqTBYrmFDRAok=; b=SwhpgZhE7Wri ynl9xpBqftYJAtMa8TDVP3MsWYytN+F0w9pFe7oQXvcJhSaOWYwEZqFlP2zgy7rO4DKNGrwbAG8f+ of4gNkLHpZGUj+FzxPrkjNGQ+4tk2K8GItVbBQClpltAO70jKUUs0KDGRS1zxTRo6WKHLK+n7/PV8 jmF/ZBN+PKF4yoASygkktrvICwnqbQekWHSZ0Tyfj2Z1tr/orWTz7WMWxekLfcLUDKhx9hp+sul5B g+BC88rlwXRn3zXHWqOIKVlF8IzfeMVkf6X2qK3ZX/hw1QVws8wEXaDb6BP/v1/aR8pzG4ojwFupo m5FX/l6WTNaEzjbLhzw9WA==; In-Reply-To: <87r0fl24yo.fsf@yahoo.com> (message from Po Lu on Thu, 04 Apr 2024 11:15:43 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317514 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Thu, 04 Apr 2024 11:15:43 +0800 > > Elijah G writes: > > > Yes you are right, but since d1d2.h is also made in C i think it > > may be possible to import it into emacs, (except d2d1_helper headers > > since they are made in pure C++ (also i'm thinking of adding another > > header into emacs to add similar helper functions)), > > If this header requires a C++ compiler, I can't promise the additional > build-time requirement will be acceptable. AFAICT, that header can be used both with a C++ compiler and a C compiler. See the D2D_USE_C_DEFINITIONS macro in the header and how it is set and used. > > It's only a test that I made to check if it's possible to import it > > Without dueling with C++ and using their functions and/or variables > > in C (I'm not sure where I should move this code snippet). > > syms_of_w32font, perhaps? No, syms_of_w32font is run during dumping. The right place is in syms_of_w32uniscribe_for_pdumper, when 'initialized' is non-zero (i.e. not during dumping). This assumes that using Direct2D with the 'gdi' font back-end is either impossible or doesn't make a lot of sense anyway. I'm guessing that using Direct2D will need a whole new font back-end, since we'd need a different implementation of the main drawing methods exported by the font driver.