bugmake - Bugs: bug #47421, Add support for doing plugin macro...

 
 

bug #47421: Add support for doing plugin macro overloading

Submitted by:  Brian Vandenberg <phantal>
Submitted on:  Tue 15 Mar 2016 04:30:57 PM UTC  
 
Severity: 3 - NormalItem Group: Enhancement
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 4.1Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 15 Mar 2016 04:35:52 PM UTC, comment #1:

I forgot to say this w/regard to the code snippets: the spots where I'm registering the same macro name is what I want to be able to do, whereas the makefile snippet is workable albeit with a single function with a fair amount of conditional logic.

Brian Vandenberg <phantal>
Tue 15 Mar 2016 04:30:57 PM UTC, original submission:

As a preface: I recognize that what I outline below could be done in other ways with existing make syntax. I'm not interested in suggestions for alternative ways to get similar results.


I had a situation arise a few weeks ago where I had wanted to be able to do macro overloading.

I was experimenting with adding support for namespace-scoped variables.

I had originally written it as one function (each namespace was registered to the same function) but its execution time was rather high. I tested its expansion time with another macro I wrote for repeatedly expanding expressions to see the avg/std of the expansion time.

I had thought the problem might be the conditional logic. As a test I broke it up into separate macros with different names and it improved performance by an order of magnitude, but it was syntactically awkward because I needed a separate macro name for listing, setting, and getting as opposed to the more concise example below.

I'm using C++14 with gnu extensions for my plugin, but the syntax should make it obvious what I'm doing. Here's a sketch of what I had going:

... where it could be used like this:

Brian Vandenberg <phantal>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by phantal (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1