view dmd/man.c @ 435:74101be2a553

Added type param to DVarValue as DMD sometimes overrides the type of the VarDeclaration. Added support for align(1)/packed structs, other alignments are still ignored. Fixed some problems with accessing lazy arguments.
author Tomas Lindquist Olsen <>
date Wed, 30 Jul 2008 10:12:55 +0200
parents d03d748a9b5f
children f79bbd1d0b27
line wrap: on
line source

// Compiler implementation of the D programming language
// Copyright (c) 2008-2008 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// License for redistribution is by either the Artistic License
// in artistic.txt, or the GNU General Public License in gnu.txt.
// See the included readme.txt for details.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

#if _WIN32

#include <windows.h>

#pragma comment(lib,"shell32.lib")

void browse(const char *url)
    ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);


#if linux

#include	<sys/types.h>
#include	<sys/wait.h>
#include	<unistd.h>

void browse(const char *url)
    pid_t childpid;
    const char *args[3];

    char *browser = getenv("BROWSER");
    if (browser)
	browser = strdup(browser);
	browser = "firefox";

    args[0] = browser;
    args[1] = url;
    args[2] = NULL;

    childpid = fork();
    if (childpid == 0)
	execvp(args[0], (char**)args);
	perror(args[0]);		// failed to execute