[HN Gopher] Windows dynamic linking depends on the active code page
       ___________________________________________________________________
        
       Windows dynamic linking depends on the active code page
        
       Author : signa11
       Score  : 57 points
       Date   : 2024-10-07 23:36 UTC (3 days ago)
        
 (HTM) web link (nullprogram.com)
 (TXT) w3m dump (nullprogram.com)
        
       | enriquto wrote:
       | This is a neat hack, and very well written. I felt a bit of
       | nostalgia looking at the (classical) cpp flex to avoid repeating
       | an identifier                  #define X(s) #s        #define
       | S(s) X(s)
        
         | shawnz wrote:
         | For the unfamiliar, what does this pattern do exactly?
        
           | ahartmetz wrote:
           | It turns a macro argument into a string of that argument.
           | Let's say you have a mydebug(expression) macro that should
           | print both "expression" and the value of expression.
        
           | jjnoakes wrote:
           | The macro X turns its argument into a string, but using it on
           | its own means you can't turn other macro values into strings,
           | only macro names.                   #define F 42
           | #define X(s) #s         X(5)  //  Expands to "5" (as a string
           | literal)         X(F)  //  Expands to "F" not "42"
           | 
           | If you add one level of recursive macro expansion, though,
           | that expands the macro argument as well as the macro
           | definition:                   #define F 42         #define
           | X(s) #s         #define S(s) X(s)         S(5) // "5" as
           | expected         S(F) // "42" because S(F) expands to X(42)
           | expands to "42"
        
           | enriquto wrote:
           | In that case it's just to convert the value of a macro into a
           | string constant                  cat > a.c        #define
           | X(s) #s        #define S(s) X(s)        char *f(void) return
           | { S(A); }        ^D             cc -E a.c        char
           | *f(void) return { "A"; }                cc -DA=B -E a.c
           | char *f(void) return { "B"; }
           | 
           | More interestingly, you can use this trick to create code
           | where some user-specified word appears as a string and as the
           | name of the function. Exercice: write a macro M(x) such that
           | compiling the code                   M(foo)         M(bar)
           | 
           | results in                   void print_foo(void) {
           | puts("foo"); }         voir print_bar(void) { puts("bar"); }
        
       | jiggawatts wrote:
       | I got the chance to evaluate vendors for a huge enterprise
       | because I was assisting their CTO. I vividly remember the sales
       | guy who flew from Redmond to pitch the shiny new Hyper-V virtual
       | machine platform Microsoft had just developed to compete head-to-
       | head with VMware.
       | 
       | "I tried the beta and it couldn't install successfully if I set
       | my regional options to en-AU."
       | 
       | "Umm... that's just a cosmetic issue."
       | 
       | "It's a hypervisor kernel, it is going to host tens of thousands
       | of our most critical applications and it crashes if I change one
       | of only three things it asks during setup. My confidence is not
       | super high right now."
       | 
       | Etc...
       | 
       | I got the impression that Microsoft is used to selling to PHBs
       | based on the look of shock on the guy's face when I told him that
       | I not only installed the product, but benchmarked it too for good
       | measure.
        
         | n_plus_1_acc wrote:
         | MS still makes they same mistake. Date format in Teams is just
         | broken. https://learn.microsoft.com/en-
         | us/answers/questions/1403096/...
        
           | mnau wrote:
           | Didn't they fixed it?
           | https://github.com/MicrosoftDocs/OfficeDocs-
           | SkypeForBusiness...
        
         | galkk wrote:
         | "I tried the beta and it couldn't complete the installer if I
         | set my regional options to en-AU."              "Umm... that's
         | just a cosmetic issue."              "It's a hypervisor kernel,
         | it is going to host tens of thousands of our most critical
         | applications and it crashes if I change one of only three
         | things it asks during setup. My confidence is not super high
         | right now."
         | 
         | No offense, but to me, the way it written, it shines bad light
         | rather on you. Obviously rep wouldn't answer you something
         | like:
         | 
         | "Well, it said it is beta, didn't it? The quality of the
         | installer of a BETA hasn't anything to do with the quality of
         | hypervisor itself. "
        
       ___________________________________________________________________
       (page generated 2024-10-11 23:00 UTC)